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

16f688 uart problems still

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



Joined: 16 Jan 2008
Posts: 7

View user's profile Send private message

16f688 uart problems still
PostPosted: Wed Jan 16, 2008 10:13 pm     Reply with quote

Hello,
I have been trying to program a 16f688 with the hardware uart enabled however It doesn't seem to work. I have looked all over this forum and noticed a mention that v3.2 of the compiler was screwed up and did not work. My question is what version of the compiler did they finally fix this or haven't they. I have tried it in version 4.038 and it seems to not work. If I just use pins A4 and A5 for a software uart, that works.

Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 17, 2008 12:31 am     Reply with quote

Try the following simple test program. lt uses the hardware UART pins.
See if it works.
Code:

#include <16F688.H>
#fuses INTRC_IO, NOWDT, NOBROWNOUT, PUT, NOMCLR
#use delay(clock=8000000)
#use rs232(baud=9600, xmit=PIN_C4, rcv=PIN_C5, ERRORS)

//===================================
void main()
{
printf("Hello World \n\r");


while(1);
}
leem



Joined: 16 Jan 2008
Posts: 7

View user's profile Send private message

PostPosted: Thu Jan 17, 2008 8:33 pm     Reply with quote

Thanks PCM. That worked. I guess I should have actually programmed a pic before I posted. I was running the code in the oshonsoft Pic Simulator and it didn't display anything. I tried your example and it also didn't work in the simulator either, but works fine if I program a chip. hmmm 2nd possible bug I have found in that software.

Thanks again
Gigalite
Guest







PostPosted: Wed Dec 10, 2008 8:38 pm     Reply with quote

This code doesn't seem to work at a 20MHz oscillator. Is there a #FUSES missing? Have somebody worked with the 16f688 uart at 20MHz that can provide a working code?
Ttelmah
Guest







PostPosted: Thu Dec 11, 2008 3:19 am     Reply with quote

Some obvious ones:
1) Internal RC oscillator, 8MHz max. - need to use 'HS' for an external 20MHz crystal, instead of INTRC_IO.
2) Voltage. 4.5v _minimum_, for 20MHz operation, as against 3v, for 8MHz operation.

Best Wishes
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