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 CCS Technical Support

#int_RDA Function in USB CDC mode

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



Joined: 02 Aug 2011
Posts: 4

View user's profile Send private message Yahoo Messenger

#int_RDA Function in USB CDC mode
PostPosted: Wed Oct 26, 2011 3:28 pm     Reply with quote

Hello.

I´m working with usb_cdc.h library which emulates a serial COM port on the PC. My question is how to replace the #int_RDA Function used with USART.

EX:
Code:
#int_RDA
void RDA_isr()
{
 valor=GETC();
}

void (main): ...

The example assigns a value for "valor" when USART reads an incoming character, meanwhile the micro is working on a DO-WHILE task...
Is there any interruption function in USB mode that make the same #int_RDA function?


Last edited by Logan on Wed Oct 26, 2011 3:35 pm; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19505

View user's profile Send private message

PostPosted: Wed Oct 26, 2011 3:34 pm     Reply with quote

It is already done for you.
USB, is by default entirely interrupt driven. Data is put into a USB data buffer.
Treat kbhit, as a replacement for your buffer not empty check, and the usb_getc, as a replacement for your code to get data from the buffer.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Oct 26, 2011 6:06 pm     Reply with quote

Have a look at the ex_usb_serial.c example program. Been there..done that..and it does work(once you've got the Windows driver(cdc_NTXP.inf) installed.
Also have a look at my '4550 woes' for more helpful hints.

J
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