Gremlins, or maybe the cats (if you have any).
Make sure you have plenty of capicitance on the VUSB pin. (.22uF to .47uF)
And have both a 10uF and 0.1uF capacitors on the Power Rails (VSS-VDD).
Plugged, RX_READY and TX_READY are just normal "Bits".
RX_READY indicates that data has been received. It should be cleared after use.
Code:
Main:
IF RX_READY THEN ; USB data has been rcvd
RX_READY = 0 ; clear the Ready flag
USBIN 1, Buffer, Cnt, Main
LCDOUT $FE,1,STR Buffer
ENDIF
TX_READY indicates that the device is plugged in and the SIE is ready to accept data to send.
Code:
IF TX_READY THEN ; USB is Ready to transmit
TX_READY = 0 ; clear the Ready flag
ADCIN 0, ADval
ARRAYWRITE Buffer,[DEC4 ADval," "]
USBOUT 1, Buffer, Cnt, TXfail
TXfail:
ENDIF
GOTO Main
Bookmarks