Autor Tema: LCD en proteus funciona en protoboard no  (Leído 2262 veces)

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

Desconectado LucasBols

  • PIC16
  • ***
  • Mensajes: 129
    • Desarrollos y Servicios Digitales
LCD en proteus funciona en protoboard no
« en: 10 de Abril de 2014, 20:26:17 »
hola, buenas tardes,

en proteus tengo el circuito de la imagen que funciona perfecto pero en el protoboard no, el display es un JHD162A,

el código en XC8 es este:

Código: C#
  1. /*
  2.  * File:   CD4094.h
  3.  */
  4.  
  5. #ifndef CD4094_LCD_H
  6. #define CD4094_LCD_H
  7.  
  8. #include "main.h"
  9. #include <stdbool.h>
  10.  
  11. //******************************************************************************
  12.  
  13. #define CD4094_DATA      PORTDbits.RD0
  14. #define CD4094_CLOCK     PORTDbits.RD1
  15. #define CD4094_STROBE    PORTDbits.RD2
  16.  
  17. //******************************************************************************
  18.  
  19. /* posiciones del display */
  20.  
  21. #define _LCD_L1_C_01_     0b10000000
  22. #define _LCD_L1_C_02_     0b10000001
  23. #define _LCD_L1_C_03_     0b10000010
  24. #define _LCD_L1_C_04_     0b10000011
  25. #define _LCD_L1_C_05_     0b10000100
  26. #define _LCD_L1_C_06_     0b10000101
  27. #define _LCD_L1_C_07_     0b10000110
  28. #define _LCD_L1_C_08_     0b10000111
  29. #define _LCD_L1_C_09_     0b10001000
  30. #define _LCD_L1_C_10_     0b10001001
  31. #define _LCD_L1_C_11_     0b10001010
  32. #define _LCD_L1_C_12_     0b10001011
  33. #define _LCD_L1_C_13_     0b10001100
  34. #define _LCD_L1_C_14_     0b10001101
  35. #define _LCD_L1_C_15_     0b10001110
  36. #define _LCD_L1_C_16_     0b10001111
  37.  
  38. #define _LCD_L2_C_01_     0b11000000
  39. #define _LCD_L2_C_02_     0b11000001
  40. #define _LCD_L2_C_03_     0b11000010
  41. #define _LCD_L2_C_04_     0b11000011
  42. #define _LCD_L2_C_05_     0b11000100
  43. #define _LCD_L2_C_06_     0b11000101
  44. #define _LCD_L2_C_07_     0b11000110
  45. #define _LCD_L2_C_08_     0b11000111
  46. #define _LCD_L2_C_09_     0b11001000
  47. #define _LCD_L2_C_10_     0b11001001
  48. #define _LCD_L2_C_11_     0b11001010
  49. #define _LCD_L2_C_12_     0b11001011
  50. #define _LCD_L2_C_13_     0b11001100
  51. #define _LCD_L2_C_14_     0b11001101
  52. #define _LCD_L2_C_15_     0b11001110
  53. #define _LCD_L2_C_16_     0b11001111
  54.  
  55. #ifndef TYPEDEF_UNION_T_CD4094
  56. #define TYPEDEF_UNION_T_CD4094
  57.     typedef union
  58.     {
  59.         unsigned char latch4094;
  60.  
  61.         struct
  62.         {
  63.             unsigned
  64.                     SIN_USO:1,  // desconectado
  65.                     RS:1,       // 1 = datos / 0 = comandos
  66.                     RW:1,       // 1 = leer / 0 = escribir
  67.                     E:1,        // 1 = habilitar / 0 = deshabilitar
  68.                     D4:1, D5:1, D6:1, D7:1;
  69.         };
  70.     } t_cd4094;
  71. #endif /* TYPEDEF_UNION_T_CD4094 */
  72.  
  73. #endif CD4094_LCD_H

