AY0438 Display Driver


Closed Thread
Results 1 to 14 of 14
  1. #1
    Join Date
    Aug 2009
    Posts
    16

    Default AY0438 Display Driver

    I have a Glass type display with a Microchip AY0438 display driver. I found the assembly code for this chip on Microchips site, but I'm bot very good with assembly. Can anyone offer a code example of how to use this chip with PBP? I have used the LCDOUT comand with the 44780 type displays, but i have not used this type of display before.

    Thanks,

    Terry

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tallen View Post
    I have a Glass type display with a Microchip AY0438 display driver. I found the assembly code for this chip on Microchips site, but I'm bot very good with assembly. Can anyone offer a code example of how to use this chip with PBP? I have used the LCDOUT comand with the 44780 type displays, but i have not used this type of display before.

    Thanks,

    Terry
    Hi Terry,

    I used the shiftout command. Sorry I don't have an example on this
    PC. I will look for some code I have and post it later.

    Mark

  3. #3
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default

    tallen,

    Yes, I have used this chip before. The LCDOUT command is for alphanumeric LCD displays, for example a 16x2 characters display. This chip AY0438 is to drive 7-segments LCD displays. What type of display do you want to drive?

    Robert

  4. #4
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default AY0438 Display Driver

    Its a 7 seg LCD that has a Microchip AY0438 driver with it.

    Terry

  5. #5
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tallen View Post
    Its a 7 seg LCD that has a Microchip AY0438 driver with it.

    Terry
    Then, you need to look at the datasheet of the LCD with the AY0438 in it. Look at figure 4 of the AY0438 datasheet. This figure shows you how to control the 32 segments. If I remember correctly, you have to connect the LCD(Phi) to the clocking signal for it to work. How many digits does the LCD have?


    Name:  Fig-4.JPG
