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

Problem with usb_cdc_getc() [Solved]

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



Joined: 14 Aug 2009
Posts: 6
Location: Seattle, WA, USA

View user's profile Send private message

Problem with usb_cdc_getc() [Solved]
PostPosted: Mon Aug 17, 2009 3:45 am     Reply with quote

I'm pulling my hair out over this one. I've got the USB code mostly working. It enumerates fine and shows up as a COM port on my PC.

Using two hyperterminals, I'm able to send characters from my serial port to USB. However, when I send a character from USB to RS232, I always receive the same character, regardless of what I type. Each character generates an interrupt, as it should, but it receives the same char each time.

One thing that's interesting is the character that gets received sometimes changes with a power cycle on the board, but otherwise, it's the same for any given session.

I'm able to manually putc() to RS232 and usb_cdc_putc() to USB any text that I choose, and it works fine. I can do this repeatedly and it never hangs, so I think the hardware is fine. The only thing not working properly is usb_cdc_getc().

I'm using a PIC18F2550, CCS 4.094 with an ICD2.

Anyone else had as similar problem? I've searched the forums and found nothing like this.
sarodrig



Joined: 14 Aug 2009
Posts: 6
Location: Seattle, WA, USA

View user's profile Send private message

Fixed
PostPosted: Mon Aug 17, 2009 4:26 am     Reply with quote

Somehow, I managed to corrupt my usb_cdc.h file, breaking it only enough to cause this problem. I recopied the file from the original PICC\drivers directory and the problem went away. I only wish I tried that earlier!
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