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

#use rs232 --> Is it using built-in (hardware) USART?

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







#use rs232 --> Is it using built-in (hardware) USART?
PostPosted: Sun Sep 18, 2005 12:48 pm     Reply with quote

I'm setting up a simple application on an 18F and am confused how in the project wizard, one can define which pins the RS232 routine is using. The built-in hardware UART is defined for pins 17 and 18 (Tx and Rx, respectively) on the 18F2550.

Does that mean the #use rs232 is using a software-based bit-banging UART, and not the built-in hardware-based one?

I suppose as long as I'm getting my data, I'm happy; but I'm curious about the details.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Sep 18, 2005 1:00 pm     Reply with quote

If you put Tx on pin C6, and Rx on C7, then you'll get the hardware
UART with that PIC. Anything else will give you a software UART.
Example for hardware UART:
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
Guest








PostPosted: Sat Sep 24, 2005 1:09 am     Reply with quote

Is it true also for i2c routines?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Sep 24, 2005 12:16 pm     Reply with quote

In the CCS manual, in the section on #use i2c, it says:
Quote:
Software functions are generated unless the FORCE_HW is specified.


So to get hardware i2c, you must use the hardware pins,
and use the FORCE_HW parameter. Example:

#use i2c(Master, sda=PIN_C4, SCL=PIN_C3, FORCE_HW)
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