Views: 1010
Size:  27.5 KB

    Robert

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tallen View Post
    Its a 7 seg LCD that has a Microchip AY0438 driver with it.

    Terry
    Terry,

    Try this code. It is for a 4 digit seven segment display.

    Mark
    Attached Files Attached Files

  7. #7
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    i'm struggling with this code. It is a 4 digit 7 segment display. The display just seems to roll continiously very fast. I put in a pause to slow it down. I removed the "IF Total = 9999 then Temp = 0" and the "Temp=Temp+1. I put it TEMP = 1234 hoping to dispaly 1234, but all I see is just jumbled up numbers. I put in TEMP = 1 and see PPP. As you can Tell I don't understand this lookup and shiftout code. Any Ideas?

    Thanks,

    Terry

  8. #8
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tallen View Post
    i'm struggling with this code. It is a 4 digit 7 segment display. The display just seems to roll continiously very fast. I put in a pause to slow it down. I removed the "IF Total = 9999 then Temp = 0" and the "Temp=Temp+1. I put it TEMP = 1234 hoping to dispaly 1234, but all I see is just jumbled up numbers. I put in TEMP = 1 and see PPP. As you can Tell I don't understand this lookup and shiftout code. Any Ideas?

    Thanks,

    Terry
    Did you wire the 7-segment LCD display to the AY0438 chip? If they came together as you said earlier, do you have the datasheet for this part? More than likely, the wiring that mark_s used in his program is different than the way you are wiring it. You need to know how the segment pins in the AY0438 are connected to the segments in the LCD display. You need the part datasheet.

    Robert

  9. #9
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Yes, the display is already wired to the driver chip. I will check the data sheets for both. I have the data sheet for the driver, but I will have to find the one for the LCD.

    This display and driver chip was on an old product that i did not design (obviously). We have tons of these new prewire display boards that I was hoping to use on a new design. I have the original asm code for the old product, but since I'm not very good with asm, I was trying to use it with purely basic code.

    Thanks,

    Terry

  10. #10


    Did you find this post helpful? Yes | No

    Default

    Terry,
    Try taking the "0" out of each of these lines. Then try your Temp = 1234

    'SEVEN SEG LOOKUP
    LookUp ONES,[63,6,91,79,102,109,124,7,127,103,0],LCD_THOU
    LookUp TENS,[63,6,91,79,102,109,124,7,127,103,0],LCD_HUNS
    LookUp HUNS,[63,6,91,79,102,109,124,7,127,103,0],LCD_TENS
    LookUp THOU,[63,6,91,79,102,109,124,7,127,103,0],LCD_ONES

    I did this a long tme ago so I don't remember why I added the 0. Hope you get it going.

    Regards Mark

    Add:Like Robert said the LCD may be connected different than my code.
    I used LCD segment A, Digit 1 = Segment 1 Pin 39 AY0438 and
    LCD seg B = Segment 2 pin 38 AY0438 and so on.
    Post your asm code, we can probably see how its connected by the look up tables at
    the bottom of the listing.
    Last edited by mark_s; - 26th April 2010 at 22:11.

  11. #11
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Mark & Robert,

    You were correct that the wiring was different. I was able to pull the old asm code from the original C code to put in my basic code. Now thats a little confusing. I got the asm code to work for the most part, but I still have not got a good understanding on how it works. I just wrote a small basic program to count from 1-100 and roll to test it. It counts correctly on the display, but it shows up as the following:

    001, 002, 003, 004, ...

    I would like to get rid of the leading zero's if possible. Any ideas on this. I would like it to look like the following:

    1, 2, 3, 4, ...


    Thanks again for the help.

    Terry
    Attached Files Attached Files

  12. #12


    Did you find this post helpful? Yes | No

    Default

    I took your code and changed the lookup statements in the pbp code
    it may need some slight adjustments. Also added zero suppression.
    Can someone explain how to insert code into these messages? I
    see others using "code:" Thanks


    Code:
        TOTAL = TEMP
        THOU = TOTAL/1000 
        TOTAL = TOTAL//1000
        HUNS = TOTAL/100
        TOTAL = TOTAL//100
        TENS = TOTAL/10
        ones = TOTAL//10
    
    
        'SEVEN SEG LOOKUP
        LookUp ONES,[124,72,61,109,75,103,119,76,127,111],LCD_ONES
        LookUp TENS,[124,72,61,109,75,103,119,76,127,111],LCD_TENS
        LookUp HUNS,[124,72,61,109,75,103,119,76,127,111],LCD_HUNS
        LookUp THOU,[124,72,61,109,75,103,119,76,127,111],LCD_THOU
        
        If Temp < 1000 then LCD_THOU = 0 'Suppress leading zeros
                    If Temp < 100 then LCD_HUNS = 0
        If Temp < 10 then LCD_TENS = 0
    
    'PORTB.0 = DATA
    'PORTB.1 = CLOCK
    'PORTB.2 = LOAD DATA
    
        PORTB.2 =0     'LOAD DATA AY0438
        ShiftOut PORTB.0,PORTB.1,0,[LCD_ONES,LCD_TENS,LCD_HUNS3,LCD_THOU]  'SEND 4 BYTES
        PORTB.2 =1     'Latch DATA
    
    
    
    Below is from your code I used the calculator in windows accessories to convert
    the hex to decimal for the above Lookup statements
    '-------------------------------------------------------------
    '
    '               RETLW  0x7e          = 0 124
    '               RETLW  0x48          = 1  72
    '              RETLW  0x3D          = 2  61
    '              RETLW  0x6D          = 3 109 
    '              RETLW  0x4B          = 4  75
    '              RETLW  0x67          = 5 103       
    '              RETLW  0x77          = 6 119        
    '              RETLW  0x4C          = 7  76
    '              RETLW  0x7F          = 8 127
    '              RETLW  0x6F          = 9 111
    Last edited by ScaleRobotics; - 27th April 2010 at 22:21. Reason: code tags added

  13. #13
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Thanks,

    I will try this

    Terry

  14. #14
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Code Tags

    Quote Originally Posted by mark_s View Post
    Can someone explain how to insert code into these messages? I
    see others using "code:" Thanks
    To insert code, use code tags like this, but without the space:

    [ code]
    your code
    goes here
    [ /code]

    and you will get this:

    Code:
    your code
    goes here
    Walter

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts