Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

74hc126 (12 pins to 8 pin connector)

Status
Not open for further replies.
check your wiring. it looks like the third row is not being driven high. It looks like you're saying the third row (up or down) horizontally is not lighting. If LEDs above and below light up, that means your column driver is ok. If they work to the left and right, that means the row driver is ok. If it's the row (3rd up or down) horizontally, that looks like you are not sourcing current to that row. If the ones on the left one light (ie, first second and/or third) but not the ones on the right, that means the break is between LEDs. If the whole row is out, that's your voltage source, transistor, current limit resistor, output from micro, base resistor, or port configuration pin. With the row outputs set to one like you are doing, you can put the voltmeter on the junction between the micro and the base resistor. make sure there is a '1' (4-5V). if there is, move down the circuit to the base side of the resistor, which should be at .7V (above the emitter if using a NPN). note: compare voltage reading to the base of a working row. If you see the base at the proper voltage, move to the current limiting resistor, etc...

additional note: if you followed your above schematic, base of on transistor should be at 3.4v, emitter will be at 2.7V, and bottom transistor collector at .7V. The output of your micro pin needs to be somewhat above 3.4v for the transistor to turn on.
 
Wow, this is wierd.
Wirings are all ok. I checked and replaced one col trnasitor because there was light on that col even though there was no input , now it is ok

I checked with voltmeter - from micro and base of resistors when i want second 4 rows to be one (00001111) and loop for all colums with 1ms delay. So it light up only 00001011. Voltage between bases of 2 last ones, and 4th from the bottom are ok, 3.8 or so. BUT between base od 3th row (that should light up that row, and it doesnt) is 0V!!!

Hm...but when i put to rows 00011111, everything is ok, and first 5 voltages on base are 3.8V, and the other ones are 0V. So i dont understand, you see everything looks like it work, and it does for some combinations, but for that 00001111 it doesnt
 
Last edited:
if you think your circuit is wired correctly, you can check it manually. Tie you uC reset line low to hold the micro in reset, so it's outputs will be in tristate mode (hi z, or off). Now, you can tie each base resistor (where it ties to the micro) of the row drivers to 5v and one of the column transistor's collector to ground, and see that the one LED that is decoded by that row/column turns on (full bright). Do this for each row grounding the first column, then release that ground and ground the next column's transistor collector, and cycle thru the rows. Do this for each row/column combination and check to see that they all come on as they're supposed to.

You should really try to drive the column transistors the same way, but since it's tied to the decoder and not directly to the micro, then it becomes more difficult. Also, putting the uC outputs in hi z mode, the inputs to the decoder will float so you don't know if it's going to try to turn on an output, but you can pull the four address lines low to address the first column only.

You might need to post your schematic.... like, what did you do with the enable lines on the decoder? If you tie them hi or low to enable through a resistor instead of straight to power/ground, you can disable them by pulling them to the opposite rail. But if you tie them straight to the power lines, then you can't. post your schematic please.
 
I will try what you said later, thank you

Here is the schematic. I have power switch, voltage regulators, etc, but it is not necassry for this

I hope you will understand what i have drew :)

i have some other wierd problem with col 4. When i put connectors to uC, that row light up but very dim. I have replaced transistor in that row, than everything was ok, and now after a few hours of playing with it, here it is the problem again. It is not a big deal to replace it but it is if it happen to often :S

Data pins 1-4 are connected to second port of uC

View attachment 68805
View attachment 68806
View attachment 68807
 
Last edited:
Here is the video of it not working

https://youtu.be/-Hk7ztjkGg0

First it work with second and third col of letter A, then, after 2 mins of working it started to act like in video..

Could it be a break of isolation in transistors? But why? It is on 9V, but through 10K resistor (middle of 20K pot)

EDIT: i put a full COL of leds after A to show you that it work properly when ROW=255 (11111111), and in some combinations like in A, it doesnt... (for first and forth col of A it is OK, only on the 7 or 8 col it doesnt light up, you will see in video..)

EDIT2: maybe we are getting closer. Look at this: https://www.youtube.com/watch?v=ALNaWsLVb1I&feature=youtu.be
In first video, it was 12V battery, in this it is also 12V but broken one, so it gives only 7V. And now it is better. What could it be i dont understand? :D
 
Last edited:
on your video I see 'ghosting', LEDs lit around your LEDs that should be lit, that's because you're not disabling the display before changing data/column drive. I would suggest you write your row port to 000000000, change column address, then write new data to row port.
 
Yep, thank you, i have done it and now that problem is gone

But this problem remains: after a few cycles of A, it starts to blink some leds insted of just turn on and switch to another position. And some cols of A even stop to be on, so only first and forth col are displayed and moving.

