Hdsp 21xx display


Closed Thread
Results 1 to 6 of 6
  1. #1
    Original's Avatar
    Original Guest

    Default Hdsp 21xx display

    Hello Melanie

    I'm trying to figure out how to use your DS1307 clock code, at the melabs site, to display hh:mm:ss on the hp hdsp 211x display. The Rentron site has the hdsp example to scroll a message and I've been successful with ascii characters. The clock display format is very confusing to me. Could you please steer me in the right direction or anyone else. I've been trying to get some result for a while now. Bruce Reynolds code is below:

    DEFINE OSC 20 ' 20MHz oscillator
    DEFINE LOADER_USED 1' Using boot-loader for initial prototype
    TRISA = 0 ' Setup PortA = output for Address Bus
    TRISB = 0 ' Setup PortB = output for Data Bus
    TRISC = $80 ' RC.7 = input, rest outputs [used for loader]
    ADCON1 = 7 ' A/D OFF
    A_Bus VAR PortA ' PortA Address Bus
    D_Bus VAR PortB ' PortB = Data Bus
    W_Pin VAR PortC.0 ' HDSP-2112 write strobe pin #13
    A3 VAR PortC.1 ' HDSP-2112 mode select pin #6
    RST VAR PortC.2 ' HDSP-2112 reset pin #1
    Digit VAR BYTE[8] ' 8-byte digit array
    DigPat VAR BYTE ' Digit pattern from lookup table
    LP_Cnt VAR BYTE ' Loop counter
    LowDig VAR BYTE ' Holds "low" digit # to lookup
    LowDig = 0 ' 1st digit = 0
    HiDig VAR BYTE ' Holds "high" digit # to lookup
    HiDig = 7 ' Last digit = 7
    J VAR BYTE ' Array index pointer
    J = 0 ' 1st byte in array
    S_Speed VAR WORD ' Holds display scroll speed
    S_Speed = 300 ' Set display scroll speed here
    LOW D_Bus.7 ' Set display for normal operation
    EOM CON "~" ' Character used as "End of Message" marker
    '* // Initialize display - then set brightness * //'
    Init_Display:
    ' * // Initialize Display Here * //'
    HIGH W_Pin : LOW RST : PAUSE 10 : HIGH RST : PAUSE 10

    ' * // Set Display Brightness Here * //'
    ' To change display brightness
    ' D_Bus = | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
    ' Bright =| 100% | 80% | 53% | 40% | 27% | 20% | 13% |
    '
    ' Set 27% | mode.bit | strobe settings into display |
    D_Bus = 4 : LOW A3 : LOW W_Pin : HIGH W_Pin
    HIGH A3 ' A3 used only for setting display brightness

    '* // Get 8 digits into "Digit Array" for display * //'
    GetDig:
    FOR LP_Cnt = LowDig TO HiDig
    LOOKUP LP_Cnt,[" Hello.! ~"],DigPat
    Digit[J] = DigPat ' Load all 8 digits into array
    J = J + 1 ' Increment array index pointer
    NEXT ' Loop until we have all 8 digits loaded
    J=0 ' Re-set array index pointer
    LowDig = LowDig + 1 ' Increment to next "low" digit
    HiDig = HiDig + 1 ' Increment to next "high" digit

    ' * // We're using the "~" character in EOM to tag the end of message * //'
    IF Digit[7] = EOM THEN ' End-of-message indicator..?
    Digit[7] = " " ' Then load a "blamk space" character
    LowDig = 0 ' Re-load 0-7 MAX digit count
    HiDig = 7 '
    ENDIF
    '* // Display 8 digits on display then return for more // *'
    DisplayDigit:
    FOR LP_Cnt = 0 TO 7 ' Scroll right-to-left
    A_Bus = LP_Cnt ' Place digit address on address bus
    D_Bus = Digit[J] ' Place digit data on data bus
    LOW W_Pin : HIGH W_Pin' Strobe data into display
    J = J + 1 ' Increment array pointer to next digit
    NEXT
    J = 0 ' Re-set array index pointer
    PAUSE S_Speed ' Set display scroll speed
    GOTO GetDig

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I've not met this display before so without looking at it's datasheet (which I don't have) I can't immediately give you an answer. If nobody else answers this thread I'll try to find some time and look into it by the weekend.

  3. #3
    Original's Avatar
    Original Guest


    Did you find this post helpful? Yes | No

    Default

    Melanie

    Thank you for the quick reply. Thae data sheet can be found at:
    www.rentron.com/Files/hdsp-2112.pdf if you need.

  4. #4
    Original's Avatar
    Original Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    Well I was able to write a test code for the clock function if anyone is intrested. Works very good!
    Attached Files Attached Files
    Last edited by Original; - 14th November 2003 at 07:17.

  5. #5
    Join Date
    Nov 2003
    Location
    Sao Paulo - Brazil
    Posts
    92


    Did you find this post helpful? Yes | No

    Default Re: Hdsp 21xx display

    Hi friends,

    I know that this is a really old topic, but, last week I got 3 of this display for free from a friend.

    They are nice, bright, and has a good "retro" looking.

    I did many many tests and I was unable to get a stable result from the display. They are brand new, never used.

    I test the Rentron´s Hello moving message an the clock published here.

    Both, I get ramndom characters and a strange behavior.

    I´m using a 16F877 @ 10 Mhz (I did tests @ 20 Mhz also)




    Name:  2012-06-07 12.34.37.jpg
Views: 2168
Size:  364.7 KB

    I´m using the wiring suggested by rentron :

    '* // Display connections * //'
    ' PortB Display | PortA Display | PortC Display
    ' B0 #19 | A0 #3 | C0 #13
    ' B1 #20 | A1 #4 | C1 #6
    ' B2 #23 | A2 #5 | C2 #1
    ' B3 #24
    ' B4 #25
    ' B5 #26
    ' B6 #27
    ' * // Display GND, VCC and N.C. [no connection] * //'
    ' GND 15,16,17,28
    ' VCC 2,7,8,9,10,11,14,18
    ' N.C. 12


    and the source code :

    Code:
    DEFINE OSC 10         ' 4MHz oscillator
    @ ERRORLEVEL -306   ; Retira o erro de crossing page boundary
    ;@  __CONFIG  _CP_OFF  & _DEBUG_OFF & _CP_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _PWRTE_ON & _WDT_OFF & _HS_OSC 
    @  __CONFIG  _HS_OSC &  _CP_OFF & _DEBUG_OFF  & _CPD_OFF & _LVP_OFF & _PWRTE_ON  & _WDT_OFF
    
    TRISA   = 0         ' Setup PortA = output for Address Bus
    TRISB   = 0         ' Setup PortB = output for Data Bus
    TRISC   = 0       ' RC.7 = input, rest outputs [used for loader]
    ADCON1  = 7         ' A/D OFF
     
    A_Bus   VAR PORTA
    D_Bus   VAR PORTB   ' PortB = Data Bus
    W_Pin   VAR PortC.0 ' HDSP-2112 write strobe pin #13
    A3      VAR PortC.1 ' HDSP-2112 mode select pin #6
    FL      VAR PortC.4 'Flash mode select 
    RST     VAR PortC.2 ' HDSP-2112 reset pin #1
    Digit   VAR BYTE[8] ' 8-byte digit array
    DigPat  VAR BYTE    ' Digit pattern from lookup table
    LP_Cnt  VAR BYTE    ' Loop counter
    LowDig  VAR BYTE    ' Holds "low" digit # to lookup
    LowDig  = 0         ' 1st digit = 0
    HiDig   VAR BYTE    ' Holds "high" digit # to lookup
    HiDig   = 7         ' Last digit = 7
    J       VAR BYTE    ' Array index pointer
    J       = 0         ' 1st byte in array
    S_Speed VAR WORD    ' Holds display scroll speed
    S_Speed = 200      ' Set display scroll speed here
    Low D_Bus.7         ' Set display for normal operation
    EOM     CON "~"     ' Character used as "End of Message" marker
    hour    VAR     BYTE    ' Define hour variable
    dhour   VAR     word    ' Define display hour variable
    minute  VAR     BYTE    ' Define minute variable
    second  VAR     BYTE    ' Define second variable
    ticks   VAR     BYTE    ' Define pieces of seconds variable
    update  VAR     BYTE    ' Define variable to indicate update of LCD
      
    second10 var byte
    min10   VAR BYTE 
    hour10  VAR BYTE
     
    i var word
    ADCON1 = 7 
            second10 = 0 
            hour = 0       ' Set initial time to 01:00:00
            hour10 = 6
            minute =  0
            min10  = 0
            second = 0
            ticks = $00
            
             
            update = 0      
      
            OPTION_REG = $55        ' Set TMR0 configuration and enable PORTB pullups
            INTCON = $a0            ' Enable TMR0 interrupts
            On Interrupt GoTo tickint        
                     '
    '* // Initialize display - then set brightness * //'
    Init_Display:
        ' * // Initialize Display Here * //'
        High W_Pin : Low RST : Pause 20 : High RST : High FL : Pause 20
        
        ' * // Set Display Brightness Here * //' 
        ' To change display brightness
        ' D_Bus = |  0   |  1  |  2  |  3  |  4  |  5  |  6  |
        ' Bright =| 100% | 80% | 53% | 40% | 27% | 20% | 13% |
        '
        ' Set 27% | mode.bit | strobe settings into display |
        D_Bus = %0001100 : Low A3 : Low W_Pin : High W_Pin 
        High A3 ':HIGH FL' A3 used only for setting display brightness
        
     
        
                       
    '* // Get 8 digits into "Digit Array" for display * //'
    GetDig:
             
              
                
        For LP_Cnt = LowDig TO HiDig
           LookUp LP_Cnt,["  :  :  "],DigPat
            Digit[J] = DigPat   ' Load all 8 digits into array
            J = J + 1           ' Increment array index pointer
        Next                    ' Loop until we have all 8 digits loaded
        J=0                     ' Re-set array index pointer
        LowDig = LowDig      ' Increment to next "low" digit
        HiDig = HiDig       ' Increment to next "high" digit
        
            
      
    '* // Display 8 digits on display then return for more // *'
    DisplayDigit:
       For LP_Cnt = LowDig TO HiDig     ' Scroll right-to-left
          
          
         A_Bus  = LP_Cnt        ' Place digit address on address bus
          
          D_Bus = Digit[J]      ' Place digit data on data bus
          Low W_Pin : High W_Pin' Strobe data into display
         J = J + 1            ' Increment array pointer to next digit
         DigPat = DigPat
              
        Next
        J = 0 
          
       chkup:  
                    'While hour = 1 and hour10 = 3
                    '       hour = 0
                    '       hour10 = 1
                    '       wend    
       
                   A_Bus  = 7
                     D_Bus = 48 + second10 
                     Low W_Pin : High W_Pin
                       Pause 10
              
                   A_Bus  = 6
                     D_Bus = 48 + second 
                     Low W_Pin : High W_Pin
                       Pause 10
                    
                    A_Bus  = 4
                     D_Bus = 48 + min10 
                     Low W_Pin : High W_Pin
                       Pause 10 
                       
                       A_Bus  = 3
                     D_Bus = 48 + minute 
                     Low W_Pin : High W_Pin
                       Pause 10
                       
                       A_Bus  = 1
                     D_Bus = 48 + hour10 
                     Low W_Pin : High W_Pin
                       Pause 10
                       
                       A_Bus  = 0
                     D_Bus = 48 + hour 
                     Low W_Pin : High W_Pin
                       Pause 10
                     
                      IF update = 1 Then
                      
                     update = 0
                      endif
         Goto chkup 
             
               Disable  
    tickint:  
            ticks = ticks + 1      ' Count pieces of seconds
         
            IF ticks < 165 Then tiexit   
          
           
    ' One second elasped - update time
            
            ticks = 0
            second10 = second10 + 1
            IF second10 >= 10 Then
              second10 = 0
              second = second + 1
            
            IF second >= 6 Then
                    second = 0
                    min10 = min10 +1
                    IF min10 > 9 THEN
                    min10 = 0
                    minute = minute + 1
                    IF minute >= 6 Then
                            minute = 0
                            hour10 = hour10 + 1
                            IF hour10 > 9  THEN
                            hour10 = 0
                            hour = hour + 1
                            IF hour > 2 Then
                                    hour = 0
                                    
                                    
                               
                                      ENDIF 
                               ENDIF 
                                  
                            EndIF
                    EndIF
            EndIF
            
             ENDIF 
            update = 1      ' Set to update LCD
            
    tiexit: 
             INTCON.2 = 0    ' Reset timer interrupt flag
            
            Resume
            End

    Have someone here ever used this kind of display ?

    thanks !

    Sérgio

  6. #6
    Join Date
    Nov 2003
    Location
    Sao Paulo - Brazil
    Posts
    92


    Did you find this post helpful? Yes | No

    Default Re: Hdsp 21xx display

    Hi friends !

    I did find my problem.

    I was using a really noisy power supply.

    Afeter changing it to another one, everything is working fine !

    Thank you !

Similar Threads

  1. Replies: 2
    Last Post: - 14th July 2008, 23:11
  2. DS1820 display with 7-seg 4 digits
    By chai98a in forum Code Examples
    Replies: 12
    Last Post: - 10th April 2008, 14:12
  3. Replies: 14
    Last Post: - 26th September 2007, 06:41
  4. need help on display problem
    By sixty9sandals in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 30th March 2007, 04:57
  5. graphics display
    By adlinsystems in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th June 2004, 13:53

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