UART Communication

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

UART Communication

Jump to solution
1,040 Views
blakehodder
Contributor III

Hi,

 

I am using a MCF52255 and trying to use the UART without using the RTOS. Could someone please point me in the direction of an app note or other documentation on this.

 

Regards,

 

Blake

Labels (1)
Tags (3)
1 Solution
721 Views
DavidS
NXP Employee
NXP Employee

Hi Blake,

You can goto the MCF5225x product page on the Freescale website (or google it) and select the Software/Tools tab.

It has baremetal example code:

MCF5225X_SAMPLE_CODE: MCF5225x_SAMPLE_CODE.

Size (K): 1427 Format: zip Rev #: 0 Modified: 12/22/2008


Please note that as product age, so do the examples implying that the latest IDE's like CW10.x might not be supported.

Regards,

David

View solution in original post

0 Kudos
5 Replies
722 Views
DavidS
NXP Employee
NXP Employee

Hi Blake,

You can goto the MCF5225x product page on the Freescale website (or google it) and select the Software/Tools tab.

It has baremetal example code:

MCF5225X_SAMPLE_CODE: MCF5225x_SAMPLE_CODE.

Size (K): 1427 Format: zip Rev #: 0 Modified: 12/22/2008


Please note that as product age, so do the examples implying that the latest IDE's like CW10.x might not be supported.

Regards,

David

0 Kudos
721 Views
blakehodder
Contributor III

Hi David,

I now have my uart working at the right baud but when I am sending something such as 0x4A its sends ok but will change to 0x29.

What would cause this?

Blake

0 Kudos
721 Views
DavidS
NXP Employee
NXP Employee

Hi Blake,

Are you setup a simple MCF52259 to a PC terminal window?

Have you oscoped the output?

Regards,

David

0 Kudos
721 Views
blakehodder
Contributor III

Hi David,

I was over pushing my uart. The MCU was running at such a rate that since I was only sending a value with my program that the uart was not keeping up with the MCU. Once I stuck the delay in, it functioned perfect.

Thanks for all your help.

Blake

721 Views
blakehodder
Contributor III

Hi David,

Actually at the moment I am connected to a PC via a logic analyzer. If I send 0x55 it works no problem and always sends 0x55 but when I send 0x4A or other values thats when it changes. This is how I send it:

void putc(char val)

{

  while(!(MCF_UART0_USR & MCF_UART_USR_TXRDY) || !(MCF_UART0_USR & MCF_UART_USR_TXEMP) ){

  }

  MCF_UART0_UTB = val;

}

Blake

0 Kudos