Getting data using Uart on Mc9s08mp16

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

Getting data using Uart on Mc9s08mp16

Jump to solution
1,020 Views
abhisheksaxena
Contributor II

Hello guys,

                    I am working with Mc9s08mp16 processor for controlling BLDC motor and in that process I want to get some parameters of BLDC out from the board.I am hoping that there is a way to get data through UART communication.

                     Any tutorials/documentation on how to accomplish that are appreciated.

                                       Thank you in advance for your time.

Labels (1)
0 Kudos
Reply
1 Solution
828 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi Abhishek

to set the SCI you need to use the following register

// Following a reset, BUSCLK ~ 4.20MHz

  SCIBD = 27;           // SCI baud rate = 4.20MHz/(16*27)=9722 bps

  SCIC1 = 0;  //default settings

  //enable transmitter and receiver pins, enables receiver interrupt

  SCIC2 =  SCIC2_TE_MASK |  SCIC2_RE_MASK | SCIC2_RIE_MASK;

Just check the bus clock that you has, in order to set the SCIBD

this is sample for and interrupt

interrupt VectorNumber_Vscirx void SCIRX_ISR(void)

{

  unsigned char u8receiver;

  (void) SCIS1;       // read SCIS1 register for clear RDRE flag

  u8receiver = SCID;

  

  SCID = u8receiver;

}

I hope this will help you

Regards

Vicente Gomez

View solution in original post

0 Kudos
Reply
1 Reply
829 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi Abhishek

to set the SCI you need to use the following register

// Following a reset, BUSCLK ~ 4.20MHz

  SCIBD = 27;           // SCI baud rate = 4.20MHz/(16*27)=9722 bps

  SCIC1 = 0;  //default settings

  //enable transmitter and receiver pins, enables receiver interrupt

  SCIC2 =  SCIC2_TE_MASK |  SCIC2_RE_MASK | SCIC2_RIE_MASK;

Just check the bus clock that you has, in order to set the SCIBD

this is sample for and interrupt

interrupt VectorNumber_Vscirx void SCIRX_ISR(void)

{

  unsigned char u8receiver;

  (void) SCIS1;       // read SCIS1 register for clear RDRE flag

  u8receiver = SCID;

  

  SCID = u8receiver;

}

I hope this will help you

Regards

Vicente Gomez

0 Kudos
Reply