Are there someone who have used the UART0 on an Olimex board. I am working with an Olimex LPC2103 board and when I tried their example of the UART0, it doesn’t work.
The problem is when I connect the serial cable on my PC, the Olimex serial port send me a lot of data, even if I don’t begin to compile and run the program.
I think that the board must be crazy, because it send me data whereas it doesn’t begin to work.
I’m not familair with this board, but it sounds like the ISP flash programming routine may have been activated? Is there a DIP switch on the board to control this?
I checked in several forum and tried programs examples given by constructors, but I can make the UART0 works. Below is my code, it works, but it transmits wrong data:
#include <targets/LPC210x.h>
int main(void)
{
PINSEL0 = 0x00000001; //enable UART0_TX
IODIR = 0x00000001; // P0.0 as an output for serial UART0_TX
/* Configure UART */ // no using PLL
U0IER=0x00; // disable all interrupts
//U0FCR=0x07;
U0LCR=0x83; //8 bit, 1 stop bit, no parity, enable DLAB
U0DLL=93; // for 9600 baud at 14,7456MHz
U0DLM=0x00;
U0LCR=0x03; // disable DLAB
//while((U0LSR & 0x40) == 0){}
U0THR = ‘H’; // transmit ‘H’
return 0;
}
it transmits : ’ û ', or ’ þ ’ or ’ ÿ ', it changes at each time