Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

pic 18f4550 - LCD - c18

Status
Not open for further replies.

dioscarey

Newbie level 2
Joined
Oct 5, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
mexico
Activity points
1,303
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 */
 

Please post the working code for LCD with Pic18f452 for C18
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top