• AVR Freaks

Hot!PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS

Author
EMANUEL DEGNI JUNIOR
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2010/10/27 11:34:49
  • Location: 0
  • Status: offline
2010/10/27 15:26:27 (permalink)
0

PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS

I'm developing an application consisting of:
- PIC18F4523;
- AY0438 LCD Driver;
- LCD Display 4 digits, 32 segments.
 
1-The assembly routine presented in Datasheet AY0438, works perfectly (sends the segments to display) in the simulator Proteus 7.7 SP2, but does not work at all in the real word (Protoboard and Printed Circuit Board);
2- Happens the same with the routine available in the MICROCHIP PIC COOKBOOK Volume 1;
3- MICROCHIP Support can't help me with code assistance;
4- I'm sttrugling with this routine for three months now;
4- I kindly request any of the members of this forum, to send me a small routine to send 4 digits already converted to segmenbts , through this driver (Ay0438) , that really works.
 
Thanks and Best Regards

#1

13 Replies Related Threads

    assaad
    Super Member
    • Total Posts : 2504
    • Reward points : 0
    • Joined: 2006/03/27 22:51:42
    • Location: Turkey
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS 2010/10/28 07:22:57 (permalink)
    0
    Could you post teh shematic and code , inorder to help you ?

    S. ASSAAD
    #2
    ErnieM
    Super Member
    • Total Posts : 375
    • Reward points : 0
    • Joined: 2007/10/13 02:54:02
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS 2010/10/28 12:22:15 (permalink)
    0
    Having never used any of this hardware... I took a quick look at the AY0438 spec. All that device is doing is accepting serial data, 1 segment for each clock for 32 segments. Data is read at the falling clock edge, and should change when the clock is high. Clock and Load are normally low. Once all data has been clocked in, pulse Load hi and the data is latched.

    It would seem a fairly simple "sanity check" even before lighting a known segment patten for numbers to just light them all (Data always 1), blank them all (Data always 0). If you can see that then you can walk a single 1 through the Data stream and see an individual segment light up.

    You should be able to bit bang something like that in under an hour. If it doesn't work you have an electrical problem.

    Besides teh shematic what are you using to build the code? MPLAB assembler, C18 (would be MY choice as it is free and very powerful), or something else? 
    #3
    EMANUEL DEGNI JUNIOR
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2010/10/27 11:34:49
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/10/29 08:37:20 (permalink)
    0
    Thank you very much for trying to help me.
     
    1- Schematic Proteus 7.7 SP2 (attached)
    2- Routine in asm code that concerns my problem is the one bellow (comments in Brazilian  portuguese):
    Note: Crystal 4 MHz
    ___________________________________________________________________________________________
    #DEFINE          CLK             PORTE,0             ; Clock para o driver AY0438
     #DEFINE          DATAIN       PORTE,1             ; Entrada de dados para o driver AY0438
     #DEFINE          LOAD          PORTE,2             ; Load do driver AY0438
    ____________________________________________________________________________________________
    CONVERTE 
    ;Converts binary to segments 
     
     ADDWF  PCL,F
     
     RETLW          B'01111110'   ; 00
     RETLW          B'00001100'   ; 01
     RETLW          B'10110110'   ; 02
     RETLW          B'10011110'   ; 03
     RETLW          B'11001100'   ; 04
     RETLW          B'11011010'   ; 05
     RETLW          B'11111010'   ; 06
     RETLW          B'00001110'   ; 07
     RETLW          B'11111110'   ; 08  
     RETLW          B'11011110'   ; 09
     
    ______________________________________________________________________________________________
     
    ; Routine from Datasheet  AY0438 -MICROCHIP 
    DISPLAY
             BCF               LOAD                        ; Garante que LOAD=0 (opcional)
             MOVLW          .32                           ; W = 32
             MOVWF          COUNT                    ; COUNT = 32     (segmentos)

    SERIAL_DISPLAY
     RRCF          DIG4,F                        ; Rotaciona a direita atraves do carry
     RRCF          DIG3,F                        ; Rotaciona a direita atraves do carry
     RRCF          DIG2,F                        ; Rotaciona a direita atraves do carry
     RRCF          DIG1,F                        ; Rotaciona a direita atraves do carry

     BSF             DATAIN
     BTFSS         STATUS,C                    ; Verifica se ja completou o giro (completou=>CARRY=1)
     BCF             DATAIN                        ; Completou: DATAIN=1; habilita o segmento , tornando-o visivel
     BSF             CLK                             ; Nao completou: 
     BCF             CLK                             ; Alterna os estados de CLOCK

     DECFSZ      COUNT,F                      ; Decresce COUNT de 1 e compara (=0?) 
     GOTO         SERIAL_DISPLAY         ; Nao: GOTO SERIAL_DISPLAY
     BSF              LOAD                          ; Sim: LOAD=1, faz a carga paralela dos dados no shift register
     NOP                                                 ; Aguarda 1 us 
     BCF              LOAD                          ; LOAD=0,habilita os Latches e desconecta os segmentos
     RETURN                                           ; Retorno da rotina DISPLAY
    _________________________________________________________________________________________________ 
     
    I am not sure, but I think the problem resides in Setup times and Hold times for AY0438.
     
    Please do your best to help me.
    The project is pending on this! 
    BEST REGARDS

    Attached Image(s)

    #4
    ErnieM
    Super Member
    • Total Posts : 375
    • Reward points : 0
    • Joined: 2007/10/13 02:54:02
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/10/30 07:36:40 (permalink)
    0
    Nothing pops out as a problem, schematic looks reasonable as does the code. Besides saying "it doesn't work" what is the issue? Does anything display on the display, do some segments show up but not what you intended?

    The AY0438 isn't a slow device. I don't think it is setup & hold delays as with a 4.2MHz crystal your instruction rate is about 1MHz, so your CLK line rate is 500KHz and your setup/hold time is larger then 500nS min.

    What does the project do, does it display anything? 

    Do you have an oscilloscope to observe the CLOCK DIN and LOAD lines (and the segment drivers)?

    If you have a debugger you can step thru your code and use even a voltmeter to check signals. A PICKIT can do that as your left the PGD & PGC lines free.  (I always leave a way to run a debugger on my projects.)

    Finally, please add your MPLAB project so I can run it thru MPLAB simulator and watch if the control lines wiggle.

    #5
    EMANUEL DEGNI JUNIOR
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2010/10/27 11:34:49
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/10/30 08:35:11 (permalink)
    0
    Hello Ernie,
    It's a customized multimeter and clock-calendar for a Radio Transmitters supplier, friend of mine.
    If you dont use this driver (AY0438) and feed the display directly throgh ports, it displays, according to the specifications of the "client";
    1- Source and Module Tension (Example: 357 Volts, step 1 volt);
    2- Source current (Example : 32,70 , step 0.1 Amp);
    3 - Power and Reflected Power at antenna(Example:  0 to 5000 Watts, step 10 watts);
    4- A Clock- Calendar , by interruption of TIMER0, with set and halt functions that controls the power of transmitter according to the month, hours and minutes to a determined region  of BRAZIL;
    5- I could not send  3 includes, so I send in separate messages; 
     
    But all this is curiosity, once my problem  is:
    To write a small routine that sends 4 digits (already converted to segments) to a 32 segments display throhgh AY0438.
     
    Thans for your interest.
     
    Best regards
    #6
    EMANUEL DEGNI JUNIOR
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2010/10/27 11:34:49
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/10/30 08:48:00 (permalink)
    0
    Ernie,
    It is failing to send includes.
    I'm sorry.
    Regards
    #7
    ErnieM
    Super Member
    • Total Posts : 375
    • Reward points : 0
    • Joined: 2007/10/13 02:54:02
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/10/30 10:37:27 (permalink)
    0
    I can't get it to build with out the include files.

    Can you drop your entire project into one zip file? Zips are one of the allowed file types here.


    #8
    EMANUEL DEGNI JUNIOR
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2010/10/27 11:34:49
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/11/03 15:42:19 (permalink)
    0
    ERNIE,
     
    Please inform your e-mail and I will send you the whole package.
     
    emanueldegni@bol.com.br
    #9
    EMANUEL DEGNI JUNIOR
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2010/10/27 11:34:49
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/11/06 05:53:08 (permalink)
    0
    Ernie,
     
    I kindly request you to inform your mail, so I can send the code, all includes and even the PROTEUS sketch.
    My mail is:
    emanueldegni@bol.com.br
     
    I put everything into a  .rar, but the system systematicaly refuses to upload.
     
    Best Regards
    Emanuel - São Paulo
     
     
    #10
    ErnieM
    Super Member
    • Total Posts : 375
    • Reward points : 0
    • Joined: 2007/10/13 02:54:02
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/11/07 17:53:51 (permalink)
    0
    My system would also refuse to read a rar, I don't have those utilities.

    I can read a zip. Zips work here.

    See the one I added?

    By the way, when we ask "what does the project do" in response to your problem, we typically don't need what the working parts do. I would request what you see on the display. Do you see any segments change? Are they random or seem to follow a pattern? Did you try any of the tests I mentioned?

    Generally, when I get stuck on a porblem like this, I forget all the rest of the project and zero in on the problem. I may write another program that just drives the problem area to learn the specifics of the issue.

    #11
    EMANUEL DEGNI JUNIOR
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2010/10/27 11:34:49
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/11/08 17:59:58 (permalink)
    0
    ARNIE,
     
    1-Here goes the whole package in a .zip file;
     
    2- I've tried your proposed tests;
     
    3- The LCD display presents following behaviours (aleatory, every time you switch power On and Off):
    a- Some segments lights and some blinks;
    b- Part of segments lights and part not (08 -   )
    c- Al segments lights (8.8.8.8);
    d - No segments  lights at all (           ).
     
    3- When you look @ the main code (DIGICAST.asm) attached,  please refer to lines 945 to 963 where you can find the problem (routine for AY0438).
     
    4- Other informations:
    a-Crystal is now 20 MHZ;
    b- Capacitors 0.1 uF has been placed between VDD and VSS;
    c- Code comments in Brazilian Portuguese.
     
    Yours Sincerely
    #12
    EMANUEL DEGNI JUNIOR
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2010/10/27 11:34:49
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2010/11/14 05:34:14 (permalink)
    0
    Hej Arnie!
     
    Attached program in C (CCS compiler) and in particular, the 2 routines marked in blue solved the problem.
     
    Now I need  to translate these 2 routines to assembly and adapt into my program.
     
    I accept your help.
     
    Regards
    #13
    IBRA
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2018/03/08 09:40:26
    • Location: 0
    • Status: offline
    Re:PIC18F4523 + LCD DRIVER AY0438 + LCD DISPLAY 4 DIGITS, 32 SEGMENTS (VARITRONIX) 2018/08/28 08:21:32 (permalink)
    0
    Hello,
    I'm using the LASCAR DDM4 LCD, but I can not find a some example with C code for start. you can help me ?
    Thank you
    #14
    Jump to:
    © 2019 APG vNext Commercial Version 4.5