Código: C#
  1. #include "CD4094_LCD.h"
  2.  
  3. //******************************************************************************
  4.  
  5. void CD4094_LCD_enviar_byte( t_cd4094 dato )
  6. {
  7.     dato.SIN_USO = 0;
  8.  
  9.     CD4094_DATA     = 0;
  10.     CD4094_STROBE   = 0; // todavia no enviar, solamente almacenar
  11.     CD4094_CLOCK    = 0;
  12.  
  13.     CD4094_DATA = dato.D7;
  14.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  15.     CD4094_DATA = dato.D6;
  16.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  17.     CD4094_DATA = dato.D5;
  18.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  19.     CD4094_DATA = dato.D4;
  20.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  21.     CD4094_DATA = dato.E;        // 1 = habilitar / 0 = deshabilitar
  22.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  23.     CD4094_DATA = dato.RW;       // 1 = leer / 0 = escribir
  24.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  25.     CD4094_DATA = dato.RS;       // 1 = datos / 0 = comandos
  26.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  27.     CD4094_DATA = dato.SIN_USO;  // desconectado
  28.         CD4094_CLOCK    = 1; __delay_ms( 1 ); CD4094_CLOCK    = 0;
  29.  
  30.     CD4094_STROBE   = 1; // enviar todo lo almacenado
  31.     __delay_ms( 1 );
  32.     CD4094_STROBE   = 0;
  33.     __delay_ms( 1 );
  34. }
  35.  
  36. //******************************************************************************
  37.  
  38. void CD4094_LCD_enviar_nibble( t_cd4094 env, t_byte cadena, bool nibble_alto )
  39. {
  40.     if ( nibble_alto )
  41.     {
  42.         // transmite el nibble alto al lcd
  43.         env.D4  = cadena.b4;
  44.         env.D5  = cadena.b5;
  45.         env.D6  = cadena.b6;
  46.         env.D7  = cadena.b7;
  47.     }
  48.     else
  49.     {
  50.         // transmite el nibble bajo al lcd
  51.         env.D4  = cadena.b0;
  52.         env.D5  = cadena.b1;
  53.         env.D6  = cadena.b2;
  54.         env.D7  = cadena.b3;
  55.     }
  56.  
  57.     env.E   = 1; // habilita la comunicacion para que procese el nibble
  58.  
  59.     CD4094_LCD_enviar_byte( env );
  60.     __delay_ms( 50 ); // delay para garantizar el pasaje de datos al lcd
  61.  
  62.     env.E   = 0; // deshabilita la comunicacion
  63.  
  64.     CD4094_LCD_enviar_byte( env );
  65.     __delay_ms( 5 ); // retardo para que el lcd efectue la tarea
  66. }
  67.  
  68. //******************************************************************************
  69.  
  70. void CD4094_LCD_enviar( t_byte cadena, bool datos )
  71. {
  72.     t_cd4094 env;
  73.    
  74.     env.latch4094 = 0;
  75.    
  76.     env.SIN_USO   = 0;
  77.     env.RW        = 0; // 1 = leer / 0 = escribir
  78.     env.RS        = datos; // 1 = datos / 0 = comandos
  79.    
  80.     // transmite el nibble alto al lcd
  81.     CD4094_LCD_enviar_nibble( env, cadena, true );
  82.  
  83.     // transmite el nibble bajo al lcd
  84.     CD4094_LCD_enviar_nibble( env, cadena, false );
  85. }
  86.  
  87. //******************************************************************************
  88.  
  89. void CD4094_LCD_inicializar( void )
  90. {
  91.     t_cd4094 ini;
  92.     t_byte   comando;
  93.    
  94.     ini.latch4094 = 0;
  95.    
  96.     // para darle tiempo a que el voltaje se estabilice
  97.     __delay_ms( 20 ); // y se inicialice el 4094
  98.  
  99.     for ( char i=0; i<3; i++ )
  100.     {
  101.         ini.D5 = 1;
  102.         ini.D4 = 1;
  103.         __delay_ms( 10 );
  104.     }
  105.  
  106.     ini.latch4094 = 0;
  107.  
  108.     ini.E   = 0; // deshabilita la comunicacion
  109.     ini.RS  = 0; // aviso de envio de comando
  110.    
  111.     ini.D5  = 1; // config del LCD - DL = 0 bus de 4 bits
  112.    
  113.     ini.E   = 1; // habilita la comunicacion
  114.    
  115.     CD4094_LCD_enviar_byte( ini );
  116.  
  117.     __delay_ms( 50 ); // requerido por el display
  118.    
  119.     ini.E   = 0; // deshabilita la comunicacion
  120.    
  121.     CD4094_LCD_enviar_byte( ini );
  122.  
  123.     __delay_ms( 50 ); // requerido por el display
  124.  
  125.     comando.byte = 0b00101100; // caracteres 5x10
  126.     CD4094_LCD_enviar( comando, false );
  127.  
  128.     comando.byte = 0b00000110; // Establece Modo de Entrada
  129.     CD4094_LCD_enviar( comando, false );
  130.  
  131.     comando.byte = 0b00001100; // pantalla encendida / cursor oculto
  132.     CD4094_LCD_enviar( comando, false );
  133. }
  134.  
  135. //******************************************************************************

Código: C#
  1. /*
  2.  * File:   variables.h
  3.  */
  4.  
  5. #ifndef VARIABLES_H
  6. #define VARIABLES_H
  7.  
  8. //------------------------------------------------------------------------------
  9.  
  10. #ifndef TYPEDEF_UNION_T_BYTE
  11. #define TYPEDEF_UNION_T_BYTE
  12.     typedef union
  13.     {
  14.         unsigned char byte;
  15.  
  16.         struct
  17.         {   //         MSB                                       LSB
  18.             //unsigned b7:1, b6:1, b5:1, b4:1, b3:1, b2:1, b1:1, b0:1;
  19.             unsigned b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1;
  20.         };
  21.     } t_byte;
  22. #endif /* TYPEDEF_UNION_T_BYTE */
  23.  
  24. //------------------------------------------------------------------------------
  25.  
  26. #endif  /* VARIABLES_H */

Código: C#
  1. /*
  2.  * File:   definiciones.h
  3.  */
  4.  
  5. #ifndef MAIN_H
  6. #define MAIN_H
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <xc.h>
  11. #include <pic16f88.h>
  12. #include <pic16f877a.h>
  13. #include <stdbool.h>
  14. #include "variables.h"
  15. #include "CD4094_LCD.h"
  16.  
  17. //#########################
  18. // D E F I N I C I O N E S
  19. //#########################
  20.  
  21. #define _XTAL_FREQ 4000000 // Velocidad clock en Hz
  22.  
  23. #pragma config FOSC  = XT       // Oscillator Selection bits
  24.                                 // (XT oscillator)
  25.  
  26. #pragma config WDTE  = OFF      // Watchdog Timer Enable bit
  27.                                 // (WDT disabled)
  28.  
  29. #pragma config PWRTE = OFF      // Power-up Timer Enable bit
  30.                                 // (PWRT disabled)
  31.  
  32. #pragma config BOREN = ON       // Brown-out Reset Enable bit
  33.                                 // (BOR enabled)
  34.  
  35. #pragma config LVP   = OFF      // Low-Voltage (Single-Supply)
  36.                                 // In-Circuit Serial Programming
  37.                                 // Enable bit
  38.                                 // (RB3 is digital I/O, HV on MCLR
  39.                                 // must be usedfor programming)
  40.  
  41. #pragma config CPD   = OFF      // Data EEPROM Memory Code
  42.                                 // Protection bit
  43.                                 // (Data EEPROM code protection off)
  44.  
  45. #pragma config WRT   = OFF      // Flash Program Memory Write
  46.                                 // Enable bits
  47.                                 // (Write protection off;
  48.                                 // all program memory may be written
  49.                                 // to by EECON control)
  50.  
  51. #pragma config CP    = OFF      // Flash Program Memory
  52.                                 // Code Protection bit
  53.                                 // (Code protection off)
  54.  
  55. /**** Timer1 - para 10 seg ***********************/
  56. /**** Reloj a 4 MHz ****/
  57. #define VALOR_TMR1H                     0b01011101 // 23869
  58. #define VALOR_TMR1L                     0b00111101 // 500 ms
  59. #define NRO_INT_TIMER1_X_SEG            2 // 500 ms * 2 = 1 seg
  60.  
  61.  
  62. /**** LCD ****************************************/
  63. // 0 = comandos / 1 = datos
  64. #define LCD_RS              PORTCbits.RC0
  65. #define LCD_E               PORTCbits.RC1 // 0 = deshabilitar / 1 = habilitar
  66.  
  67. #define LCD_D4              PORTCbits.RC2
  68. #define LCD_D5              PORTCbits.RC3
  69. #define LCD_D6              PORTCbits.RC4
  70. #define LCD_D7              PORTCbits.RC5
  71.  
  72. //#################### MACROS ####################
  73. /*** test to see if bit number, bit, in the integer, var, is set */
  74. #define testbit(var, bit)     ((var) & ((char)1 <<(bit)))
  75. #define bitset(var, bitno)    ((var) |= 1UL << (bitno))
  76. #define bitclr(var, bitno)    ((var) &= ~(1UL << (bitno)))
  77.  
  78. #define __delay_us(x) _delay((unsigned long)((x)*(_XTAL_FREQ/4000000.0)))
  79. #define __delay_ms(x) _delay((unsigned long)((x)*(_XTAL_FREQ/4000.0)))
  80.  
  81.  
  82.  
  83. #endif  /* MAIN_H */

