ds30 Loader free edition forums
Problems with hardware UART - Printable Version

+- ds30 Loader free edition forums (https://picbootloader.com/forum)
+-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3)
+--- Forum: 8-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=7)
+--- Thread: Problems with hardware UART (/showthread.php?tid=2338)



Problems with hardware UART - velostar - 2015-01-18

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?


RE: Problems with hardware UART - Mikael Gustavsson - 2015-01-19

Hello,
What if you clear the BRGH bit in the TXSTA register in your application?


RE: Problems with hardware UART - velostar - 2015-01-23

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!