News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

multiple 7 segment displays

Started by Peter Truman, Dec 22, 2024, 03:24 AM

Previous topic - Next topic

Peter Truman

Hi All - I have a new project which requires I use small 7 segment led displays. The project has 2 forms, form 1 requires 4 sets of 4 digit displays and for 2 requires 8 sets.

So - each display board has 4 x 7 segment displays (8 if you count the dp) plus 3 discrete indicator led's

Each set will be built on a 'plug in' PCB on a main PCB that has a number of M12 PBC mount sockets - there will be a main PIC on the base board that will handle a range of sensing tasks, plus a rotary encoder / menu system.

I'm thinking about how best to drive my 4 digit displays - Each digit will be multiplexed and strobed to display the necessary data.

I've not really been able to identify a low cost IC to handle this for me (Max7219 is A$26 bucks!)

My thinking now is I could use a PCA9535 I/O expander to handle the digits. The main board PIC will fire off an I2C packet to each display board in turn (max 8 display boards) - that would mean the main PIC is pretty busy servicing all 8 I2C signals fast enough to strobe each display. I don't think that approach is going to cut the mustard!

I'm going around in circles a bit with this - now thinking I should add a low cost PIC on each display board - I would just have my main PIC fire off a serial packet (probably SPI) - the PIC on the display board will pick up the packet and then handle the strobing independent of the main board.

Next - it occurs to me - if I'm going to have a PIC on the display board - and all it has to do is handle the 7 segment displays, why not use a higher pin count PIC and do away with the port expander?

I decided I would post the question here and see what more experienced people would suggest!

Many thanks in anticipation

kcsl

Well, hardware costs money, takes board space, increases power requirements and typically pushes up development time, so I always try and reduce the hardware as much as possible. There's also fewer points of failure so less to go wrong.

Most of the time, I can afford the CPU cycles to drive the display via an interrupt routine. But on the odd occasion where I can't, I create a chain of 74HC595's (which have sufficient outputs to drive the 8 segments). You can drive the entire chain with 4 or 5 output pins and you don't get dimming due the multiplexing. The IC's are cheap and easily available. I also like this approach because you can drive any number of digits.
The additional 3 indicator LEDs could be driven by another 595 or just 3 PIC output pins.

Regards,
Joe
There's no room for optimism in software or hardware engineering.

shantanu@india

Hi,
The best way to drive 7-segment common-anode display modules are through 4094 8-way shift registers which can sink current. Reduce the common anode voltage by 1/2 diodes so that you do not need any current limiting resistance between the 4094 outputs & the 7-segment LED. 'Strobe" & "Clock" signals are common & the 4094's are cascaded by data pin. Just 3 pins of the microcontroller are required.
Regards
Shantanu

LeonJ

Quote from: Peter Truman on Dec 22, 2024, 03:24 AMI'm going around in circles a bit with this - now thinking I should add a low cost PIC on each display board - I would just have my main PIC fire off a serial packet (probably SPI) - the PIC on the display board will pick up the packet and then handle the strobing independent of the main board.


Personally, I would go for a 14-pin PIC per display, receiving 7-bit TTL UART display data and 8-bit address for each hard coded slave.


ken_k

#4
CD4094's should cost <$1.00 each, the current available is somewhat limited.

74HC595's are a bit more expensive and have a higher drive current.

Lots of 7-segment display boards are sold on ebay.


Peter Truman

Decided to go with a PIC to handle the display board - I'm using an 18F2525 (because I have a draw full of them) - The main board PIC will feed a SN74HC non inverting buffer, with each output enable pin controlled by the main PIC - that way the display board only needs 3 pins - pwr, ground and signal (since I will only enable 1 output at a time whatever data is on the signal line will be for that display board). The advantage there is that the display board ID is dependent upon which socket it is plugged into - rather than having to give it a hard coded ID

My plan is to just do a 'round robin' of updating each display board in turn about every few hundred ms and let the display PIC handle the rest.

The purpose of this project is to do nothing with the data other than display the various values on the 7 segment display boards (one per sensor). There will be a rotary encoder which will be used to scale the value according to what kind of sensor is plugged in (I will deal with one input at a time via a menu system). The actual data will just be passed on to the main controller (which doesn't have an HMI and could be 5-100+ meters away). So that users can see the value where the sensor is connected to the system.

Thanks for everyone's help with this. Much appreciated


Peter Truman

I can't believe that is so cheap! Not really usable for me though since this is a commercial product. I tried to convince the guy to let me use I2C Backlit LCD's but he is fixed on the 'retro' look of 7 seg displays. To be fait, these will be used in circumstances where they will need to be readable at distance (maybe several meters) and I don't think that is really doable with LCDs - we will see, I've finished the display design and onto the controller now (seperate board)

Thanks for the suggestion though.

normnet

Presently in development these 4" LEDs are what I am using as per a suggestion from this group.

ken_k

Quote from: Peter Truman on Dec 31, 2024, 11:19 PMI tried to convince the guy to let me use I2C Backlit LCD's but he is fixed on the 'retro' look of 7 seg displays. To be fair, these will be used in circumstances where they will need to be readable at distance.
Happy New Year to all that frequent this forum.

Hi Peter
I also love the 'retro' look of 7 seg displays. I wish I had used a combination of 7 and 14 seg displays on my tube tester.



Peter Truman

This is how the display looks at the moment (The holes accommodate M12 connectors from the base board) - this setup is IMHO much more complex than it needs to be - each set of 4 7 seg displays (plus 2 leds) is controlled by it's own PIC (18F47k22) so there are 4 sets of programming pins.

I'm communicating from the base board with a 1 way serial SPI sort of arrangement (1 chip select for each PIC plus a clock and data line) once a value is received each PIC will just look after it's own display - leaving the main control PIC (on the base board) free to do whatever, just firing off a new value to each display as required.

It would have been much easier with 4 x I2C backlit LCD  :-\ but, at the end of the day it should look ok (and the displays do need to be read from a distance)