rajib.das
Member level 3
Hi guys
I am trying to connect a 16x2 3.3V LCD with PIC32MX250F128D. Spent lot of time with no positive result. Please help me.
The following code will explain my connections.
FYI I am using Pin21 as PGED1 and Pin22 as PGEC1 for Programming and its working. Oscillator Frequency [MHz] is 10.000000.
Please advise if you can. Thanks in advance.
I am trying to connect a 16x2 3.3V LCD with PIC32MX250F128D. Spent lot of time with no positive result. Please help me.
The following code will explain my connections.
Code:
// LCD module connections
sbit LCD_RS at LATA10_bit;
sbit LCD_EN at LATA7_bit;
//
sbit LCD_D4 at LATC6_bit;
sbit LCD_D5 at LATC7_bit;
sbit LCD_D6 at LATC8_bit;
sbit LCD_D7 at LATC9_bit;
//
sbit LCD_BackPW at LATA8_bit;
//
sbit LCD_RS_Direction at TRISA10_bit;
sbit LCD_EN_Direction at TRISA7_bit;
//
sbit LCD_D4_Direction at TRISC6_bit;
sbit LCD_D5_Direction at TRISC7_bit;
sbit LCD_D6_Direction at TRISC8_bit;
sbit LCD_D7_Direction at TRISC9_bit;
sbit LCD_BackPW_Direction at TRISA8_bit;
// End LCD module connections
char txt1[] = "mikroElektronika";
char txt2[] = "Its a Test";
LCD_BackPW = 0; //Clear PORTD by setting to 0
LCD_BackPW_Direction = 0; // designate PORTB2 pins as output
Lcd_Init(); // Initialize LCD
LCD_BackPW = 1;
void main(){
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,txt1); // Write text in first row
Lcd_Out(2,1,txt2); // Write text in second row
Delay_ms(2000);
while(1) {
}
}
FYI I am using Pin21 as PGED1 and Pin22 as PGEC1 for Programming and its working. Oscillator Frequency [MHz] is 10.000000.
Please advise if you can. Thanks in advance.
Last edited: