AY0438 Display Driver


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    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

  2. #2


    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 21:21. Reason: code tags added

  3. #3
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Thanks,

    I will try this

    Terry

  4. #4
    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 : 0

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