Hola que tal;
Alguien me podría echar la mano con el ejemplo de Modificación de la librerías..... ya tengo rato batallando y no logro cambiarlo del puerto B al puerto D, estoy usando un pic18F4610.... y me queda de la siguiente manera
Codigo:
#include <p18f4610.h>
#include <delays.h>
#include <xlcd.h>
#pragma config OSC=HS,FCMEN=OFF,IESO=OFF
#pragma config PWRT=ON,BOREN=OFF,BORV=0,WDT=OFF,WDTPS=32768
#pragma config MCLRE=ON,LPT1OSC=OFF,PBADEN=OFF,CCP2MX=PORTBE
#pragma config STVREN=OFF,LVP=OFF,XINST=OFF,DEBUG=OFF
#pragma config CP0=OFF,CP1=OFF,CP2=OFF,CP3=OFF,CPB=OFF
#pragma config WRT0=OFF,WRT1=OFF,WRT2=OFF,WRT3=OFF,WRTB=OFF,WRTC=OFF
#pragma config EBTR0=OFF,EBTR1=OFF,EBTR2=OFF,EBTR3=OFF,EBTRB=OFF
void DelayFor18TCY(void);
void DelayPORXLCD(void);
void DelayXLCD(void);
void gotoxyXLCD(unsigned char x,unsigned char y);
void comandXLCD(unsigned char a);
void main(void)
{
ADCON1=15;
OpenXLCD(FOUR_BIT & LINE_5X10); //Iniciamos el LCD
comandXLCD(0x06);
comandXLCD(0x0C);
gotoxyXLCD(1,1);
putrsXLCD("Lcd");
gotoxyXLCD(1,2); //Pasamos a la linea 2
putrsXLCD("Palomino");
while(1)
{
}
}
void DelayFor18TCY(void)
{
Delay10TCYx(2);
}
void DelayPORXLCD(void)
{
Delay1KTCYx(15);
}
void DelayXLCD(void)
{
Delay1KTCYx(2);
}
void comandXLCD(unsigned char a)
{
BusyXLCD();
WriteCmdXLCD(a);
}
void gotoxyXLCD(unsigned char x,unsigned char y) //Ubica cursor en (x=Posicion en linea; y= Numero de Linea)
{
unsigned char direccion;
if (y != 1)
direccion=0x10;
else
direccion=0;
direccion += x-1;
WriteCmdXLCD(0x80 | direccion);
}
Librería:
#define UPPER
/* DATA_PORT defines the port to which the LCD data lines are connected */
#define DATA_PORT PORTD
#define TRIS_DATA_PORT TRISD
/* CTRL_PORT defines the port where the control lines are connected.
* These are just samples, change to match your application.
*/
#define RW_PIN LATDbits.LATD1 /* PORT for RW */
#define TRIS_RW TRISDbits.TRISD1 /* TRIS for RW */
#define RS_PIN LATDbits.LATD0 /* PORT for RS */
#define TRIS_RS TRISDbits.TRISD0 /* TRIS for RS */
#define E_PIN LATDbits.LATD2 /* PORT for D */
#define TRIS_E TRISDbits.TRISD2 /* TRIS for E */
Saludos