thanks that was just the little gem of info i was missing!
And it works!
thanks that was just the little gem of info i was missing!
And it works!
Simple code in a loop...
After about 30 minutes, stops running......Code:' Main Program Loop Loop: USBOut 3, Buffer, Cnt, loopy loopy: porta=170 ' fancy led pattern0 pause 500 porta=85 ' fancy led pattern1 pause 500 goto loop end
Pic is stable etc had it running 24hrs+ on a simple led flasher. (on same dev board)
any guesses?
Last edited by f_lez; - 28th February 2010 at 19:54.
Well, it's a Total guess but ...
Try adding a USBIN statement to the loop.
If anything comes in, and the SIE doesn't get released, everything locks up (including the PC application).
The reason I say it's a guess is because it requires recieved data.
If you are using HyperTerminal then you would need to type something to have it happen.
DT
I dopnt know whats going on TBH, I watched it fail after about 30 mins, twice, I saw it fail after ten, I gave up hitting my head and posted the above, and then left it running, 2hrs later it was still running, I went to bed, got up this morning, still running, I went out for a few hours, come back, still running....
I can only guess something upset the pic at an hardware level because i have changed nothing at the software level. (I have even glued the crystal to the crystal socket!)
Anyhow.... these nuggets..
Do you an an example line for those?Plugged indicates when the device is fully connected to the PC.
RX_READY indicates when a report has been received.
TX_READY indicates when it's OK to Send. The device is Plugged and the SIE is ready to accept data.
Once upon a time getting data into the pic was fairly easy, now I have to keep the pic doing some monitoring of its io pins but at same time accepting commands from the fake comport, so seeing if any data was waiting, as it seems to have very little in the way of flow control would be useful. (what happened to the wonderful buffers and fifo's on real hardware!)
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.
TX_READY indicates that the device is plugged in and the SIE is ready to accept data to send.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
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
DT
Thanks for that i'll have a play with them tonight, shame i am away form home for tomorrow as i know this will be on my mind all day, issue is having two incoming serial data streams, and an outgoing serial + the usb out....
Neither of the incoming streams seem to wait, so i have to write code that will be quick enough to read a command and react according ly before waiting for the next serial command or change of IO state, which would also require a serial out for status.... Oh and a RTC would be nice so i can say what time things happened.
Its all so simple when i explain it real life....
Hallo Darrel
a question i have used your code and it work 100% with a array of 8 values, if i would like to transfer more values do i need to edit your file as well as in the main program
Bookmarks