electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

pic 18f4550 - LCD - c18


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> pic 18f4550 - LCD - c18
Author Message
dioscarey



Joined: 05 Oct 2009
Posts: 2
Location: mexico


Post05 Oct 2009 23:44   

pic 18f4550 - LCD - c18


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 */
Back to top
Google
AdSense
Google Adsense




Post05 Oct 2009 23:44   

Ads




Back to top
willi65



Joined: 18 Sep 2009
Posts: 36
Location: Asia - Europe - Germany


Post06 Oct 2009 11:46   

Re: pic 18f4550 - LCD - c18


Hi

u must attaced .. Stdio.h .

were the settings for the datalines D4-D7?
send ur project files with the C code to williossmann(at)web.de i can check it
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> pic 18f4550 - LCD - c18
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
PIC C18 Library Needed for 128x64 KS0108 Graphic LCD (1)
pic 18F4550 I/P (3)
pic 18f4550, designing tool? (4)
PIC 18F4550 + MMC + FAT32 (1)
LCD menu library needed for C18! (6)
USB driver for PIC 18F4550 (1)
USB - First try - PIC 18F4550 (4)
PIC 18F4550 with external memory Interfacing (1)
Microchip USB Pic 18F4550 source code? (10)
ICD2 Clone with PIC 18F4550 potyo2 (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS