@Darrel,
Hi, need some advice regarding the way the HID260 USB routine works.
I commented out the send section in my main code thus:
Code:
; if TX_READY = 1 and plugged = 1 then gosub SendUSB
if RX_READY = 1 and plugged = 1 then gosub GetUSB
if plugged = 0 then FirstSend = 1 'If we unplug then reset the first read packet as dont want it!
So this way I can check the sending of data from the PC to PIC. As the software is written to read the EEPROM data from the PIC first, the application displayed garbage values in the sliders which was as expected. Opening up the port monitor I got one TX report for each time I clicked on the update button, and whilst I couldn't see what values I was sending to the PIC, the LCD appeared to respond and display the change of values.
I removed the comment from that line and again the PIC was spewing report after report as you found. I therefore added the line
Code:
SendData:
USBOut 1, USBTXBuffer, USBBufferCount , SendData ' if bus available, transmit data
plugged = 0
return
The theory being that once it's sent that first report the software would then behave as if the USB lead had been removed - there was no change when the USB port was monitored. So I tried the following
Code:
USBOut 1, USBTXBuffer, USBBufferCount , SendData ' if bus available, transmit data
TX_READY = 0
return
Again, my logic thinking that once the report had been sent and the TX_ready state set to "not ready" it would stop transmission - but again no change. It's as if something else is over-riding the values used, which originate in the included HID260 file. The code I'm using doesn't have any other calls or conditions connected with the USB, just those IF / THEN statements to check the status of ready and plugged, and then the send and receive routines. Can you advise where or why over-riding these variables have no effects.
Cheers
Malcolm
Bookmarks