Autor Tema: lcd_init() --> No me funciona, desesperado  (Leído 12934 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado bmb

  • PIC18
  • ****
  • Mensajes: 423
Re: lcd_init() --> No me funciona, desesperado
« Respuesta #30 en: 11 de Diciembre de 2010, 08:57:44 »
Hola wichooox, intenta compilar el programa asi:

Código: C
  1. #include <18F2525.h>
  2. #device adc=10
  3.  
  4. #FUSES NOWDT                    //No Watch Dog Timer
  5. #FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
  6. #FUSES INTRC                    //Internal RC Osc
  7. #FUSES FCMEN                    //Fail-safe clock monitor enabled
  8. #FUSES NOIESO                   //Internal External Switch Over mode disabled
  9. #FUSES NOPUT                    //No Power Up Timer
  10. #FUSES NOBROWNOUT               //No brownout reset
  11. #FUSES BORV20                   //Brownout reset at 2.0V
  12. #FUSES NOPBADEN                 //PORTB pins are configured as digital I/O on RESET
  13. #FUSES NOLPT1OSC                //Timer1 configured for higher power operation
  14. #FUSES MCLR                     //Master Clear pin enabled
  15. #FUSES NOSTVREN                 //Stack full/underflow will not cause reset
  16. #FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
  17. #FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
  18. #FUSES NODEBUG                  //No Debug mode for ICD
  19. #FUSES NOPROTECT                //Code not protected from reading
  20. #FUSES NOCPB                    //No Boot Block code protection
  21. #FUSES NOCPD                    //No EE protection
  22. #FUSES NOWRT                    //Program memory not write protected
  23. #FUSES NOWRTC                   //configuration not registers write protected
  24. #FUSES NOWRTB                   //Boot block not write protected
  25. #FUSES NOWRTD                   //Data EEPROM not write protected
  26. #FUSES NOEBTR                   //Memory not protected from table reads
  27. #FUSES NOEBTRB                  //Boot block not protected from table reads
  28.  
  29. #use delay(int=4000000)
  30.  
  31. #define ENABLE_PIN B0
  32. #define RS_PIN B1
  33. #define RW_PIN B2
  34. #define Data4 B4
  35. #define Data5 B5
  36. #define Data6 B6
  37. #define Data7 B7
  38. #define LCD_TYPE 2
  39.  
  40. #include <lcd.c>
  41.  
  42. int seguir;
  43.  
  44. void main()
  45. {
  46.    setup_adc_ports(AN0_TO_AN1|VSS_VDD);
  47.    setup_adc(ADC_CLOCK_INTERNAL|ADC_TAD_MUL_2);
  48.    setup_spi(SPI_SS_DISABLED);
  49.    setup_wdt(WDT_OFF);
  50.    setup_timer_0(RTCC_INTERNAL);
  51.    setup_timer_1(T1_DISABLED);
  52.    setup_timer_2(T2_DISABLED,0,1);
  53.    setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
  54.    setup_comparator(NC_NC_NC_NC);
  55.    setup_vref(FALSE);
  56.    setup_oscillator(OSC_4MHZ|OSC_INTRC|OSC_PLL_OFF);
  57.    set_tris_a(0x03);
  58.    lcd_init();
  59.  
  60.    seguir=0;
  61.    
  62.    do
  63.    {
  64.       output_low(pin_a2);
  65.       delay_ms(300);
  66.       output_high(pin_a2);
  67.       delay_ms(300);
  68.    }
  69.    while (seguir==0);
  70. }

Saludos!

Desconectado wichooox

  • PIC10
  • *
  • Mensajes: 3
Re: lcd_init() --> No me funciona, desesperado
« Respuesta #31 en: 11 de Diciembre de 2010, 14:36:26 »
Hola wichooox, intenta compilar el programa asi:

Código: C
  1. #include <18F2525.h>
  2. #device adc=10
  3.  
  4. #FUSES NOWDT                    //No Watch Dog Timer
  5. #FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
  6. #FUSES INTRC                    //Internal RC Osc
  7. #FUSES FCMEN                    //Fail-safe clock monitor enabled
  8. #FUSES NOIESO                   //Internal External Switch Over mode disabled
  9. #FUSES NOPUT                    //No Power Up Timer
  10. #FUSES NOBROWNOUT               //No brownout reset
  11. #FUSES BORV20                   //Brownout reset at 2.0V
  12. #FUSES NOPBADEN                 //PORTB pins are configured as digital I/O on RESET
  13. #FUSES NOLPT1OSC                //Timer1 configured for higher power operation
  14. #FUSES MCLR                     //Master Clear pin enabled
  15. #FUSES NOSTVREN                 //Stack full/underflow will not cause reset
  16. #FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
  17. #FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
  18. #FUSES NODEBUG                  //No Debug mode for ICD
  19. #FUSES NOPROTECT                //Code not protected from reading
  20. #FUSES NOCPB                    //No Boot Block code protection
  21. #FUSES NOCPD                    //No EE protection
  22. #FUSES NOWRT                    //Program memory not write protected
  23. #FUSES NOWRTC                   //configuration not registers write protected
  24. #FUSES NOWRTB                   //Boot block not write protected
  25. #FUSES NOWRTD                   //Data EEPROM not write protected
  26. #FUSES NOEBTR                   //Memory not protected from table reads
  27. #FUSES NOEBTRB                  //Boot block not protected from table reads
  28.  
  29. #use delay(int=4000000)
  30.  
  31. #define ENABLE_PIN B0
  32. #define RS_PIN B1
  33. #define RW_PIN B2
  34. #define Data4 B4
  35. #define Data5 B5
  36. #define Data6 B6
  37. #define Data7 B7
  38. #define LCD_TYPE 2
  39.  
  40. #include <lcd.c>
  41.  
  42. int seguir;
  43.  
  44. void main()
  45. {
  46.    setup_adc_ports(AN0_TO_AN1|VSS_VDD);
  47.    setup_adc(ADC_CLOCK_INTERNAL|ADC_TAD_MUL_2);
  48.    setup_spi(SPI_SS_DISABLED);
  49.    setup_wdt(WDT_OFF);
  50.    setup_timer_0(RTCC_INTERNAL);
  51.    setup_timer_1(T1_DISABLED);
  52.    setup_timer_2(T2_DISABLED,0,1);
  53.    setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
  54.    setup_comparator(NC_NC_NC_NC);
  55.    setup_vref(FALSE);
  56.    setup_oscillator(OSC_4MHZ|OSC_INTRC|OSC_PLL_OFF);
  57.    set_tris_a(0x03);
  58.    lcd_init();
  59.  
  60.    seguir=0;
  61.    
  62.    do
  63.    {
  64.       output_low(pin_a2);
  65.       delay_ms(300);
  66.       output_high(pin_a2);
  67.       delay_ms(300);
  68.    }
  69.    while (seguir==0);
  70. }

Saludos!




RESUELTO
elimine
#define ENABLE_PIN B0
#define RS_PIN B1
#define RW_PIN B2
#define Data4 B4
#define Data5 B5
#define Data6 B6
#define Data7 B7
#define LCD_TYPE 2

deje la configuracion de la libreria como la pase y funciono :P gracias..¡