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.

PIC18f4550 with LCD 20x4 liner

Status
Not open for further replies.

robocop

Newbie level 2
Newbie level 2
Joined
Dec 20, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295


This is the implementation of the circuit in proteus.

lcd.png


Hi everyone, we are interfacing a microcontroller with the LCD 4 liner and we have this problem..if we try to program a simple "Hello World" to be outputed in the LCd the LCD only display two black squares in 1 and 3 row lines.. and we have this code:


Code:
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_RD_Direction at TRISB5_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
char txt10[] = "HELLO WORLD";
 
 
void main(){
  
  TRISB = 0x00;
 ADCON1 = 0x7F;
  CMCON = 0x07;
  ADRESH = 0;                        // Configure AN pins as digital I/O
  ADRESL = 0;
  delay_ms(200);
  Lcd_Init();                        // Initialize LCD
  delay_ms(200);
  Lcd_Out_Cp(txt10);
 
 
}
Hoping for your help guys..really need this for our project..thank you so much in advance...=)

---------- Post added at 13:51 ---------- Previous post was at 13:50 ----------

39_1324360264.jpg


Please use code tags when posting code.
 

Attachments

  • lcd.png
    lcd.png
    29 KB · Views: 138
  • lcd.png
    lcd.png
    33.5 KB · Views: 132
Last edited by a moderator:

I'm not with my laptop but I think there is a function I'd rather use. Try Lcd_out(1,1,txt10), it should rectify your problem and besides the function allows for manipulation of output. Check the mikroC help for more. If it yet doesn't work let me know by next week I will send you a full code.
 

Seems that LCD doesn't initialize properly.

In Project editor (Project -> Edit project), make sure to set right MCU frequency (not the OSC freq), and disable PORTB A/D
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top