it doesnt works i duuno why plss help
(crystal 20mhz - pic18f4550 - LCD backlight)
#include <p18f4550.h>
#include <delays.h>
#include <xlcd.h>
#pragma config FOSC = HS,FCMEN = OFF,IESO = OFF
#pragma config PWRT = ON,BOR = OFF,BORV = 0
#pragma config WDT = OFF
#pragma config MCLRE = OFF,LPT1OSC = OFF,PBADEN = OFF,CCP2MX = OFF
#pragma config STVREN = OFF,LVP = OFF,XINST = OFF,DEBUG = OFF
#pragma config CP0 = OFF,CP1 = OFF,CP2 = OFF
#pragma config CPB = OFF,CPD = OFF
#pragma config WRT0 = OFF,WRT1 = OFF,WRT2 = OFF
#pragma config WRTB = OFF,WRTC = OFF,WRTD = OFF
#pragma config EBTR0 = OFF,EBTR1 = OFF,EBTR2 = OFF
#pragma config EBTRB = OFF
void DelayFor18TCY(void){
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
}
void DelayPORXLCD(void){
Delay1KTCYx(75);
}
void DelayXLCD(void){
Delay1KTCYx(25);
}
void main(void){
TRISD=0x00;
TRISB=0x00;
OpenXLCD(FOUR_BIT & LINES_5X7 );
BusyXLCD();
while(1){
putrsXLCD("hello");
}
}
========================================= xlcd.h
#define DATA_PORT PORTB
#define TRIS_DATA_PORT TRISB
/* CTRL_PORT defines the port where the control lines are connected.
* These are just samples, change to match your application.
*/
#define RW_PIN LATDbits.LATD6 /* PORT for RW */
#define TRIS_RW TRISDbits.TRISD6 /* TRIS for RW */
#define RS_PIN LATDbits.LATD5 /* PORT for RS */
#define TRIS_RS TRISDbits.TRISD5 /* TRIS for RS */
#define E_PIN LATDbits.LATD7 /* PORT for D */
#define TRIS_E TRISDbits.TRISD7 /* TRIS for E */