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

Re: External oscillator setting and issue with UART

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



Joined: 16 Jan 2008
Posts: 61

View user's profile Send private message

Re: External oscillator setting and issue with UART
PostPosted: Tue Feb 19, 2013 5:59 pm     Reply with quote

Hi All,

System Configuration:
- PIC16F1825
- External Oscillator 3.6864 MHz


We try to use baud rate 115200. For that we can't use internal oscillator, so we are using external oscillator of 3.6864 MHz frequency.

We set the fuses as follow -
Code:

#include <16F1825.h>
#device *=16 ICD=TRUE
#device adc=16

#FUSES ECM

#FUSES NODEBUG
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT_SW                   //No Watch Dog Timer, enabled in Software
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O

//#use delay(clock=20000000)


#use rs232(baud=115200, xmit=PIN_C4, rcv=PIN_C5)

With this setting uart doesn't work. With old internal clock and 9600 baud rate it does work.

Can anyone point out what we are doing wrong?

Thank you.

nehal
_________________
nehal
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 19, 2013 6:58 pm     Reply with quote

Where is your #use delay() ? It won't compile without it.

I added the #use delay(), also added ERRORS. It compiles OK with
vs. 4.140. What is your version ?
Code:

#include <16F1825.h>
#device *=16 ICD=TRUE
#device adc=16

#FUSES ECM

#FUSES NODEBUG
#FUSES NOWDT      //No Watch Dog Timer
#FUSES WDT_SW     //No Watch Dog Timer, enabled in Software
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP      //No low voltage prgming

#use delay(clock=3.6864M)

#use rs232(baud=115200, xmit=PIN_C4, rcv=PIN_C5, ERRORS)

//=======================================
void main()
{
char c;

c = getc();
putc(c);

while(1);
}   
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