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 using PIC18F4550 and Hyperterminal

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







USB using PIC18F4550 and Hyperterminal
PostPosted: Fri Aug 10, 2007 12:03 pm     Reply with quote

I currently have a PIC18F4550 based system wired up.

The CDC driver appears to have installed correctly on my XP system as it shows up as another COM port.

I modified the ex_usb_serial.c code to skip the if(kbhit()) code and just run the USB code. I compiled and burned into the PIC. When I launch Hyperterminal and configure it to use the new COM port, I get the initial "CCS CDC (Virtual RS232) Example" message but do not get any other keystrokes that I type.

Since the message is coming from the usb_debug_task() function, it appears everything is functioning up to were it begins blocking on the usb_cdc_kbhit() function.

Has anyone had a similar problem. Any suggestions as to what may be happening?
Ttelmah
Guest







PostPosted: Sun Aug 12, 2007 2:53 am     Reply with quote

The problem is that by getting rid of kbhit, you are not looping through the 'usb_task' call.
There are a lot of stages to USB starting up. This call _needs to be called, until 'usb_state == USB_STATE_ATTACHED' is true, and will need to be called again, if the connection is broken_. This is why CCS have their code looping through this, while waiting for characters. Without this, the device cannot 'attach' to the USB. As it stands, if you only call this once, it'll only work, if the timing at both ends just happens to owrk out...

Best Wishes
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