2011-04-24, 10:37:19
(This post was last modified: 2012-12-22, 13:45:36 by Mikael Gustavsson.)
Hi,
As I see in PIC24FJ128GA110 datasheet (page 182) the UART baud rate with "BRGH = 1" calculated by following formula:
UARTBR = (FCY/(4*Baud Rate) -1)
but in BL code I see following:
.ifdef USE_BRGH
.equ UARTBR, ( (((FCY / BAUDRATE) / 2) - 1) / 2 )
.endif
The datasheet formula checked in my applications and work fine on 115200 bps baud rate.
So it's looking like there must be:
.equ UARTBR, ((FCY / (4*BAUDRATE)) - 1)
Is it try?
Regards.
Yuters
As I see in PIC24FJ128GA110 datasheet (page 182) the UART baud rate with "BRGH = 1" calculated by following formula:
UARTBR = (FCY/(4*Baud Rate) -1)
but in BL code I see following:
.ifdef USE_BRGH
.equ UARTBR, ( (((FCY / BAUDRATE) / 2) - 1) / 2 )
.endif
The datasheet formula checked in my applications and work fine on 115200 bps baud rate.
So it's looking like there must be:
.equ UARTBR, ((FCY / (4*BAUDRATE)) - 1)
Is it try?
Regards.
Yuters