PDA

View Full Version : AY0438 Display Driver



tallen
- 23rd April 2010, 16:39
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

mark_s
- 23rd April 2010, 17:07
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

rsocor01
- 23rd April 2010, 20:38
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

tallen
- 23rd April 2010, 20:47
Its a 7 seg LCD that has a Microchip AY0438 driver with it.

Terry

rsocor01
- 24th April 2010, 01:09
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?


4280

Robert

mark_s
- 24th April 2010, 15:45
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

tallen
- 26th April 2010, 16:18
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

rsocor01
- 26th April 2010, 17:19
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

tallen
- 26th April 2010, 17:42
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

mark_s
- 26th April 2010, 20:19
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.

tallen
- 27th April 2010, 17:34
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

mark_s
- 27th April 2010, 20:22
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




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

tallen
- 27th April 2010, 20:35
Thanks,

I will try this

Terry

ScaleRobotics
- 27th April 2010, 20:48
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:



your code
goes here


Walter