max7219 8 digits 7 segment display

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Sergejs
Posts: 146
http://meble-kuchenne.info.pl
Joined: Tue Oct 19, 2021 9:31 am
Has thanked: 74 times
Been thanked: 5 times

max7219 8 digits 7 segment display

Post by Sergejs »

Can it be possible add this display please? It have one MAX7219 and 8 digits of 7 segments. Inputs are DIN, CS, CLK. And power 5V.

BenR
Matrix Staff
Posts: 1901
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 494 times
Been thanked: 668 times

Re: max7219 8 digits 7 segment display

Post by BenR »

Hello,

Thanks for your suggestion yes this should be possible. Do you have a specific board in mind you can link us to just in case it is wired in a specific way.

Sergejs
Posts: 146
Joined: Tue Oct 19, 2021 9:31 am
Has thanked: 74 times
Been thanked: 5 times

Re: max7219 8 digits 7 segment display

Post by Sergejs »

Sorry, I have not yet :(

I got it on aliexpress. But I can not run it now.

BenR
Matrix Staff
Posts: 1901
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 494 times
Been thanked: 668 times

Re: max7219 8 digits 7 segment display

Post by BenR »

Hello,

Can you send us the AliExpress link?

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: max7219 8 digits 7 segment display

Post by mnfisher »

Try the component at viewtopic.php?f=3&t=981&hilit=Max7219 - there was one macro allowed digits to be sent to a seven segment numerical display (setdigit?)

What other control would you like?

jgu1
Posts: 708
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 593 times
Been thanked: 157 times

Re: max7219 8 digits 7 segment display

Post by jgu1 »

Hi MArtin!

Yes you good display, working perfect ;) But I gues that Sergejs is thinking about this :

https://arduinotech.dk/shop/max7219-red ... gKs2PD_BwE

If not, apologize :D

Br Jorgen

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: max7219 8 digits 7 segment display

Post by mnfisher »

Yes - I thought so to - and the library did support the numeric display (albeit in a very limited fashion)

Martin

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: max7219 8 digits 7 segment display

Post by mnfisher »

- and it doesn't work....

Made a small program that outputs in BCD mode - that does work...

Interface is very rudimentary (SetDigit) and there doesn't seem to be a way to clear a digit in BCD mode - there is just use a value of 15...

AutoCS also doesn't seem to work - hence toggling the CS pin (D10) manually in SPITransfer and SPIALll

Use next message attachment..

Tomorrow - I'll do the non BCD mode..

Martin
.

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: max7219 8 digits 7 segment display

Post by mnfisher »

So a little more playing -

I've added a DispNumber and a DispFloat

I've added a DisplayDigit - where the 'character' set allows the individual segments of the display to be set. I've added a set for the digits 0..9 - but if this is all you use then it makes more sense to use the BCD encoding. The display routines use BCD encoding - although it would be possible to keep a record of which digits are in BCD mode and use either output.

It 'should' work for up to 16 daisy-chained devices. I only have one to test.

For some reason - hardware SPI doesn't always work on an Arduino (so at the moment it's using software mode) - I've encountered this before and it will suddenly 'start' working. It might need a small delay after pulling CS low?
BCD Display.fcfx
(37.05 KiB) Downloaded 176 times

BenR
Matrix Staff
Posts: 1901
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 494 times
Been thanked: 668 times

Re: max7219 8 digits 7 segment display

Post by BenR »

Brilliant thanks Martin,
For some reason - hardware SPI doesn't always work on an Arduino
AVR has a rather perculiar setup for SPI. When SPI is enabled if the hardware SS pin if left as an floating input or pulled low then this acts as a trigger to allow the SPI to go into slave mode. When this happens the SPI byte command will wait for a master to drive the clock, which in most cases never comes and therefore causes a hardware lockup.

So if you're using hardware SPI on an AVR you must either pull the SS pin high using an external/internal pullup or use the SS pin as your CS pin or other general purpose output and this way the pin is configured as an output .

A more sane approach is shown on PIC devices where you have a bit in a register controlling Master/Slave functionality.

Post Reply