MC9S08PT8VLC - Setting Baud rate to 9600

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S08PT8VLC - Setting Baud rate to 9600

799 Views
amitmallick
Contributor I

Hi NXP Support,

 

We are using the freescale microcontroller MC9S08PT8VLC to communicate with a Zigbee network. The communication with Zigbee is possible at 9600 baud rate. Could you please assist us on how we can set the baud rate of the chip. Below is a snippet of the code we are using to flash the MC. 

 

void PC_UART_Init(void)
{
SYS_SOPT2 &= (byte)(~(byte)(0x80U));

PORT_PTCOE = PORT_PTCOE & ((byte)(~(byte)(0x40U))) | (byte)(0x80U);
PORT_PTCIE = PORT_PTCIE & ((byte)(~(byte)(0x80U))) | (byte)(0x40U);
PORT_PTCD |= (byte)(0x80U);

SCI1_C1 = (byte)(0x00U);
SCI1_C3 = (byte)(0x00U);
SCI1_C2 = (byte)(0x00U);
SCI1_S2 = (byte)(0x00U);
#ifdef INTERNAL_CLOCK
SCI0_BDH = 0x00U;
SCI0_BDL =0xC3U; //9600
#endif
#ifdef EXTERNAL_CLOCK
SCI0_BDH = 0x00U;
SCI0_BDL = 0x34U; //9600
#endif

 

Please assist us how can we reset the baud rate of MC to 9600. Let us know in case you need any other information.

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

618 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi.

if use 31.25k internal clock,The FLL loop locks the frequency to the 512 times the internal reference frequency.

with FEI mode, FLL output = 31.25k*512=16MHz

BUSCLOCK= FLL output/BDIV= 16/1=16M, here BDIV is bus frequency divide

SCI baud rate = BUSCLOCK/SCIBD/16=16M/104/16=9615

(SCIBDL=0x68 which decimal number is 104)


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply