AY0438 Display Driver


Results 1 to 14 of 14

Threaded View

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

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