PDA

View Full Version : USB CDC serial duplex string example wanted



russellperry
- 31st January 2014, 19:33
Does anyone have a beginners code example, say based on the PDS CDC demo bas file, that illustrates sending a complete STRING from the PC host to the PIC and then have the PIC send the string back to the host?

Nearly every example I've looked at shows byte transfer or single character transfer in one direction only. Wastrix showed some code a couple of years back which echos data one character at a time, and Les's example show a multitude of options for send strings from the PIC but I'm trying to get my head around capturing a complete STRING in one go AT THE PIC END and then once the string is complete sending that back to the host. Basically I want to type Hello World on the terminal and once the final d character is sent out have the PIC send Hello World back. It's probably dead easy for some of the gurus here but frankly I'm struggling.

Any takers?