Go Down

Topic: Use HT16K33 with common anodes (Read 899 times) previous topic - next topic

jojocaster

Hi guys,

I'm currently using a bunch of MAX7219 to control 7 segment displays.
However now I'm in the need of controlling 16 segments displays, and the amount of displays I need makes sticking to MAX7219 a bit messy (30x 7 digits in total)

So here's my question: how hard would it be to use the HT16K33 with common anode displays ?
After a bit of research, I figured out it wasn't impossible but would require a different approach code-wise - and that's the tricky bit for me right now. How different would it be ?

I was also thinking that I could potentially use it to manage my 16 segments, using 2 anodes per display each controlling 8 different segments. Can't see why it wouldn't work so far, but I need to figure out the code logic first :D

Thanks, I hope I've been clear enough :)


jojocaster

Not sure I follow.

I have to use both 16 segments and 8 segments. At the moment, I'm using few MAX7219 daisy-chained to control my 8 segments CC. And as I have also a HT16K33, I could use it to take care of the 16seg.

However it gets messier if I want to stack them on a PCB. Hence my question about using a HT16K33 with anode displays. If not possible I'll stick to my first solution, but that's why I'm here, to ask if using the HT16K33 to control CA (c. anode) displays, allowing me to control up to 16 digits with 1 chip - making the whole thing cleaner.

But maybe I missed something ? Are you trying to show me that the code needs to take care of segments rather than digits ?

ieee488

I have to use both 16 segments and 8 segments.
That's not what you wrote.


Again, decide which approach you want to take and follow it.

I am not sure what is the problem. There are tutorials for both approach.



jojocaster

#4
Apr 16, 2018, 04:56 pm Last Edit: Apr 16, 2018, 05:05 pm by jojocaster
Ok, so you don't read my posts, fair enough.

I want to control 5x 2dig 8 segments and 3x 1dig 16segments all together.
I'm thinking about using the HT16K33 with Common Anodes instead of Cathodes because the code logic would be easier to manage, and it would be neater on a PCB. Also I wouldn't have to use both MAX7219 AND HT16K33, only the HT.

So I would be able to control 10x 7segments via their anode, and on top of that I was thinking managing the 3x 16segment using 2 digit Pins from the HT16K33 per screen and splitting their segments across 2 pins (since the HT16K33 accepts 8 cathodes and 16 anodes).

My question is -> Does that sounds possible to you, and if so, can you please explain me what differences the code would need in order to make it work.

Basically I'm trying to use as less chips as possible in order to save space, cables, money and and logic when I'll make my PCB. If that's too complicated, that's fine, I just thought having different ideas/opinions could be useful.

Cheers.

ieee488

Ok, so you don't read my posts, fair enough.

I read your posts, but you were not clear on exactly what you were after.

You wrote it as THIS or THAT not THIS and THAT.
There is a difference.

If you don't have enough pins for BOTH, then you have to take the approach that lets you use BOTH.
Does that make sense?






jojocaster

#6
Apr 16, 2018, 06:12 pm Last Edit: Apr 16, 2018, 06:13 pm by jojocaster
Fine, let's agree on misunderstanding :)

It does make sense. Using both MAX7219 and HT16K33 would sort me out and allow me to use both.
But that's not really what I need to know, this is just to give a bit of context.

I still don't see any real answer to my question which is "can I use common anode displays with a HT16K33" and "if so, in what way would the code be impacted".

As far as I can see, you're just telling me to use whatever method works for me.
I do appreciate the time you're spending to answer me, but I don't think we're on the same page :)

ieee488

I still don't see any real answer to my question which is "can I use common anode displays with a HT16K33" and "if so, in what way would the code be impacted".

https://forums.adafruit.com/viewtopic.php?f=47&t=38799


.

PaulRB

#8
Apr 16, 2018, 10:56 pm Last Edit: Apr 16, 2018, 11:03 pm by PaulRB
Here's what I think. Please put me straight if I've got this wrong.

7-seg displays: up to 16 digits of either common cathode or common anode can be driven, but not a mix of the two types on the same ht16k33 chip. Using common anode is trickier from a software point of view, because the bits controlling the segments of a single digit will be spread over 8 of the chip's internal registers. So some bit manipulation will be required. For common cathode displays, all 8 bits controlling the 8 segments will be in the same internal register.

16-seg displays: up to 8 "digits" can be used but they must be common cathode. I can't see any easy way to drive common anode 16-seg displays with this chip, except with a lot of extra external circuitry, which I think the OP wants to avoid.

So in summary I would say yes, you can use ht16k33 to drive your common anode 7-seg displays, but your 16-seg displays must be common cathode.

ieee488

He writes he wants both (reply #2)


No idea what is going on, so you'll have to do the mind reading.

.

PaulRB

Agreed, reply #2 is confused and confusing!

It should be possible to drive a combination of both 7-seg and 16-seg on the same ht16k33 chip. For example, 4 "digits" of 16-seg plus 8 digits of 7-seg. But they would all have to be common cathode in that case.

jojocaster

Alright, apologies for the confusing 2nd post, I obviously haven't been very clear.
I still don't think that's a reason to be bitter, but anyway, who cares :)

I got a few tips from StackOverflow which helped me figuring out a better way of doing it.

All screens are common cathode (as I had a bunch waiting already), and all plugged to the HT16K33.
The 16 segments displays are connected normally (cathodes on C pins, 16 anodes on A pins), and the 7 segments displays are connected as such:

Digit 1 / Digit 2 : C1.
Segments 1-8 / 8-18: A1-A15.

So basically I'm now able to control 2 (7segments) digits per cathode pin.

I had a bit of a struggle understanding how I could manage them like that, but after a few trials and error which consisted in looping through all segments one by one (shifting bits in loops), I'm now - almost - able to do whatever I want with them.

My problem was that I couldn't see how to control 5x 2digits 7segments and a couple of 16segments at the same time, having only 8 cathodes pins on the HT16K33. The answer is just to plug both digits on on cathode pin, and then manipulate the segments accordingly in the code ...

Thanks for trying, and next time I'll try to be a bit less confusing.






Go Up