Serial input and portB output

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

Serial input and portB output

Jump to solution
856 Views
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.

Labels (1)
Tags (1)
0 Kudos
1 Solution
618 Views
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!!!

View solution in original post

0 Kudos
3 Replies
618 Views
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 Kudos
618 Views
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;

}

 

619 Views
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 Kudos