PIC C - Sending 200 values over USB, but it only sends 25 of them...
Posted
by Adam
on Stack Overflow
See other posts from Stack Overflow
or by Adam
Published on 2010-04-03T03:34:36Z
Indexed on
2010/04/03
3:43 UTC
Read the original article
Hit count: 276
I have a PIC18F4455 microcontroller which I am trying to use to send 200 values over USB. Basically I am using a for loop and a printf statement to print the values to the usb output stream. However, when the code executes I see in my serial port monitor that it is only sending the first 25 values, then stopping. My PIC C code is below. It will send out the 25th value (and the comma), but not send anything after and not send a newline character. I'm trying to get it to send all the values, then a newline character at the end. I am sending them all as characters because I can convert them on the PC end of it.
//print #3
for (i = 0; i <= 199; i++){if (data[i]=='\0' || data[i]=='\n'){data[i]++;}}
for (i = 0; i < 199; i++){printf(usb_cdc_putc, "%c,", data[i]);}
printf(usb_cdc_putc, "%c\n", data[199]);
© Stack Overflow or respective owner