|
|
View previous topic :: View next topic |
Author |
Message |
cypher
Joined: 05 Oct 2007 Posts: 31
|
RS232 problem with Internal Oscillator |
Posted: Thu Jan 17, 2008 5:44 pm |
|
|
Hi,
I'm having some trouble with getting my printf command working. I'm using a PIC18LF6722 (the low power version). I'm using the internal osciallator at 4MHz. I do not have a serial driver such as a MAX232. The RX and TX go straight from the PIC to the serial port. All I get on the output is some garbage. Here's the code:
Code: |
#include <18F6722.h>
#device ADC=10
#include <stdio.h>
#include <math.h>
#include <ctype.h>
#include <stdlib.h>
#fuses INTRC,NOWDT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, parity=N, bits=8)
void main(void)
{
printf("Hello World");
}
|
I know the MAX232 inverts the serial pins, but since I didn't have one, I used the invert parameter in the *use rs232 directive, but the complier complained with the following command:
USE parameter value is out of range H/W USART can not invert
Any suggestions what I'm missing? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
cypher
Joined: 05 Oct 2007 Posts: 31
|
|
Posted: Thu Jan 17, 2008 6:32 pm |
|
|
Thanks! That worked. I don't have a 22K, but a 1K in series. But it works. |
|
|
|
|
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
|