Código: C#
  1. /*
  2.  * File:   main.c
  3.  */
  4.  
  5. //******************************************************************************
  6.  
  7. #include "main.h"
  8.  
  9. /******************************************************************************
  10.  ******************************************************************************
  11.  ******************************************************************************/
  12.  
  13. void enviaByteLCD( t_byte dato )
  14. {
  15.     // transmite el nibble alto al lcd
  16.     LCD_D7  = dato.b7;
  17.     LCD_D6  = dato.b6;
  18.     LCD_D5  = dato.b5;
  19.     LCD_D4  = dato.b4;
  20.  
  21.     LCD_E   = 1; // habilita la comunicacion para que procese el nibble
  22.  
  23. //    __delay_us( 50 ); // delay para garantizar el pasaje de datos al lcd
  24.     __delay_ms( 50 );
  25.  
  26.     LCD_E   = 0; // deshabilita la comunicacion
  27.  
  28.     // transmite el nibble bajo al lcd
  29.     LCD_D7  = dato.b3;
  30.     LCD_D6  = dato.b2;
  31.     LCD_D5  = dato.b1;
  32.     LCD_D4  = dato.b0;
  33.  
  34.     LCD_E   = 1; // habilita la comunicacion para que procese el nibble
  35.  
  36. //    __delay_us( 50 ); // delay para garantizar el pasaje de datos al lcd
  37.     __delay_ms( 50 );
  38.  
  39.     LCD_E   = 0; // deshabilita la comunicacion
  40.  
  41.     __delay_ms( 50 ); // retardo para que el lcd efectue la tarea
  42. }
  43.  
  44. /******************************************************************************/
  45.  
  46. void enviaComandoLCD( t_byte comando )
  47. {
  48.     LCD_RS = 0; // aviso de envio de comando
  49.     enviaByteLCD( comando );
  50. }
  51.  
  52. /******************************************************************************/
  53.  
  54. void enviaDatoLCD( t_byte dato )
  55. {
  56.     LCD_RS = 1; // aviso de envio de datos
  57.     enviaByteLCD( dato );
  58. }
  59.  
  60. /******************************************************************************
  61.  ******************************************************************************
  62.  ******************************************************************************/
  63.  
  64. void activar_interrupciones_PORTB_TIMER(void)
  65. {
  66.     /* ¿Por qué activo las banderas de interrupciones? */
  67.     INTCONbits.RBIF = 1;
  68.     INTCONbits.INTF = 1;
  69.  
  70.     /**** INTERRUPCIONES ****/
  71.  
  72.     INTCONbits.PEIE  = 1; // Enables all unmasked peripheral interrupts
  73.     INTCONbits.RBIE  = 1; // Enables the RB port change interrupt
  74.  
  75.     // PORTB pull-ups are enabled by individual port latch values
  76.     OPTION_REGbits.nRBPU  = 1;
  77.     // Interrupt on rising (creciente) edge of RB0/INT pin
  78.     OPTION_REGbits.INTEDG = 1;
  79.  
  80.     INTCONbits.RBIF = 0;
  81.     INTCONbits.INTF = 0;
  82.  
  83.     INTCONbits.GIE   = 1; // Enables all unmasked interrupts
  84.  
  85.     //T1CONbits.TMR1ON  = 1; // Timer1 On bit
  86. }
  87.  
  88. /******************************************************************************/
  89.  
  90. void configurar_pic(void)
  91. {
  92.     /*****************************
  93.      ******** T I M E R 1 ********
  94.      *****************************/
  95.     // cronometro para el tiempo de las duchas
  96.     T1CONbits.TMR1CS  = 0; // Timer1 Clock Source - 0 Internal clock (FOSC/4)
  97.  
  98.     T1CONbits.T1CKPS1 = 1; // prescaler
  99.     T1CONbits.T1CKPS0 = 1; // 1:8
  100.  
  101.     TMR1H = VALOR_TMR1H; // 3036
  102.     TMR1L = VALOR_TMR1L; // 500 ms
  103.  
  104.     T1CONbits.TMR1ON  = 0; // Timer1 On bit
  105.  
  106.     PIE1bits.TMR1IE   = 1; // TMR1 Overflow Interrupt Enable bit
  107.  
  108.     /*********************
  109.      *** P U E R T O S ***
  110.      *********************/
  111.     /**** PORTD I/O ****/
  112.     TRISEbits.PSPMODE = 0; // PORTD functions in general purpose I/O mode
  113.  
  114.     /**** PORTE I/O ****/
  115.     TRISEbits.TRISE2  = 0; // Output
  116.     TRISEbits.TRISE1  = 0; // Output
  117.     TRISEbits.TRISE0  = 0; // Output
  118.  
  119.     /**** PORTA / PORTE I/O ****/
  120.     ADCON1 = 0b00000111; // RA5:RA0 y RE2:RE0 Digital
  121.  
  122.     TRISA = 0b00000000; // Salida
  123.     TRISC = 0b00000000; // Salida
  124.     TRISD = 0b00000000; // Salida
  125.     TRISE = 0b00000000; // Salida
  126.  
  127.     PORTA = 0b00000000;
  128.     PORTB = 0b00000000;
  129.     PORTC = 0b00000000;
  130.     PORTD = 0b00000000;
  131.     PORTE = 0b00000000;
  132.  
  133. }
  134.  
  135. /******************************************************************************/
  136.  
  137. // inicializacion del lcd con bus de 4 bits
  138. void inicializa_lcd(void)
  139. {
  140.     t_byte dato;
  141.     __delay_ms( 20 );
  142.  
  143.     LCD_E   = 0; // deshabilita la comunicacion
  144.     LCD_RS  = 0; // aviso de envio de comando
  145.  
  146.     LCD_D7  = 0;
  147.     LCD_D6  = 0;
  148.     LCD_D5  = 1;
  149.     LCD_D4  = 0; // DL = 0 bus de 4 bits
  150.  
  151.     LCD_E   = 1; // habilita la comunicacion
  152.  
  153. //    __delay_us( 50 );
  154.     __delay_ms( 50 );
  155.  
  156.     LCD_E   = 0; // deshabilita la comunicacion
  157.  
  158. //    __delay_us( 50 );
  159.     __delay_ms( 50 );
  160.  
  161.     //dato.byte = 0b00101000; // Establece Funcion
  162.     dato.byte = 0b00101100; // caracteres 5x10
  163.     enviaByteLCD( dato );//envio en 2 partes la confirmacion de comando 4 bits
  164.  
  165.     dato.byte = 0b00000110; // Establece Modo de Entrada
  166.     enviaByteLCD( dato );  //comando display quieto incrementa cursor
  167.  
  168.     //dato.byte = 0b00001110; // Control Encendido/Apagado de Pantalla
  169.     dato.byte = 0b00001100; // cursor oculto
  170.     enviaByteLCD( dato );  //comando LCD on Cursor on
  171. }
  172.  
  173. /******************************************************************************
  174.  ******************************************************************************
  175.  ******************************************************************************/
  176. #define LCD_DIRECTO
  177. #define LCD_CD4094
  178. int main(void)
  179. {
  180.     t_byte caracter;
  181.  
  182.     configurar_pic();
  183.  
  184.     activar_interrupciones_PORTB_TIMER();
  185.  
  186. #ifdef LCD_DIRECTO
  187.  
  188.     inicializa_lcd();
  189.    
  190.     for ( int i=0; i<4; i++ )
  191.     {
  192.         caracter.byte = 'A';
  193.         enviaDatoLCD( caracter );
  194.  
  195.         caracter.byte = 'b';
  196.         enviaDatoLCD( caracter );
  197.  
  198.         caracter.byte = 'C';
  199.         enviaDatoLCD( caracter );
  200.  
  201.         caracter.byte = 'd';
  202.         enviaDatoLCD( caracter );
  203.  
  204.         caracter.byte = ' ';
  205.         enviaDatoLCD( caracter );
  206.     }
  207.  
  208.     /*
  209.      *  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
  210.      * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F  1º linea
  211.      * 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F  2º linea
  212.      */
  213.  
  214.     // mueve el cursor al primer caracter de la segunda linea
  215.     caracter.byte = 0b11000000;
  216.     enviaComandoLCD( caracter );
  217.  
  218.     for ( int i=0; i<16; i++ )
  219.     {
  220.         caracter.byte = 'A';
  221.         enviaDatoLCD( caracter );
  222.     }
  223.  
  224.     caracter.byte = 0b11001011;
  225.     enviaComandoLCD( caracter );
  226.  
  227.     for ( int i=0; i<4; i++ )
  228.     {
  229.         caracter.byte = 'D';
  230.         enviaDatoLCD( caracter );
  231.        
  232.         caracter.byte = 'c';
  233.         enviaDatoLCD( caracter );
  234.        
  235.         caracter.byte = 'B';
  236.         enviaDatoLCD( caracter );
  237.        
  238.         caracter.byte = 'a';
  239.         enviaDatoLCD( caracter );
  240.     }
  241.  
  242.     caracter.byte = 0b10000110;
  243.     enviaComandoLCD( caracter );
  244.  
  245.     for ( int i=0; i<4; i++ )
  246.     {
  247.         caracter.byte = 'D';
  248.         enviaDatoLCD( caracter );
  249.     }
  250.  
  251. #endif
  252.  
  253. #ifdef LCD_CD4094
  254.  
  255.     CD4094_LCD_inicializar();
  256.  
  257.     for ( int i=0; i<4; i++ )
  258.     {
  259.         caracter.byte = 'D';
  260.         CD4094_LCD_enviar( caracter, true );
  261.  
  262.         caracter.byte = 'c';
  263.         CD4094_LCD_enviar( caracter, true );
  264.  
  265.         caracter.byte = 'B';
  266.         CD4094_LCD_enviar( caracter, true );
  267.  
  268.         caracter.byte = 'a';
  269.         CD4094_LCD_enviar( caracter, true );
  270.  
  271.         caracter.byte = ' ';
  272.         CD4094_LCD_enviar( caracter, true );
  273.     }
  274.  
  275.     /*
  276.      *  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
  277.      * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F  1º linea
  278.      * 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F  2º linea
  279.      */
  280.  
  281.     // mueve el cursor al primer caracter de la segunda linea
  282.     caracter.byte = 0b11000000;
  283.     CD4094_LCD_enviar( caracter, false );
  284.  
  285.     for ( int i=0; i<16; i++ )
  286.     {
  287.         caracter.byte = 'A';
  288.         CD4094_LCD_enviar( caracter, true );
  289.     }
  290.  
  291.     caracter.byte = 0b11001011;
  292.     CD4094_LCD_enviar( caracter, false );
  293.  
  294.     for ( int i=0; i<4; i++ )
  295.     {
  296.         caracter.byte = 'W';
  297.         CD4094_LCD_enviar( caracter, true );
  298.  
  299.         caracter.byte = 'x';
  300.         CD4094_LCD_enviar( caracter, true );
  301.  
  302.         caracter.byte = 'Y';
  303.         CD4094_LCD_enviar( caracter, true );
  304.  
  305.         caracter.byte = 'z';
  306.         CD4094_LCD_enviar( caracter, true );
  307.     }
  308.  
  309.     caracter.byte = 0b10000110;
  310.     CD4094_LCD_enviar( caracter, false );
  311.  
  312.     for ( int i=0; i<4; i++ )
  313.     {
  314.         caracter.byte = 'M';
  315.         CD4094_LCD_enviar( caracter, true );
  316.     }
  317.  
  318. #endif
  319.     while ( 1 )
  320.     {
  321.         ;
  322.     }
  323. }

