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

16F886 uart ... eusart

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



Joined: 03 May 2010
Posts: 3
Location: Charlotte, NC

View user's profile Send private message Visit poster's website

16F886 uart ... eusart
PostPosted: Mon May 03, 2010 9:20 pm     Reply with quote

Hello,

I am migrating to the 16F886 in a product and I thought the chip had a uart. But the PCM compiler complains about my setup_uart(1200);

I looked for a command for the eusart ... didn't see it.

The data sheet shows a eusart connecting to pins TX and RX .

Am I supposed to use the #USE RS232 directive?

Thanks Kindly,
Jimmie
_________________
Jimmie Does
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon May 03, 2010 10:24 pm     Reply with quote

Yes, you have to invoke the library code with a #use statement before
the compiler will accept the setup_uart() function. Example:
Code:
#include <16F886.h>
#fuses INTRC_IO, NOWDT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

//============================
void main()
{
setup_uart(1200);


while(1);
}
Jimmie



Joined: 03 May 2010
Posts: 3
Location: Charlotte, NC

View user's profile Send private message Visit poster's website

16F886 uart ... eusart
PostPosted: Tue May 04, 2010 5:09 am     Reply with quote

PCM Programmer,

Thanks for confirming the #use rs232.

I see you used in your response:
#fuses INTRC_IO, ....
That, I think, is the same as the fuse listed in the data sheet as INTOSCIO which makes RA6 and RA7 run as IO pins ?

Jimmie
_________________
Jimmie Does
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 04, 2010 11:46 am     Reply with quote

Yes, that's right.
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