Problemas con LCD y PIC18, usando Pic-C Compiler

Hola que tal a todos los usuarios del foro !

Pues como verán tengo un pequeño problema. Les cuento, mi problema es el siguiente:

Quise hacer un programita para probar unas LCD de 16x2, el programa compilo bien e incluso lo simulo en PROTEUS. Pues todo hasta aquí va bien, pero cuando lo pruebo en proto el micro no hace nada y pues me parece muy extraño. Supongo que tiene algo que ver con la librería LCD.c ya que cuando quito esta librería y sus funciones el micro funciona.

El programa es el siguiente, lo único que hace es mostrar un mensaje en la LCD y agregué un led que parpadea en la patita A0 unas cuantas veces antes de que entre al ciclo infinito, solo para asegurarme que el micro esta funcionando, como mencione anteriormente cuando tengo la librería LCD.c y sus funciones el micro no funciona pero cuando las quito el led parpadea.

Seguro mi problema es alguna tontería, pero no se mucho de esto así que espero que me ayuden. Gracias !

Código:
#include <18F458.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES XT                       //Crystal osc <= 4mhz
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOOSCSEN                 //Oscillator switching is disabled, main oscillator is source
#FUSES BROWNOUT                 //Reset when brownout detected
#FUSES BORV42                   //Brownout reset at 4.2V
#FUSES PUT                      //Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOCPB                    //No Boot Block code protection
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOEBTRB                  //Boot block not protected from table reads

#use delay(clock=4000000,RESTART_WDT)

//#define LCD_TYPE 2
//#include <LCD.c>
void main()
{
   //lcd_init();

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   setup_oscillator(False);

   // TODO: USER CODE!
   
   output_high(pin_a0);
   delay_ms(500);
   output_low(pin_a0);
   delay_ms(500);
   output_high(pin_a0);
   delay_ms(500);
   output_low(pin_a0);
   delay_ms(500);
   output_high(pin_a0);
   delay_ms(500);
   output_low(pin_a0);
   
   while (1)
   {
      //lcd_gotoxy(1,1);
      //lcd_putc("HOLA!");
   }
}
 
hola!

#define LCD_TYPE 2 es para especificar a la libreria de pic-c que se va a usar una LCD de 2 lineas

pero ya resolvi mi problema lo que paso es que las LCD no servian :rolleyes: jejeje,

bueno muchas gracias por responder !
 
Atrás
Arriba