Serial input and portB output

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

Serial input and portB output

ソリューションへジャンプ
1,019件の閲覧回数
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 解決策
781件の閲覧回数
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 返答(返信)
781件の閲覧回数
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 件の賞賛
返信
781件の閲覧回数
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;

}

 

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 件の賞賛
返信