muchas gracias
Un experto es alguien que te explica algo sencillo de forma confusa de tal manera que te hace pensar que la confusión sea culpa tuya.

DSD http://www.dysd.com.ar/

Desconectado PalitroqueZ

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 5490
    • Electrónica Didacta
Re: LCD en proteus funciona en protoboard no
« Respuesta #1 en: 10 de Abril de 2014, 21:50:18 »
yo no confío mucho en esos retardos, no garantizan que el controlador se haya desocupado, lo mejor es preguntar por el bit BUSY
La propiedad privada es la mayor garantía de libertad.
Friedrich August von Hayek

Desconectado LucasBols

  • PIC16
  • ***
  • Mensajes: 129
    • Desarrollos y Servicios Digitales
Re: LCD en proteus funciona en protoboard no
« Respuesta #2 en: 11 de Abril de 2014, 12:37:20 »
hola PalitroqueZ, buen día,

yo no confío mucho en esos retardos, no garantizan que el controlador se haya desocupado, lo mejor es preguntar por el bit BUSY

Le estoy dando 45 ms entre cada envío, debería ser más que suficiente, la inicialización más un mensaje de aprox 30 caracteres tarda cerca de 10 segundos

muchas gracias,

saludos,
Un experto es alguien que te explica algo sencillo de forma confusa de tal manera que te hace pensar que la confusión sea culpa tuya.

