I've made a simple program:
Code: Select all
sbit LCD_RS at LATD2_bit;
sbit LCD_EN at LATD3_bit;
sbit LCD_D4 at LATD4_bit;
sbit LCD_D5 at LATD5_bit;
sbit LCD_D6 at LATD6_bit;
sbit LCD_D7 at LATD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
char uart_rd[]=" ";
void initializeLCD(){
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out( 1, 1, "STARTING" );
Delay_ms(1000);
}
void main() {
ADCON1 |= 0x0F; // Configure AN pins as digital
CMCON |= 7; // Turn off comparators
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize
initializeLCD();
UART1_Write_Text("Start");
UART1_Write(10);
UART1_Write(13);
while (1) { // Endless loop
if (UART1_Data_Ready()) { // If data is received,
uart_rd[0] = UART1_Read(); // read the received data,
Lcd_Out( 1, 1, uart_rd );
Delay_ms(100);
}
}
}
123456789
On the LCD appears:
1 then 2 then 3
the rest of the 4,5,6,7,8,9 are lost. Any hint why?
MB: EasyPic4
PIC: 18LF4520
QZ: 8,000MHz
Serial cable to PC COM1 (no USB to Serial convertor)
PLS HELP!
Edited by administrator: Don't use Quote for Code!