ds30 Loader free edition forums

Full Version: Problems with hardware UART
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
in my private project I use the PIC18F45K22 with an external quartz clock of 8MHz.
Therein I use some capture (CCP) and timer routines from older projects (based on PIC 16F887 @ 8MHz).
In order to use this I made the following setting in the DS30 source software:
Settings.inc:
#define FOSC  8000000   ; 8MHz

config  FOSC = HSMP   ; external oscillator block medium power
config  PLLCFG = OFF       ; Oscillator used directly ( Disabled – 16F887 has no PLL  )


After rebuilt in MPLAB I receive no errors.
Well done (?) - Speed measurement with CCP and used timers works fine.

But: In my program I use UART data communication with 9600 bps.
(UART1_Init(9600): This will initialize hardware UART1 module and establish the communication at 9600 bps.)
In my HyperTerminal program on PC I must change the Baud rate from 9600 to 38400 to receive accurate and readable messages. I don’t know what happens!!
My guess: 38400= 4x 9600! – PLL active? But I switched PLLCFG = OFF (s. above)      

What’s going on?
Hello,
What if you clear the BRGH bit in the TXSTA register in your application?
Hello,

thank you for supporting me. You are absolutly right.
I set BRGH_bit = 0 and the communication works prober.
UART_Init(9600) and Terminal baud rate = 9600

Thanks again!