Toll-Free Customer Support 24/7

sbit LCD_RS at RB0_bit; //defining PortB Pin B0 as LCD_RS

sbit LCD_EN at RB1_bit; //defining PortB Pin B1 as LCD_EN

sbit LCD_D4 at RB4_bit; //defining PortB Pin B4 as LCD_D4

sbit LCD_D5 at RB5_bit; //defining PortB Pin B5 as LCD_D5

sbit LCD_D6 at RB6_bit; //defining PortB Pin B6 as LCD_D6

sbit LCD_D7 at RB7_bit; //defining PortB Pin B7 as LCD_D7

sbit LCD_RS_Direction at TRISB0_bit;

sbit LCD_EN_Direction at TRISB1_bit;

sbit LCD_D4_Direction at TRISB4_bit;

sbit LCD_D5_Direction at TRISB5_bit;

sbit LCD_D6_Direction at TRISB6_bit;

sbit LCD_D7_Direction at TRISB7_bit;

// End LCD module connections

char uart_rd;

void main() {

TRISB6_bit=0;

UART1_Init(9600); // Initialize UART module at 9600 bps

Delay_ms(10);

// Wait for UART module to stabilize

Lcd_Init();

UART1_Write_Text("Start");

UART1_Write(10);

UART1_Write(13);

Delay_ms(10);

Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off

Lcd_Out(1,2,"WELCOME TO RDL");

Lcd_Out(2,2,"LEARNING IS FUN");

while (1) ;

}

// Endless loop

Back to top