Posted: Fri Jan 11, 2008 9:19 am Post subject: 7-segment decoder display interfacing
On my breadboard I have a CD4055 chip connected to a single 7-segment decoder display. How do I interface it on the computer so whenever I press a number in turing, the number comes up on the 7-segment display? Thanks!
Sponsor Sponsor
Tony
Posted: Fri Jan 11, 2008 10:30 am Post subject: RE:7-segment decoder display interfacing
in Turing, a common hardware interface is done through a parallel port, using parallelput command (I think). You should read the documentation in the Help files, it could be confusing. You can then send a signal to the hardware.
You would have to either tweak the hardware to interpret your signal, or figure out what kind of input the hardware is expecting.
Posted: Fri Jan 11, 2008 3:54 pm Post subject: Re: 7-segment decoder display interfacing
I have tried to use the parallelput command but whenever I do this:
Parallelput (255)
the entire 7-segment decoder lights up. However, if I put any other value for parallelput, then the entire 7-segment still lights up but gets dimmer. I couldent get the value 1 or anthing to appear on the 7-segment using turing. Any suggestions?
Tony
Posted: Fri Jan 11, 2008 4:03 pm Post subject: RE:7-segment decoder display interfacing
find documentation for the 7-segment decoder. Or ask someone who knows more about this particular device. This might be a problem outside of Turing.
Posted: Fri Jan 11, 2008 7:35 pm Post subject: Re: 7-segment decoder display interfacing
You've tried every other value?
If you haven't then I'd make a simple loop (with a delay) that will increment from 1 to 255 and write the number to the port, then let it run and watch it, and see for sure.
But, yes, if you can find a pdf for it, it will make things alot easier.
Also the reason your seeing it get brighter and fainter, is that its probably being powered from the parallel port. The parallel port works by setting the data pins high, or low.
High means it is raised to a higher voltage, and low means nothing is there.
When you send it 255 as the value, that means that all 8 pins are being set high (so it will have a lot more power), if you send it a value of 0 that means that no pins will be set high.
It could be that each segment corresponds to a bit, this would explain that when you set it to 255 all the lights light up.
The loop would be your best bet.
Keep in mind your going to probably have to set individual bits
code:
\1/
_
might be 32 -> |_| <- 2
16 -> |_| <- 4
/8\
and I'd assume the middle would be 64
however note that my numbering is arbitrary, you'll have to figure out what yours really is.
If your numbering is like this, then for a 1, you'd write
parallelput(6);
for 2 you'd write 1+2+64+16+8
parallelput(92);
for 3 you'd write 1+2+64+4+8
parallelput(79);
etc....
hopefully you'll be able to make sense out of this.
octopi
Posted: Fri Jan 11, 2008 7:41 pm Post subject: Re: 7-segment decoder display interfacing
I was just looking up the chip number you mentioned, and it appears that it should handle everything for you, so in this case you'd write just whatever number you want to the parallelport
parallelput(1) should display 1
victor15
Posted: Sat Jan 12, 2008 3:45 pm Post subject: Re: 7-segment decoder display interfacing
When i tried parallelput (1), the entire 7-segment decoder display turned on but extremely dim. I just cant get the digit one to pop up on the display. I also tried this code:
loop
for i: 1..255
parallelput (i)
end for
end loop
When i did the code above, the entire 7-segment display just turns entirely on and off. Any suggestions on how to fix this? I am also using the CD4055 chip connected to my display. Thanks!
OneOffDriveByPoster
Posted: Sat Jan 12, 2008 5:16 pm Post subject: Re: 7-segment decoder display interfacing
How did you connect the port to the chip? (Which pins to which.) That might be useful to know.
Sponsor Sponsor
Tony
Posted: Sat Jan 12, 2008 5:17 pm Post subject: Re: 7-segment decoder display interfacing
victor15 @ Sat Jan 12, 2008 3:45 pm wrote:
When i tried parallelput (1), the entire 7-segment decoder display turned on but extremely dim.
This just doesn't seem right. Are you sure that everything is connected correctly?
Posted: Sat Jan 12, 2008 5:42 pm Post subject: Re: 7-segment decoder display interfacing
Heres how I connected it:
On the CD4055 chip, pins 2,3,4,5 connects to pins 2,3,4,5 on the ribbon cable
and pins 9,10,11,12,13,14,15 on the chip connects to the 7-segment display.
Also, after I connected the chip to the 7-segment display, I turned on the power on my breadboard and the entire 7-segment turned on so, I know the circuit on my breadboard works. Any suggestions?
octopi
Posted: Sat Jan 12, 2008 6:58 pm Post subject: Re: 7-segment decoder display interfacing
how does the ribbon cable connect to the parallel port?
Shouldn't there be atleast one connection to the computers ground, so that it knows when its high or low?
Ground would be pin 18-25 on the 25pin parallel port.
victor15
Posted: Sat Jan 12, 2008 7:48 pm Post subject: Re: 7-segment decoder display interfacing
Yes I also connected one end of a loose wire to pin 18 of the ribbon cable and the other end to the negative end of the breadboard. Still need help. Thanks!
OneOffDriveByPoster
Posted: Sat Jan 12, 2008 10:08 pm Post subject: Re: 7-segment decoder display interfacing
Try connecting pin 9 on the parallel port to pin 16 on the chip and pin 7 and 8 on the chip to the negative bar (where you connected pin 18 of the the parallel port). I hope your LEDs can take 5V... Do use delay(1000) or similar to see the output...
victor15
Posted: Sun Jan 13, 2008 11:06 am Post subject: Re: 7-segment decoder display interfacing
If this does not work then are there any other ways I can try?
OneOffDriveByPoster
Posted: Sun Jan 13, 2008 11:52 am Post subject: Re: 7-segment decoder display interfacing
victor15 @ Sun Jan 13, 2008 11:06 am wrote:
If this does not work then are there any other ways I can try?
Yes. Connect pin 8 of the parallel port to pin 6 of the chip and disconnect everything connected to the common electrode of the 7-segment display and connect pin 0 of the chip to the common electrode instead. Do go through all of 0 to 255. Might help to jump to 64 or 128 or 192 and start from there.