​ ​ ​ ​ HT1621 Display
Results 1 to 7 of 7

Thread: HT1621 Display

  1. #1

    Default HT1621 Display

    Dear All,

    Has anyone tried one of these , I'm struggling understanding the datasheet.

    I've found some sample code to use with the Arduino, but don't have the skill to translate.

    Any thoughts please
    Tim

  2. #2
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    12,268

    Default

    It would be a good idea to provide a link to the datsheet rather than make those you seek help from first have to search for the datasheet.
    Often someone who has not used a given product can read and provide useful advice.

    Also worth indicating/posting the code for what you have tried yourself thus far.

    Okay: the datasheet can be found here:
    https://www.crystalfontz.com/control...ek/HT1621/118/
    westaust55

    Hey Hamlet, 2B OR NOT 2B = $FF

  3. #3

    Default

    Dear westaust55,

    It was never my intention in wasting yours or other members time - apologies for this.

    In the past I've used AY0438 for simple 7 segment displays using the attached code.

    I'm struggling to understand some of the command codes. The Arduio code is also attacheddefine CS 2.txtlcd_4digit_test_kitchen.bas

    thanks

  4. #4
    Senior Member
    Join Date
    Feb 2012
    Location
    London
    Posts
    2,882

    Default

    Hi Tim,

    I think we may also need a link to the particular LCD display you want to drive, and/or what you want to do with it. The data sheet appears to be for a general-purpose (configurable) "7 segment" driver for 32 segments (i.e. 4 digits), but I'm not clear if that can be multiplied by 4 or 16 by using the four "COM" lines.

    It will be necessary to know how the "Segment" lines are mapped in/to the LCD (which should be possible to determine from the Arduino code, if it is relevant) and which characters/digits you want to display: After the 10 regular numbers, the Arduino code appears to offer upper and lower case characters for C and H, but none for G and I to N, etc..

    Cheers, Alan.

  5. #5
    Senior Member
    Join Date
    Oct 2012
    Location
    USA
    Posts
    472

    Default

    Quote Originally Posted by AllyCat View Post
    Hi Tim,

    I think we may also need a link to the particular LCD display you want to drive, and/or what you want to do with it. The data sheet appears to be for a general-purpose (configurable) "7 segment" driver for 32 segments (i.e. 4 digits), but I'm not clear if that can be multiplied by 4 or 16 by using the four "COM" lines.

    It will be necessary to know how the "Segment" lines are mapped in/to the LCD (which should be possible to determine from the Arduino code, if it is relevant) and which characters/digits you want to display: After the 10 regular numbers, the Arduino code appears to offer upper and lower case characters for C and H, but none for G and I to N, etc..

    Cheers, Alan.
    There's some comprehensive Arduino code here which should be helpful. The display appears to be the commonly available HT1621/Arduino ebay module.

  6. #6
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    24,365

    Default

    I've not actually used a HT1621 and it does seem a bit of an unusual device but it will basically be bit banging a data bit stream, the number of bits defined by the first 3-bit command code.

    I would throw the C code away, just use it for reference, and design something suited to the PICAXE.

    Assuming you would only be writing to the display, setting configuration, setting data to display, that should be fairly easy.

    I would start from here ...

    Code:
    Symbol CS = B.1
    Symbol WR = B.2
    Symbol RD = B.3
    Symbol TX = B.4
    
    #Macro CMD_XXX( bits )
      w0 = bits
      Gosub Send
    #EndMacro
    
    #Macro CMD_WRITE( adr, dat )
      ; Data : %101aaaaadddd
      CMD_XXX( %101 * 32 | adr * 16 | dat )
    #EndMacro
    
    #Macro CMD_DIGIT( adr, dat )
      ; Data : %101aaaaadddd
      w0 = dat // 10 
      CMD_XXX( %101 * 32 | adr * 16 | w0 )
    #EndMacro
    
    #Macro SYS_DIS
      ; Data : %10000000000X
      CMD_XXX( %100000000000 )
    #EndMacro
    
    #Macro SYS_EN
      ; Data : %10000000001X
      CMD_XXX( %100000000010 )
    #EndMacro
    
    #Macro LCD_OFF
      ; Data : %10000000010X
      CMD_XXX( %100000000100 )
    #EndMacro
    
    #Macro LCD_ON
      ; Data : %10000000011X
      CMD_XXX( %100000000110 )
    #EndMacro
    
    #Macro TIMER_DIS
      ; Data : %10000000100X
      CMD_XXX( %100000001000 )
    #EndMacro
    
    #Macro WDT_DIS
      ; Data : %10000000101X
      CMD_XXX( %100000001010 )
    #EndMacro
    
    #Macro TIMER_EN
      ; Data : %10000000110X
      CMD_XXX( %100000001100 )
    #EndMacro
    
    #Macro WDT_EN
      ; Data : %10000000111X
      CMD_XXX( %100000001110 )
    #EndMacro
    
    #Macro TONE_OFF
      ; Data : %10000001000X
      CMD_XXX( %100000010000 )
    #EndMacro
    
    #Macro TONE_ON
      ; Data : %10000001001X
      CMD_XXX( %100000010010 )
    #EndMacro
    
    #Macro CLR_TIMER
      ; Data : %10000011XXXX
      CMD_XXX( %100000110000 )
    #EndMacro
    
    #Macro CLR_WDT
      ; Data : %100000111XXX
      CMD_XXX( %100000111000 )
    #EndMacro
    
    #Macro XTAL_32K
      ; Data : %100000101XXX
      CMD_XXX( %100000101000 )
    #EndMacro
    
    #Macro RC_256K
      ; Data : %100000110XXX
      CMD_XXX( %100000110000 )
    #EndMacro
    
    #Macro EXT_256K
      ; Data : %100000111XXX
      CMD_XXX( %100000111000 )
    #EndMacro
    
    #Macro BIAS_HALF_2
      ; Data : %1000010abX0X
      CMD_XXX( %100001000000 )
    #EndMacro
    
    #Macro BIAS_HALF_3
      ; Data : %1000010abX0X
      CMD_XXX( %100001001000 )
    #EndMacro
    
    #Macro BIAS_HALF_4
      ; Data : %1000010abX0X
      CMD_XXX( %100001010000 )
    #EndMacro
    
    #Macro BIAS_THIRD_2
      ; Data : %1000010abX1X
      CMD_XXX( %100001000010 )
    #EndMacro
    
    #Macro BIAS_THIRD_3
      ; Data : %1000010abX1X
      CMD_XXX( %100001001010 )
    #EndMacro
    
    #Macro BIAS_THIRD_4
      ; Data : %1000010abX1X
      CMD_XXX( %100001010010 )
    #EndMacro
    
    #Macro TONE_4K
      ; Data : %100010XXXXXX
      CMD_XXX( %100010000000 )
    #EndMacro
    
    #Macro TONE_2K
      ; Data : %100011XXXXXX
      CMD_XXX( %100011000000 )
    #EndMacro
    
    #Macro IRQ_DIS
      ; Data : %100100X0XXXX
      CMD_XXX( %100100000000 )
    #EndMacro
    
    #Macro IRQ_EN
      ; Data : %100100X1XXXX
      CMD_XXX( %100100010000 )
    #EndMacro
    
    #Macro F1
      ; Data : %100101XXfffX
      CMD_XXX( %100101000000 )
    #EndMacro
    
    #Macro F2
      ; Data : %100101XXfffX
      CMD_XXX( %100101000010 )
    #EndMacro
    
    #Macro F4
      ; Data : %100101XXfffX
      CMD_XXX( %100101000100 )
    #EndMacro
    
    #Macro F8
      ; Data : %100101XXfffX
      CMD_XXX( %100101000110 )
    #EndMacro
    
    #Macro F16
      ; Data : %100101XXfffX
      CMD_XXX( %100101001000 )
    #EndMacro
    
    #Macro F32
      ; Data : %100101XXfffX
      CMD_XXX( %100101001010 )
    #EndMacro
    
    #Macro F64
      ; Data : %100101XXfffX
      CMD_XXX( %100101001100 )
    #EndMacro
    
    #Macro F128
      ; Data : %100101XXfffX
      CMD_XXX( %100101001110 )
    #EndMacro
    
    #Macro TEST
      ; Data : %10011100000X
      CMD_XXX( %100111000000 )
    #EndMacro
    
    #Macro NORMAL
      ; Data : %10011100011X
      CMD_XXX( %100111000110 )
    #EndMacro
    
    Init:
      ;                      Datasheet      C-Version
      SYS_EN            ; %100-0000-0001-X    0x02 
      RC_256K           ; %100-0001-10XX-X    0x30
      BIAS_THIRD_4      ; %100-0010-10X1-X    0x52
      LCD_ON            ; %100-0000-0011-X    0x06
    
    Main:
      CMD_WRITE( 0, 9 ) ; %101-aaaa-addd-d
      CMD_WRITE( 1, 8 )
      CMD_WRITE( 2, 7 )
      CMD_WRITE( 3, 6 )
      CMD_WRITE( 4, 5 )
      CMD_WRITE( 5, 4 )
      CMD_WRITE( 6, 3 )
      CMD_WRITE( 7, 2 )
      CMD_WRITE( 8, 1 )
    
      Pause 5000
    
    MainLoop:
      w2 = 12345
      Do
        CMD_DIGIT( 0, w2 / 10000 )
        CMD_DIGIT( 1, w2 / 1000  )
        CMD_DIGIT( 2, w2 / 100   )
        CMD_DIGIT( 3, w2 / 10    )
        CMD_DIGIT( 4, w2         )
        Pause 1000
        w2 = w2 + 1
      Loop
    
    Send:
      High CS
      High WR
      High RD
      Low  CS
      ; Maximum of 16 bits output
      b2 = 16
      ; Left align bits
      Do While w0 < $8000
        w0 = w0 * 2
        b2 = b2 - 1
      Loop
      ; Command in top three bits
      b3 = w0 / $2000
      Select Case b3
        Case %100, %101 ;Command, Write
          Do
            Low  WR
            If w0 >= $8000 Then
              High TX
            Else
              Low  TX
            End If
            w0 = w0 * 2
            High WR
            b2 = b2 - 1
          Loop while b2 > 0
      End Select
      High CS
      Return
    That doesn't include all the commands supported and the actual 'Main:' code is just guessing.

    Updated to include all commands, and initialisation as per the C example code.

    All untested, and particularly not sure the digits handling code will be right, but something like that.
    Last edited by hippy; 02-07-2018 at 19:29. Reason: Fuller example

  7. #7

    Default

    Thanks everyone ,a lot of time and effort

    Tim

Bookmarks

Posting Permissions

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