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.
解決済! 解決策の投稿を見る。
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
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