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

Pic16f688

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







Pic16f688
PostPosted: Mon Jun 12, 2006 1:16 am     Reply with quote

Hi
i'm using the 16f688 and i ewant to use the uart like an rs232. Anyone know if there's a problem? And what is the code to write? Plesa help
Ttelmah
Guest







PostPosted: Mon Jun 12, 2006 2:46 am     Reply with quote

I don't think anyone will understand the question as posted, since it doesn't really tell us what you actually want to do. However, since this is a commonly 'misunderstood' part of the chip, I'll post an 'overview' of serial comms.

RS232, is a description of a voltage signalling standard, used to send asynchronous serial communications. As such, the PIC, _cannot_ generate this standard, without an external hardware transceiver (MAX232 etc.).
The UART, can generate 'TTL' level serial, that can drive such a transceiver to give the standard 'RS232' communications. The '#use RS232' command sets up the internal UART, to the correct values, ready to drive such a link (but can equally well drive an RS485 link, with a different transceiver, so the command itself is really a misnomerl)....
So, to generate 'RS232', you need:

#USE RS232, with the baud rate, word length, and parity settings for the link.

A suitable hardware transceiver to generate the signalling standard.

You can then send characters with 'putc' (for single characters), or 'printf' (for formatted strings of data), and retrieve characters with 'getc'.

In both directions, there is only a tiny amount of hardware buffering (basically two characters), so unless you can guarantee that your code can retrieve and interpret the incoming characters at the required rate, software buffering will need to be added. EX_SISR, is the example of how to handle a software buffered serial receive.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 12, 2006 11:56 am     Reply with quote

Quote:

I'm using the 16f688 and i want to use the uart. Anyone know if there's
a problem?

If you have a compiler version of 3.200 or a few versions after that,
there will be a problem. If that is the case, then you need to upgrade
the compiler.
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