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

P!C16F688 EUSART

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







P!C16F688 EUSART
PostPosted: Tue Sep 21, 2004 4:04 pm     Reply with quote

Hello
I have tried using #use rs232 (<options>) with the 16F688 and it did not work. I had to explicitly set/clear bits of registers to make it work. Of course then, I had to write my own putc and getc functions. Has anyone successfully used #use rs232 in PIC16F688?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 21, 2004 4:10 pm     Reply with quote

What version of the PCM compiler do you have ?
Rianna
Guest







PostPosted: Tue Sep 21, 2004 4:28 pm     Reply with quote

PCM programmer wrote:
What version of the PCM compiler do you have ?


How do I find out?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 21, 2004 4:41 pm     Reply with quote

Compile a small test program and then load the .LST file into
the MPLAB editor. The compiler version will be at the top
of the file. It will be a number like this: 3.211

For example, if you compile a source file called TEST.C,
then the list file will have the name TEST.LST.
Rianna
Guest







PostPosted: Tue Sep 21, 2004 4:45 pm     Reply with quote

PCM programmer wrote:
Compile a small test program and then load the .LST file into
the MPLAB editor. The compiler version will be at the top
of the file. It will be a number like this: 3.211

For example, if you compile a source file called TEST.C,
then the list file will have the name TEST.LST.


Thanks, it's 3.200. Now that I am trying to test again how it was not working, I used #use rs232(<options>) and putc() is not recognized according to the compiler.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 21, 2004 5:01 pm     Reply with quote

I installed PCM vs. 3.200 and compiled the test program shown below.
It compiled without error. However, vs. 3.200 does not recognize
that the 16F688 has a hardware USART on pins C4 and C5. It creates
a software UART for those pins. I don't have a 16F688 chip to test,
so I don't know if the software UART code actually works.

I installed vs. 3.211 (the latest version), and re-compiled the program.
Now it generates proper code for a hardware UART on those pins.

So, if you have PCW or PCWH, you could use the Device Editor to
edit the device data for the 16F688 and fix the problem.

If you only have the plain PCM compiler, then I suggest that you email
CCS and ask for a 1-day extension of your download rights, so you
can get a working version of the compiler for your PIC. CCS will
often do this.

Code:
#include <16F688.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT
#use delay(clock = 4000000)
#use rs232(baud=9600, xmit=PIN_C4, rcv=PIN_C5, ERRORS)

//==================

void main()
{
putc(0x55);

while(1);
}
Rianna
Guest







PostPosted: Tue Sep 21, 2004 5:12 pm     Reply with quote

I will do that. I'll keep this thread posted as to what happens when I get the newer version. Thank you very much.
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