Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18f452 with UART & LCD ,,,, need help urgently

Status
Not open for further replies.

msmomar

Newbie level 3
Joined
Sep 5, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
I have several proplem in both UART & LCd
first i connected the TX with the RX of the 18f452 .
the proplems are ,
1 -in UARt , if i send more than 3 characters more the statment (( Uart1_read_text(output, "at+fclass=8 ",255) ; ))
the compiler will not fint it & remain serching for the charcters .


2- in LCD ,
i can't print out the characters in the recived registers on the LCd . as



UART1_Write_text("at");
delay_ms(100);
UART1_Read_text(output,"AT",255);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_out(1,1,output);
delay_ms(1000);

nothing will be on the lcd



the all code is



// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections
unsigned char* uart_rd;
unsigned long* msg1 = "AT+FCLASS=8" ;
unsigned long* msg0 ="a";
unsigned long* output ;
char i =0;

void main(){
TRISB = 0;
TRISD= 0;
PORTB = 0xFF;
TRISB = 0xff;
Lcd_Init(); // Initialize LCD
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize

UART1_Write_text(msg1);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,1,msg1);
delay_ms(300);

while(1){
if(UART1_data_ready() == 1)
{
UART1_Read_text(output,"AT+FCLASS=8",255);
Lcd_Cmd(_LCD_CLEAR);
delay_ms(1000);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_out(1,1,output);
delay_ms(1000);
}
}
}

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top