|
|
View previous topic :: View next topic |
Author |
Message |
tinley
Joined: 09 May 2006 Posts: 67
|
USB connection crashes 4800 baud serial emulation |
Posted: Tue May 09, 2006 10:02 am |
|
|
Hi,
I am having trouble getting USB to work fast enough for my application. The application has two RS232 inputs, (each up to 50% active) at 4800 BAUD which it merges into one 4800 output. I also want to output this stream to USB. I have tried writing my own subroutine 'usbout()' which helps, but still it keeps crashing the USB connection.
Please help?
CCS PCH C Compiler, Version 3.249, 27988 09-May-06 15:48
Filename: USB_Merger.lst
ROM used: 6722 bytes (21%)
Largest free fragment is 26042
RAM used: 1617 (79%) at main() level
1704 (83%) worst case
Stack: 13 worst case (6 in main + 7 for interrupts)
void usbout(char *sl){ //////////////////////////////////////////////////////////////////////////
char *s;
for (s=sl; *s != '\0'; s++){
//while(!usb_cdc_putready()){ //wait for usb buffer
// restart_wdt();
//}
delay_ms(1); //this helps prevent usb crash
usb_cdc_putc(*s);
}
} |
|
|
tinley
Joined: 09 May 2006 Posts: 67
|
|
Posted: Fri May 12, 2006 8:31 am |
|
|
Fault found... hardware, not software. I hadn't fitted the 220n capacitor on the Vusb pin.
Interesting to note that with the amount of data and sentence lengths I am sending, (up to 100 chrs), the following function is still required as printf(usb_cdc_putc,txBuffer) crashes the USB! :
void usbout(char *sl){
char *s;
for (s=sl; *s != '\0'; s++){
usb_cdc_putc(*s);
}
}
usbout(txBuffer); //in place of printf(usb_cdc_putc,txBuffer); |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|