Shop OBEX P1 Docs P2 Docs Learn Events
BCD to 7 segment display — Parallax Forums

BCD to 7 segment display

VbGuruVbGuru Posts: 35
edited 2008-01-21 06:42 in BASIC Stamp
Looking for a bit of help...

·I have· a cd74hc4511·which is a BCD to 7 Segment display chip, and i was wondering what the code would look like to use it correctly.

I am using a Basic Stamp Homework Board and the BCD chip (http://www-s.ti.com/sc/ds/cd74hc4511.pdf) What pins should it be hooked to, does it matter?

Thank you

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-17 22:26
    Hello,

    You can connect the BCD inputs directly to a group of pins such as P0-P3. Then you could connect the /LE to P4. /LT is for Lamp Test so you don't need that and /BL is for blanking...Again, for a single unit you won't need it. Set DIRA to %1111 and use OUTA to send a valid BCD character to P0-P3, for example (OUTA = %0001 for 1) then pulse /LE low to latch the new value. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • VbGuruVbGuru Posts: 35
    edited 2008-01-19 23:05
    Thank you for your Information it was exactly what I needed.
    ·I have set it up and written a short program to get the display counting, but I am not getting the results that I should be getting. ·I have my program count from 0-9. It flashes on to a solid 8 then flickers 4-8 and stops. I can’t figure out why it doesn’t start at 1. Any ideas? I played with the pause going from 2-2000 and it didn’t make any difference.
    ·
    ·
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    DIRA = %1111
    Start:
    LOW 4
    OUTA = %0000
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %0001
    HIGH 4
    PAUSE 200
    LOW 4
    OUTA = %0010
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %0011
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %0100
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %0101
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %0110
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %0111
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %1000
    HIGH· 4
    PAUSE 200
    LOW 4
    OUTA = %1001
    HIGH· 4
    PAUSE 200
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-20 08:05
    What are your connections?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • VbGuruVbGuru Posts: 35
    edited 2008-01-20 08:47
    Bs2 to ic
    p0-d0
    p1-d1
    p2-d2
    p3-d3
    p4-le


    the connections from the ic to my display are what the specs say. output a to input a... and so forth.
  • VbGuruVbGuru Posts: 35
    edited 2008-01-20 17:49
    I think i found something.... I shuffled the code around so that 0-3 were after 4-9 and the display runs the 4-9 but then flashes the solid 8 for the rest.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-20 21:35
    If you have updated code you should attach it (not paste) so we can see what is happening.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • VbGuruVbGuru Posts: 35
    edited 2008-01-20 22:02
    I jsut cut

    low 4
    OUTA = %XXXX
    HIGH 4
    PAUSE 200


    for each of the numbers and pasted them at the end of the code instead of the start. I will attach it next time, forgot.
  • VbGuruVbGuru Posts: 35
    edited 2008-01-21 06:42
    I got it working. I started completely over. I got new batteries, new display and it works. I think that something is wrong with the old one, I put it back in and I get the same problems but with the new one it works perfectly.
    ·
    ·
    Thank you for all of your help.


    also my latest test code for the 7-seg is attached. its not pretty but it does what was needed.
Sign In or Register to comment.