Serial input and portB output

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Serial input and portB output

跳至解决方案
1,020 次查看
Looney
Contributor I

I am having problems trying to initialize the input serial port to read information and then output 3.3V to one of  the port B on the MCS12 microcontroller.. Does someone have a sample of how i might be able to do this.. My GUI is sending the information via serial port to the controller using the arrow directional pad.. It then sends that signal to the HCS12 which uses 4 ports output... If anybody has a posting let me know.. thanks.

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
782 次查看
JorgeOchoa
Contributor II

 

Hello!
The first thing to consider is to know what you're working bus speed. With this informationyou must set the baud rate (for the serial port is 9600) SCI baud rate = BUSCLK / (16 ×BR) where BR is a registrer of the microcontroller. When you are sure you have the correctbaud rate, you can start using the buffers that the module has to send and receive data (the case of JM60 SCIxD)

regards!!!

在原帖中查看解决方案

0 项奖励
回复
3 回复数
782 次查看
Looney
Contributor I

If anybody can help  me here it would be great.. I can attach a file that has some information to review for the following..

0 项奖励
回复
782 次查看
JorgeOchoa
Contributor II

Whit this function you can get data(Remember this code if fot the JM60, read about your microcontroller)

 

byte SCI_GetChar(void){ 

while(SCI2S1_RDRF == 0); 

return SCI2D;

}

 

Send Data

 

void SCI_PutChar(byte Data) {

  while(SCI2S1_TDRE == 0);

  SCI2D = Data;

}

 

783 次查看
JorgeOchoa
Contributor II

 

Hello!
The first thing to consider is to know what you're working bus speed. With this informationyou must set the baud rate (for the serial port is 9600) SCI baud rate = BUSCLK / (16 ×BR) where BR is a registrer of the microcontroller. When you are sure you have the correctbaud rate, you can start using the buffers that the module has to send and receive data (the case of JM60 SCIxD)

regards!!!

0 项奖励
回复