Looks like some combination of rows are more "stable". How it can be? :(

EDIT: i told you, this is acting wierd and i cant get 00001111 to work, it was 00001011. Thats because 3 and 5 wire were barely connected at the top, and i could see it :D

But with transistors there is some problem, because forth row started to be half on all the time again. Maybe current is big? 2n3904 can tolerate to max 200mA, and i dont know how much is there..
 
Last edited:
I should think it's now a software bug you are seeing. It might be a current thing, but you should only be driving 160mA max (20mA x 8), and you are not on all the time. You are running from battery? Can your battery run that long at that drain and still maintain voltage?

I guess some of your troubles could stem from the way you are driving your Row LEDs non-conventionally using an npn as a high side driver. Your base voltage needs to be higher than normal. If it is only marginal, this could account for the instability of the row combination.
 
Last edited:
No, no, row combinations are ok now :)
The problem was 3 and 5 row was conected together so i couldnt get 00001111, only 00011111 or 00001011 and so on..

I am driving that all from lipo battery, and it can drained in 10mins (it is battery for rc helicopters and so), 3000mAh, 12V

One thing i changed to is that there is no more 7809 for leds and 7805. Only one 7805, and i dont understand why but brightness is the same for leds. Also one pot was wrong so i replaced it

I dont know if this is a problem but when i have my display powered and not conected to uC and conected to battery, first col is on, but only for some rows. I tried to replace transistors and resistros in that row but its the same. When i drag my hand through everything at bottom, it shows some other leds... :D
 
if you don't have a micro plugged in, you'll get random patterns. The first column was on due to an address of zero from your decoder. Dragging your hand on it causes static to supply random ons and offs. This is not good for the chip on the board (decoder). One thing you can do is tie one enable off through a resistor (to ground for high enable or 5v for a low enable) and use a port pin to enable the display. This way, if the micro is off or not connected, you won't get and stray patterns. Also, you can tie a 10k resistor from each transistor base to it's emitter (ground) to make sure the tranistor is off when you're not driving it on.
 
So i only need to put inhibit not to ground, but through resistor to one pin? And then when i put 1 to that pin, it will turn it on all?
 
no... tie inhibit to 5v through a 10k resistor. Then, when you plug your micro in, have a spare connector pin tie the inhibit to ground, or have a port pin tied to inhibit. Then, drive the inhibit pin low to enable your decoder and turn on your outputs, based on the address going in. When inhibit is tied high, no outputs will be given.
 
Thank you very much, you really helped me out so much !!

Now everything works awesome (no dimm leds, no wierd blinking, nothing), i think it is because there is just one lm7805 for all and not 7809 for LEDs and 7805 for chip

I have to program something cool :) i already managed to write 4 letters and roll them, but i dont know right now how to write something more :D
Also i need to learn how could i put this together with keyboard and then write something to show on my display :)
 
Mike, you are very smart and you halped me a lot, so i want to ask you something.

If i want 8*100 (or around 100) display, i need to connect multiple decoders to "master" decoder, something like here, see: https://www.electro-tech-online.com/custompdfs/2012/11/74HC237.pdf
page 10

So i have on CD4514BE 16 outputs, 4 inputs, inhibit, vss, vdd, and strobe. So i can connect 16 outputs of 7 decoders to LEDs, their inputs together and to Uc, and what pins of these 7 decoders should i put to outputs of "master" (and also the same as others) decoder? I know then that inputs from decoders go to Uc
 
2 to the 7th power is 128, so for something over 64 but 128 or less, you'll need 7 address bits. The lower 4 address bits will go to each of your 4514 decoders. The upper three address bits will go to the master decoder, each output from the master decoder will go to enable one of the 7 lower decoders. Here, you will use an active low decoder, and hook it to the inhibit line of the 4514. So you should use a 74HC138. And a master enable to the master decoder will turn them all off at once (so 7 address plus 1 enable).

Also, when driving this many outputs, it may be easier to use ULN2803 drivers to drive 8 circuits at a time instead of discrete transistors/resistors. Everything is built into the IC package. Of course, they also make multiple transistor packages, but then you'd need external resistors.
 
2 to the 7th power is 128, so for something over 64 but 128 or less, you'll need 7 address bits. The lower 4 address bits will go to each of your 4514 decoders. The upper three address bits will go to the master decoder, each output from the master decoder will go to enable one of the 7 lower decoders. Here, you will use an active low decoder, and hook it to the inhibit line of the 4514. So you should use a 74HC138. And a master enable to the master decoder will turn them all off at once (so 7 address plus 1 enable).

Also, when driving this many outputs, it may be easier to use ULN2803 drivers to drive 8 circuits at a time instead of discrete transistors/resistors. Everything is built into the IC package. Of course, they also make multiple transistor packages, but then you'd need external resistors.

Thank you very much, i have ordered from ebay 20xULN2803, some more decoders and 74HC138, so when it arrives, i will start making new display :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top