|
|
View previous topic :: View next topic |
Author |
Message |
nehallove
Joined: 16 Jan 2008 Posts: 61
|
Re: External oscillator setting and issue with UART |
Posted: Tue Feb 19, 2013 5:59 pm |
|
|
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
|
|
Posted: Tue Feb 19, 2013 6:58 pm |
|
|
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);
} |
|
|
|
|
|
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
|