Shop OBEX P1 Docs P2 Docs Learn Events
MC14489BPE LED driver with SX — Parallax Forums

MC14489BPE LED driver with SX

micronewbmicronewb Posts: 20
edited 2009-02-28 19:26 in General Discussion
I am very new to the SX chip and somewhat new to microcontrollers in general so bare with me.· I am trying to make a digital display to output voltage, current and capacity of a battery pack.· I am using 2 MC14489BPE LED drivers to drive 9 7 seg LEDs for the display.· I am trying to get the first one to work, and I am getting sporatic results.· Sometimes I will run my code and it will work, then I will hit reset and the display blanks.· More often I will run the same code and nothing is displayed, then after disconnecting and reconnecting the power the display will appear.· If that is repeated the display returns to blank. Any ideas why I this is happening?


'
' Program Description
'
'Making a digital display with 3 groups of 3 digits of 7 segment LEDs
'
' Device Settings
'
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000

'
' IO Pins
'
Din···PIN·RA.0 output
CLK···PIN·RA.1 output
Enable·PIN·RA.2 output

' =========================================================================
· PROGRAM Start
' =========================================================================
Pgm_ID:
· DATA· "SX/B Template", 0

'
' Program Code
'
Start:
·HIGH Enable·
·LOW· CLK
Main:

··LOW Enable
··SHIFTOUT Din,CLK, MSBFIRST,%10001110
··SHIFTOUT Din,CLK,·MSBFIRST,$00001001
··SHIFTOUT Din,CLK, MSBFIRST,%00001001
··HIGH Enable

· GOTO Main

http://www.datasheet123.com/291272/MC14489BPE.html

It's not letting me upload the datasheet so here is a link.· I am using an Rx value of 1Kohm.·Thanks for the help.

Comments

  • micronewbmicronewb Posts: 20
    edited 2009-02-27 15:17
    On the second shiftout that is not a $ it is a % on the code I am actually compiling sorry typing mishap.
  • BeanBean Posts: 8,129
    edited 2009-02-27 15:41
    The SX is very fast. You may need a small pause between each pin change.

    Try this:

    ' -------------------------------------------------------------------------
    ' Program Description
    ' -------------------------------------------------------------------------
    'Making a digital display with 3 groups of 3 digits of 7 segment LEDs 
    ' -------------------------------------------------------------------------
    ' Device Settings
    ' -------------------------------------------------------------------------
    DEVICE          SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
    FREQ            4_000_000
    
    ' -------------------------------------------------------------------------
    ' IO Pins
    ' -------------------------------------------------------------------------
    Din   PIN RA.0 output
    CLK   PIN RA.1 output
    Enable PIN RA.2 output
     
    ' =========================================================================
      PROGRAM Start
    ' =========================================================================
    
    ' -------------------------------------------------------------------------
    ' Program Code
    ' -------------------------------------------------------------------------
    Start:
     HIGH Enable  
      PAUSEUS 10
      LOW  CLK
      PAUSEUS 10
    Main:
      LOW Enable
      PAUSEUS 10
      SHIFTOUT Din,CLK, MSBFIRST,%10001110
      SHIFTOUT Din,CLK, MSBFIRST,%00001001
      SHIFTOUT Din,CLK, MSBFIRST,%00001001
      HIGH Enable 
      
      PAUSE 100 ' I don't know about looping really fast...
     
      GOTO Main
    



    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...



    Post Edited (Bean (Hitt Consulting)) : 2/27/2009 3:48:03 PM GMT
  • micronewbmicronewb Posts: 20
    edited 2009-02-28 19:26
    Thanks for the help
Sign In or Register to comment.