Getting data using Uart on Mc9s08mp16

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Getting data using Uart on Mc9s08mp16

ソリューションへジャンプ
945件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
1 解決策
753件の閲覧回数
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 件の賞賛
返信
1 返信
754件の閲覧回数
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 件の賞賛
返信