DSD http://www.dysd.com.ar/

Desconectado champilton

  • PIC10
  • *
  • Mensajes: 19
Re: LCD en proteus funciona en protoboard no
« Respuesta #3 en: 20 de Abril de 2014, 03:24:24 »
podrias colocar una imagen del montaje en la proto, quizas haya algo que te haya faltado.... una idea, tan solo una idea es que no hayas colocado el potenciometro en VEE, o si lo mandaste a tierra al igual que en la simulacion la pantalla estara completamente obscura.

si estoy errado en mi suposicion, no sabria que mas podria estar fallando en tu montaje en proto.

Espero haberte ayudado, saludos!!!

Desconectado LucasBols

  • PIC16
  • ***
  • Mensajes: 129
    • Desarrollos y Servicios Digitales
Re: LCD en proteus funciona en protoboard no
« Respuesta #4 en: 22 de Abril de 2014, 15:37:43 »
hola champilton, buenas tardes,

disculpame por la demora en la respuesta,

el problema estaba en que el contraste del JHD162A funciona al reves del resto de los lcd con hd44780, en el JHD162A el mayor contraste se obtiene a 5v, en el resto a masa

muchas gracias,

saludos
Un experto es alguien que te explica algo sencillo de forma confusa de tal manera que te hace pensar que la confusión sea culpa tuya.

DSD http://www.dysd.com.ar/