speedEC
Full Member level 6
I like to Interface JHD LCD (2x16) with PIC16F628A. I connected the pic ports to LCD and I build the project. But LCD Blinks and not showing any characters on LCD. I have modified the lcd.c according to PIC16F628A like this:
Pin Connections:
(LCD to PIC MCU):
main() file:
IDE & Compiler: MPLAB IDE v8.63
: Hi-Tech C
Any help?
Thanks
Pin Connections:
(LCD to PIC MCU):
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 1. GND to GND 2. Vcc to +5V 3. Vee to 10K pot to +5v (Contrast) 4. RS to RA2 5. R/W to RA3 6. E to RA4 7. D0 to GND 8. D1 to GND 9. D2 to GND 10. D3 to GND 11. D4 to RB4 12. D5 to RB5 13. D6 to RB6 14. D7 to RB7 15. LED+ to +5v 16. LED- to GND lcd.c (modified): . . . #define LCD_RS RA2 #define LCD_RW RA3 #define LCD_EN RA4 #define LCD_DATA PORTB . . . lcd_init() { char init_value; //ADCON1 = 0x06; // Disable analog pins on PORTA TRISA=0; TRISB=0; CMCON = 0b00000111; // disable comparators init_value = 0x3; . . . }
main() file:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 void main(void){ TRISB = 0x00; TRISA = 0x00; CMCON = 0b00000111; // disable comparators PORTB = 0x00; // all low PORTA = 0x00; lcd_init(); lcd_clear(); lcd_goto(0); // select first line lcd_puts("12345678"); lcd_goto(0x40); // Select second line lcd_puts("Hello world"); for(;;); }
IDE & Compiler: MPLAB IDE v8.63
: Hi-Tech C
Any help?
Thanks
Last edited: