Page 1 of 1

SPI/Max7219

Posted: Sun Aug 26, 2012 5:38 pm
by jgu1
Hi All! :D

I have a couble of max 7219 SPI 7 segm. driver. I can see that it use SPI for data input. Can I use the SPI component in FC to drive this chip?
The max7219 have 3 input for serial command Din Load Clock, but the SPI component in FC have only 2 output.

Data for max7219: http://datasheets.maxim-ic.com/en/ds/MA ... AX7221.pdf


Hope someone can explain. :D

Best regard

Jorgen.

Re: SPI/Max7219

Posted: Sun Aug 26, 2012 6:42 pm
by rocket200
jgu1 wrote:Hi All! :D

I have a couble of max 7219 SPI 7 segm. driver. I can see that it use SPI for data input. Can I use the SPI component in FC to drive this chip?
The max7219 have 3 input for serial command Din Load Clock, but the SPI component in FC have only 2 output.

Data for max7219: http://datasheets.maxim-ic.com/en/ds/MA ... AX7221.pdf


Hope someone can explain. :D

Best regard

Jorgen.
The SPI component should work fine with your chip. There is a section in your microcontroller that is specifically designed to do SPI. If you look at a datasheet of your micro, you should find three pins labeled SCK or CLK (clock), MOSI (data out), and MISO (data in). These are the three pins you will hook up to your driver chip. The flowcode SPI component knows to use these outputs automatically, so you don't need to specify the pins. The two pins you see in the connections of the SPI component are not related to SPI you need to do, so just ignore them. I believe they are for an E-block.

Let me know how this works for you,

Henry

Re: SPI/Max7219

Posted: Sun Aug 26, 2012 7:15 pm
by jgu1
Hi Henry! :D

Thank´s for your reply. I will test it a little later. Good explanation.

Best regard

Jorgen

Re: SPI/Max7219

Posted: Sun Aug 26, 2012 7:48 pm
by Enamul
Hello,
This is really a nice chip..Can be easily used with FC spi component as mentioned by Henry. But I want to add something with Henry. Pin1 (DIN) of MAX ic is the data input and should be connected to data signal of SPI and pin13 (clk) of MAX ic will be connected to SCK of SPI..But LOAD(PIN12) pin is very important for this spi communication as this controls communication. But you can use this as normal pic output pin...which should be normally high but before data transmission need to be low and held low during transmission and high after transmission.

Another important issue is data transfer should be 16-bit not normal 8-bit spi communication where Lower 8-bit is data and upper 8-bit is address..there is a table in the datasheet which signifies the address...It's a nice chip to play with..

If you stack in 16-bit spi..please let me know..I have worked with that already.

Re: SPI/Max7219

Posted: Mon Aug 27, 2012 7:30 am
by jgu1
Hi! :D

Thank you to both of you. It's nice that I can use SPI in FC with this Ic. I have no experience with SPI.

For you Enamuel if you have used this Ic with FC, ​​is it possible to get a FC exambel of you?, and further if it is possible get a diagram how you have connected the connection between Pic and Max 7219, I would like attempt try to make a watch, to learn and write to the individual segments.

I do not hope I'm not too demanding :roll:

Thank´s in advance

Best regard

Jorgen

Re: SPI/Max7219

Posted: Mon Aug 27, 2012 12:07 pm
by Enamul
Hi Jorgen,
No, you are not demanding too much. If I would you I will ask for something like that. As this chip has lots of features, I think it would be good for you if you move on step-by-step..I am attaching here a schematic for the whole system although I think you should start with one 7segment first. This chip can be worked with 7-segment data sent from PIC and can also work by itself. So it's your choice. Again about intensity of display you can control it by hardware and also in software..you need to choose. for multiple segments it has scanning circuitry so you don't need to think about that the chip will manage that 8) ..But you need to program that in initialization.

Note: whether you use built-in decoder for numbers to display or data send from PIC, you have to use common cathode 7-segment.

Re: SPI/Max7219

Posted: Mon Aug 27, 2012 5:31 pm
by jgu1
Hi Enamuel! :D

Many thanks for your trouble Enamuel. It was just what I needed, especially just the names of the outputs of Pic and links with Max7219 input.
I'm away for a few days now, but in the moment I get some time I'll play with it and then you get to know whether it is successful or not.

I am very grateful. :D

Best regard

Jorgen

Re: SPI/Max7219

Posted: Sat Dec 08, 2012 9:42 pm
by jgu1
Hi Enamul!

Finally, I had time to play with Max7219. I have connected the 4 digit to the chip.
I have tried to write 1 2 3 4 to display but it will not succeed.

Nor do I understand right properties for SPI. If I choose Software Mode I get more outputs on Pic

Enamul will you please help with adapting my example where I can write 1 2 3 4 to display and check the properties of the outputs. And no C pls. :?:

Thank´s in advance

Jorgen.

Re: SPI/Max7219

Posted: Sat Dec 08, 2012 10:44 pm
by Enamul
Hi Jorgan

I will have a look in your code and let you know.