hspiout & MAX7219/MAX7221

QuIcK

Senior Member
MAX7219/MAX7221 is a 8 x 7seg display driver (or 64 led driver) with built in BCD decoding (disabled-able)
http://pdfserv.maxim-ic.com/en/ds/MAX7219-MAX7221.pdf

What spi mode should I use for this, and why?

reading the manual for hspisetup:
spimode00 (CKP=0, CKE=1, SMP=0)
spimode01 (CKP=0, CKE=0, SMP=0)
spimode10 (CKP=1, CKE=1, SMP=0)
spimode11 (CKP=1, CKE=0, SMP=0)
spimode00e (CKP=0, CKE=1, SMP=1)
spimode01e (CKP=0, CKE=0, SMP=1)
spimode10e (CKP=1, CKE=1, SMP=1)
spimode11e (CKP=1, CKE=0, SMP=1)
i get the 'e' suffix, but what is CHP CKE and SMP... how do you know when to use what?
Im guessing that SMP is sample at start and !SMP is sample in the middle.
 

Technical

Technical Support
Staff member
SMP = 0 Input data sampled at middle of data output time
SMP = 1 Input data sampled at end of data output time

CKP = 0 Bus idles low
CKP = 1 Bus idles high

CKE = 0 Output data changes on change from idle to active
CKE = 1 Output data changes on change from active to idle

There are so many SPI variants it is all a bit confusing, and some times it just pays to play wth the settings to you fnd the one that works! However

Pin 1 description page 5 states 'on CLKs rising edge'

which implies the data is read into the chip when the (idle low) bus gets a rising edge on CLK.
 

womai

Senior Member
I haven't looked at the data sheet of this particular part, but SPI mode 00 is by far the most common (clock idles low, data to the slave gets sampled on the rising clock edge at the middle of the data input time, output data changes state on the falling clock edge).

Wolfgang
 
Top