This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Send multiple data to LCD over UART.

Hello everyone,

I have a little problem with sending my data to the lcd.

So my Stellarisware is connected with a LCD. I send my hexadecimal commands serially to the LCD.

Nothing happens but after that I push the reset button of my Stellaris my LCD-reacts. If I send for example 2 cmds to the LCD I have to reset 1 time for the first cmd to reach the LCD. And then I have to push again on the reset button for the 2 cmd.

Do I miss an important detail?

for (i = 0; i < 1000000000; i++);                                                                               // Delay for LCD
/* Sending first command to LCD*/
 ROM_UARTCharPutNonBlocking(UART0_BASE,WRITE);                              // Write Cmd
ROM_UARTCharPutNonBlocking(UART0_BASE,DIGITS); // Object Type
ROM_UARTCharPutNonBlocking(UART0_BASE,DIGITS_OBJECT_ID); // Object ID
ROM_UARTCharPutNonBlocking(UART0_BASE,MSB); // MSB Data
ROM_UARTCharPutNonBlocking(UART0_BASE,LSB); // LSB Data
 // Calculate Checksum
CHECKSUM=WRITE^DIGITS^DIGITS_OBJECT_ID^MSB^LSB;
ROM_UARTCharPutNonBlocking(UART0_BASE,CHECKSUM); // Checksum

if( UARTCharGet(UART0_BASE)==ACK) // Wait for Acknowledge LCD
{
 /* Sending second command to LCD*/
 ROM_UARTCharPutNonBlocking(UART0_BASE,WRITE);                                // Write Cmd
ROM_UARTCharPutNonBlocking(UART0_BASE,DIGITS); // Object Type
ROM_UARTCharPutNonBlocking(UART0_BASE,DIGITS_OBJECT_ID); // Object ID
ROM_UARTCharPutNonBlocking(UART0_BASE,MSB); // MSB Data
ROM_UARTCharPutNonBlocking(UART0_BASE,0x03); // LSB Data
// Calculate Checksum
CHECKSUM=WRITE^DIGITS^DIGITS_OBJECT_ID^MSB^0x03;
ROM_UARTCharPutNonBlocking(UART0_BASE,CHECKSUM); // Checksum
}
// Loop forever echoing data through the UART.

while(1)
{
}
}

  • Following data would prove helpful:

    a) Set-up/Config code for UART0

    b) Set-up/Config for Port "containing" pins used as UART0

    c) link to your serial Lcd w/model #

    d) which MCU?  which board?  have you scoped or otherwise monitored the UART0 TX for output?

    e) you describe the Lcd with, "reacts."   Does this mean that the correct data appears?  If so - likely that you have the baud-rate, # of bits, parity correct - but "reacts" is a very poor descriptor...  (i.e. could mean that it blinks, b/l (if any) brightens/dims etc...)

    f) unstated is whether this "reaction" occurs under Debug - or in stand-alone mode. 

    Some/much/all of the above will better assist remote diagnosis...

  • Why are you using the ROM_UARTCharPutNonBlocking function? It is require a delay before sending a new symbol that put into UART (you must make sure that previous symbol transmitted), but I don't see one in your code. Try to use ROM_UARTCharPut function instead.

     

  • Original post - imho - lacked detail to properly diagnose.  Poster's use of "react" raises more questions than it answers...

    Have long background in displays - suspect his is character lcd module operated in "nibble" mode.  There is no delay requirement between sending 2nd nibble after first. (when sending a single char)  Successive chars usually require 40uS (or so) delay - hard to imagine that UART doesn't absorb this (and more) time in the serial process.

    There are severe delay requirements during initialization - and the process to initialize w/in 4 bit (nibble) mode is demanding.  As we're not told the nature of (the assumed) serial to parallel converter in play on this "mystery" serial display - and poster has "fled the scene" - we are too likely xxxxing (censored) into the wind...

    Update: looking again @ original post (now long idle) must plead insanity (temporary) re: suggestion this is character lcd in nibble mode.  Appears instead to be "Maxim-type" lcd/led driver ic - and w/out some identification - helpers likely are overmatched...  and really - we should not have to "guess" - cluelessness of such posts disturbs...

  • Hello everyone,

    Sorry for the late reply, I totally forgot that this thread wasn't closed yet.
    I simply replaced the for-loop in a while-loop for the ACK and everything works fine now. 

    Again sorry for the bothering