AnsweredAssumed Answered

How does one send ASCII values through UART on bf518?

Question asked by magicfiv on Mar 23, 2010
Latest reply on Apr 13, 2010 by Andreas

The scope of the project consists of outputting a stored number of type double to an Vellemen pmk158 LCD screen via RS232 communication.  I have the bf518f eval-board, and want to send an ASCII value to the LCD by utilizing the UART port.  The Uart_test example program was build, but I am having trouble getting the right baud rate.  The pmk158 has a baud rate detection of 2400 N/8/1, but the example code given for the Uart test includes a baud rate of  115200.

 

The confusion occurs when the hex value 0x15A2 gets mapped onto the divisor latch registers in the Init_Uart function as follows:

 

#define BAUD_RATE_115200     (0x15A2 >> 7)

 

// rest of program

 

/*****************************************************************************
*
*  Read period value and apply formula:  DL = PERIOD / 16 / 8
*  Write result to the two 8-bit DL registers (DLH:DLL).
*
****************************************************************************/
    *pUART0_LCR = DLAB;
    *pUART0_DLL = BAUD_RATE_115200;
    *pUART0_DLH = (BAUD_RATE_115200 >> 8);

 

What do I enter for the #define BAUDE_RATE_ to map the correct divisor for a 2400 N/8/1 LCD?

 

Correct me if i'm wrong, but once baud rates are matching then I can call either the PutChar or PutString function to send an ASCII value through the UART?

 

Any help will be apprecited GREATLY

 

Thanks,

Miles

Attachments

Outcomes