This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC17xx CMSIS driver

Hello,

I am using LPC1768 with CMSIS driver integrated into the compiler.
I have written a code for UART0 to send and receive a character. The following code successfully transfers "Press Enter to receive a message" on to the uart terminal.But in listening mode it is not receiving 'Y' letter and I am not getting next message to display on the uart screen.

#include "UART_LPC17xx.h"

extern ARM_DRIVER_USART Driver_USART0;
ARM_DRIVER_VERSION driver_version;

char cmd;

void ShortDelay(unsigned short i)
{
        while(i--);
}

void InitUART0(void)
{
        driver_version = Driver_USART0.GetVersion();
        Driver_USART0.Initialize(NULL);
        Driver_USART0.PowerControl(ARM_POWER_FULL);
        Driver_USART0.Control(ARM_USART_MODE_ASYNCHRONOUS|ARM_USART_DATA_BITS_8|
ARM_USART_PARITY_NONE |                                                                                         ARM_USART_STOP_BITS_1 |                                                                                         ARM_USART_FLOW_CONTROL_NONE,115200);

        Driver_USART0.Control(ARM_USART_CONTROL_TX,1);
        Driver_USART0.Control(ARM_USART_CONTROL_RX,1);
        Driver_USART0.Send("\nPress Enter to receive a message\r\n", 35);
        ShortDelay(10000);

        while(1)
        {
                Driver_USART0.Receive(&cmd,1);
                ShortDelay(10000);

                if(cmd == 'Y')
                {
                        Driver_USART0.Send("\nHello World!", 12);
                        ShortDelay(10000);
                }
        }
}