I2C to SPI BASIC code conversion? Answered
Hello all. Pretty daft and most likely simple sollution to those who know what they are doing I'm sure. I am building a 132 LED clock (60 for seconds, 60 for minutes and 12 for hours). I'm using a Picaxe 28X2 and will most likely be using 3 MAX7221's to display the LED's, 1 each for the hours, minutes and seconds. I'm currentlty using a DS1307 RTC module to keep time. Exposition over!
My question is, I am using open source code from a guy who made a clock using Pic 28X1, MAX7221 and DS1305 displaying on four 7-segment displays. now the differences between the Pic's with regard to coding I can handle, although I do have a 28X1. The fact that the DS1305 and 1307 use SPI and I2C respectively means that the differences between comms protocols are confusing the hell out of me.
Now please forgive the length of this question. Basically, I need some pointers as to whether it would be better to try and convert the code to use I2C for the RTC and stick with SPI for the MAX or should I just buy a DS1305 at almost £6 per chip and make my life a bit easier? I have already tried using the code with my 1307 but the 7-seg display I have just stays on the No2.
As for the differences in display type...well I'll come to that once I get the timing working.
If I've left anything out or you need more information then please let me know.
Here is the link to the clock schematic:
And the code is far too long to be pasted here I'm affraid and the file I originally got it from had converted it into word which pushed all the lines together. That was a fun few hours sorting that out!
Thanks in advance