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

UART hardware or software. What...?

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



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

UART hardware or software. What...?
PostPosted: Wed Feb 05, 2014 8:28 am     Reply with quote

What is the condition, configuring UART as hardware?
Let assume that both RX and TX pins are hardware UART transfer pins.
Code:
#use rs232(baud=whatever, xmit=TX_hardware_pin, rcv=RX_hardware_pin)

Is the code^^ configured as hardware UART?
As I know the only thing that makes different between hardwae and software UART is wich pins we use for rcv/xmit. I examined the entire CCS User Manual and I didnt see explaination.
_________________
A person who never made a mistake never tried anything new.
temtronic



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

View user's profile Send private message

PostPosted: Wed Feb 05, 2014 8:33 am     Reply with quote

Providing both xmt and rcv pins are optioned AND are are hardware UART pins, then the hardware UART will be used.Any other 'configuration' will create a software UART,unless some 'tricks ' are used.


Just create a small program,compile, printout listing and see what registers the compiler uses for the serial I/O.

All this is based on the PIC having a UART !

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19544

View user's profile Send private message

PostPosted: Wed Feb 05, 2014 8:38 am     Reply with quote

Yes.

Though must easier and safer to use:

Code:

#use rs232(baud=whatever, UART1, ERRORS)

In the manual:

"UART1
Sets the XMIT= and RCV= to the chips first hardware UART."

Same for UART2 etc..

It is in the manual, if you select the section 'RS232 I/O overview' at the bottom of the #use rs232 page.

You _must_ always have the ERRORS statement, when using the hardware UART, unless you add error handling code yourself, or the UART can become hung.

This is in the main manual page as a warning at the bottom of the page.
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Wed Feb 05, 2014 11:10 am     Reply with quote

I see now. Dont get me wrong, I read about UART1/UART2 described in user manual, but I thought we use it/them in case we have two hardware UARTS. My device has one. Aniway I understood. Thank you guis!
_________________
A person who never made a mistake never tried anything new.
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