Post Reply 
The holy grail of the BEEP(1400, 0.08) command: USB-HID
12-24-2021, 04:22 PM
Post: #3
RE: The holy grail of the BEEP(1400, 0.08) command: USB-HID
Absolutely! JP7 LOW (2,3) and JP9 HIGH (2,1) will do the trick to enable the UART (do not let those pins float..)
If JP7/JP9 are both at the same level, I2C is the first HID interface reported and used by the Prime (although both interfaces appear in an USBOpen()).
So if you can live with the default settings of N81, 19200, that is what you get. The UART interrupt report is also enabled, the code currently does not deal with it much (line 109), but is available as another input signal.
The only code change required is the opcode in the sending routine to indicate the FT260 UART, changing from 207 to 239 (line 140).

I initially had the opcode dynamic, based on ft_io setting (line 24). I ran a long time the UART only (YAT (terminal), SimpleHID (HID utility) on a PC), as well as on the Prime. But after a very reliable source mentioned about the interrupt only operations on the Prime, I moved on to the I2C interface since I needed different baud rates. If you keep power to the FT260 'somehow' (small battery/caps), you can configure the UART on a different computer. But what fun is that?

You can use the ft260_recv() routine for receive. Receive even works on the emulator (using SimpleHID to get/set features manually(!), then close SimpleHID and use the Prime/UART)
You have to watch out for buffer over runs, (Prime , FT260 at 64 bytes) So you might need a WAIT(0.1) between sending and receiving cycles, and/or play with the block size in the send routine.
(You can copy the code from ft260_i2cSend() into ft260_USend(), change the opcode and block size (bsize) for UART operations.)

And remember, the TX/RX lines are 0~3.3V out of the FT260, not RS232 (but an HP50 will like that...)

Here is a receive terminal program I used (exit still declared in the previous provided example):

Code:

EXPORT ft260_Term() // loop to receive UART data until <esc>
BEGIN
LOCAL txt;
ft260_open();
PRINT();PRINT("FT260 terminal started");
REPEAT
  txt:=ft260_recv();
  IF SIZE(txt)>0 THEN 
    PRINT("RX: "+STRING(CHAR(txt))); 
  END;
UNTIL exit;
UClose();
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: The holy grail of the BEEP(1400, 0.08) command: USB-HID - gehakte_bits - 12-24-2021 04:22 PM



User(s) browsing this thread: 1 Guest(s)