#include <main.h>
#use delay(clock=20000000)
#fuses HS,NOWDT,NOPROTECT,NOPUT, NOBROWNOUT,NOLVP
#define LCD_ENABLE_PIN PIN_A2
#define LCD_RS_PIN PIN_A0
#define LCD_RW_PIN PIN_A1
#define LCD_DATA4 PIN_c4
#define LCD_DATA5 PIN_C5
#define LCD_DATA6 PIN_C6
#define LCD_DATA7 PIN_C7
#include <lcd.c>
#define LCD_SELECT PIN_B7 //name the selector pin 'SELECT'
void LCD_Select1(void)
{
// output logic LOW to LCD_SELECT
//LCD_SELECT = 0;
output_low(pin_B7);
}
void LCD_Select2(void)
{
// output logic HIGH to LCD_SELECT
//LCD_SELECT = 1;
output_high(pin_B7);
}
void init_Displays(void)
{
LCD_Select1();
lcd_init();
lcd_putc("1 Initialized");
LCD_Select2();
lcd_init();
lcd_putc("2 Initialized");
}
void Display(void)
{
LCD_Select1();
lcd_init();
lcd_putc("Message 1");
LCD_Select2();
lcd_init();
lcd_putc("Message 2");
}
void main()
{
init_displays();
delay_ms(3000);
while(TRUE)
{
display();
}
}
thnx broAnd nothing succeeds like success. Well done!
What's the push button for on the ENABLE line?
EDIT: Since you are early in the development, consider trying some of the other methods described in the thread. Anytime you can eliminate some hardware c.f. RB's two resistors, its a good thing. You always have the working one to come back to.
by Aaron Carman
by Jeff Child
by Jake Hertz
by Aaron Carman