Menu

Sure Electronics - "SPI-like&quot...

Help
Grant
2010-10-20
2013-05-30
  • Grant

    Grant - 2010-10-20

    Hi All,

    Anyone used one one of the Sure Electronics display boards with the 'SPI-like' interface before?  http://www.sureelectronics.net/goods.php?id=721.

    I know I'm on a bit of a fishing expedition here, but I'm really stuck - I've spent 20+ hours trying to figure it out so far. I've fried 2 displays so far (at $25+ a pop it's not a cheap way to figure it out!)

    If anyone has used these with any success, then I'd be grateful for any assistance you can give me!

    Thanks,

    Grant

     
  • Grant

    Grant - 2010-10-20

    Murphy's Law!!!!! Absolutely typical - I post the call for help and within 2 hours I've managed to find the answer!

    Here's the code for anyone else who wants to use Sure Electronics diplays in a project. This code will display the digits 0 thru 9, then each segment of the display individually.

    ;Chip Settings
    #chip 16F690,4
    #config FCMEN=OFF, IESO=OFF, BOR=OFF, CPD=OFF, CP=OFF, MCLRE=OFF, PWRTE=OFF, WDT=OFF, OSC=INTRC_OSC_NOCLKOUT
    ;Defines (Constants)
    #define CLK PortA.1
    #define DATA PortA.0
    ;Variables
    Dim DispVal As Byte
    ;Data tables
    Table DisplayValue
     0x3f
     0x06
     0x5b
     0x4f
     0x66
     0x6d
     0x7d
     0x07
     0x7f
     0x6f
     0x01
     0x02
     0x04
     0x08
     0x10
     0x20
     0x40
     0x80
    End Table
    'Pin Direction
    DIR PORTA.3 IN
    GoSub ScreenRefresh
    Main:
    If PortA.3 = On Then
        For i = 1 to 18
            ReadTable DisplayValue, i, DispVal
    
            for j = 1 To 8
                Rotate DispVal Left Simple
                CLK = 0
                DATA = DispVal.0
                CLK = 1
            Next
            Wait 1 s
        Next
        GoSub ScreenRefresh
    End If
    Goto Main
    

    Cheers,

    Grant

     
  • Grant

    Grant - 2010-10-20

    Hmmm…. do the bbcodes for  not allow formatting? Here it is again.

    ;Chip Settings
    #chip 16F690,4
    #config FCMEN=OFF, IESO=OFF, BOR=OFF, CPD=OFF, CP=OFF, MCLRE=OFF, PWRTE=OFF, WDT=OFF, OSC=INTRC_OSC_NOCLKOUT

    ;Defines (Constants)
    #define CLK PortA.1
    #define DATA PortA.0

    ;Variables
    Dim DispVal As Byte

    ;Data tables
    Table DisplayValue
    0x3f
    0x06
    0x5b
    0x4f
    0x66
    0x6d
    0x7d
    0x07
    0x7f
    0x6f
    0x01
    0x02
    0x04
    0x08
    0x10
    0x20
    0x40
    0x80
    End Table

    'Pin Direction
    DIR PORTA.3 IN
    GoSub ScreenRefresh
    Main:
    If PortA.3 = On Then
    For i = 1 to 18
    ReadTable DisplayValue, i, DispVal

    for j = 1 To 8
    Rotate DispVal Left Simple
    CLK = 0
    DATA = DispVal.0
    CLK = 1
    Next
    Wait 1 s
    Next
    GoSub ScreenRefresh
    End If
    Goto Main

    Grant

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.