CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

USB connection crashes 4800 baud serial emulation

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
tinley



Joined: 09 May 2006
Posts: 67

View user's profile Send private message Visit poster's website

USB connection crashes 4800 baud serial emulation
PostPosted: Tue May 09, 2006 10:02 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Fri May 12, 2006 8:31 am     Reply with quote

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);
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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