run-time error when upload to flash
2006-01-06 by jingsian_lim
Hi everybody,
I am currently working on the mcb2140 with LPC2148.
I am facing problem in uploading to the board using philips lpc2000
flash utility. The code works well when simulated using the keil
software.
When i am trying to load to the board, an error message pop up:
run-time error '8015' could not set comm state, there may be one or
more invalid communications parameters.
The code can be uploaded successfully if i am using uart1 as a
replacement to the uart0 in my code below..
Anyone have any idea on how to fix the problem?
Below is my code:
#include<LPC214x.h>
#include<stdio.h>
void UART0_Init(void);
void UART0_Write(char);
void main()
{
int i;
char s[]="Hello World!\n";
UART0_Init();
while(1)
{
i=0;
while (s[i]!= '\0')
{
UART0_Write(s[i]);
i++;
}
}
}
void UART0_Init(void)
{
PINSEL0=0x05;
U0LCR=0x83;
U0DLL=97;
U0LCR=0x03;
}
void UART0_Write(char c)
{
while(!(U0LSR & 0x20));
U0THR=c;
}
Thanks