I am having some difficulties interfacing the 8051 to the MAX7221 driver chip using SPI. As I understand it, it receives a 16bit signal and that would require bit-banging as the 8051 only sends 8bits. I am having trouble understanding how to do this in the assembly language.
This is the next tutorial in my 8051 series.... It's been on hold for a few weeks but I aim to get it back on track soon.
With SPI you can send a byte twice in succession to achieve 16 bit.. So.. Clear the CS bit load the SPI reg with the HIGH byte... Send...Load with the LOW byte... Send... Then Set the CS bit.... All done..
If you can send a byte, then you can send a double byte... The trick is to control the CS pin, so choose your own CS pin..
Thanks for the reply. I actually found this site after landing on your tutorials. As my luck would have it, you stopped right before the info I needed haha.
Here is a snippet of what I'm doing.
If I'm reading the MAX7221 datasheet correctly, I am sending the normal operation command first then display "5" on digit 1.
Nothing seems to show up. I am thinking it may be a configuration problem, specifically with SPI. Here's what I'm doing: https://i.imgur.com/HbMy3H6.jpg
Alright, so with the following code and format, I was able to successfully talk to the 7221 chip. However, I am using 6 digits and the last 2 7-segments do not display what they should. They instead display a random symbols that do not seem to correlate to the intended value. I set the scan limit to the number of characters I'm using, and still the 5th and 6th are jumbled. Not sure if this is an 8051 issue anymore.