View previous topic :: View next topic |
Author |
Message |
Joseph88
Joined: 14 Aug 2006 Posts: 17
|
Trouble with 18f452 internal osc and RS232 |
Posted: Tue Dec 19, 2006 9:02 am |
|
|
Hello gurus,
I'm having trouble with my 18f452 on a picdem 2 board and rs232 communications. It will communicate properly if I have an EXTERNAL oscillator installed, but if I switch to the internal oscillator, the data received in the terminal is jibberish. Any help would be greatly appreciated.
Here is the code i'm using:
#include <18F452.h>
#fuses NOWDT,NOPROTECT,NOLVP
#use delay(clock=8000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, PARITY=N)
setup_oscillator(OSC_8MHZ);
void main() {
while(true){
printf("HELLO");
output_high(PIN_B3);
delay_ms(100);
output_low(PIN_B3);
}
} |
|
|
Mark Weir
Joined: 11 Sep 2003 Posts: 51 Location: New Zealand
|
Data Sheet |
Posted: Tue Dec 19, 2006 2:48 pm |
|
|
Hi,
I think you might ned to check the data sheet for this.
I don't think 18F452 has an internal osc.
Cheers
Mark |
|
|
Joseph88
Joined: 14 Aug 2006 Posts: 17
|
|
Posted: Tue Dec 19, 2006 2:50 pm |
|
|
Hi Mark,
Thanks for replying. Yes you are right, the 18f452 doesn't have an internal oscillator. I got the answer from the other ccs board. My bad.
Joe |
|
|
|