I’m programming on the PIC18LF45K50 based on the LCD version firmware.
I have two questions:
- About the baud rate setting of RN2483 MOTE’s UART ports.
The chip’s default baud rate is 57600 (it needs to communicate with RN2483 module and my computer serial software’s baud rate is also 57600 to get the right communication value)
Now, I would like to change it to 9600.
I checked the chip manual and found that if I want to get the desired baud rate, I need to fill in the right register value. In the manual, the corresponding value have shown in a chart:
However, I checked the configuration files and found that, actually, the register value is wrong:
The value is 208, even not 207!
And I try to set baud rate 9600 through MCC, but the value is still not the same as the manual.
That puzzles me.
I have no idea how to get the right value of SPBRGH:SPBRG
- About soft serial ports’ timer setting
(It can be the same question, I guess)
I want to program a pair of soft UART ports. The baud rate needs to be 9600.
I use the system clock, because the secondary oscillator counts too slow…And the same question occurs, I cannot find the right value of the timer.
The system clock has 3PLL and I don’t know what it can influence the calculation
I guess in fact the UART register’s value can be the same as the timer value, but I cannot get the two values right.
I use MAPLAB X IDE to do the programming.
Does anyone have some ideas?