Figure-2: Proposed Hardware Block Diagram for ATtiny44 Based Taxi Meter
I am buidling a Taxi Meter (Fig-1, 2) using ATtiny44 MCU which supports SPI or SDA Port (NOT both simultaneously). I need the SPI Port to drive MAX7219 for Display Unit. I would also like to display the time of the day; so, I need a SPI supported RTC chip of minimum pin count.
If you have any idea about that chip, please let me know.
Thank you very much for the information. SPI driven DS3234 has 20-pin and a bit expensive.
I am investigating the case if I can do the multiplex use of I2C Bus service at one time for 8-pin low cost DS1307 RTC and SPI Port service at another time for MAX27219 knowing that I2C/SPI are the alternate functions of PPin-7 (MOSI/SDA) and PPin-9 (SCK/SCL) of ATtiny44 MCU.
That depends on what you want to do.
For SPI You will need power and ground, clock, data in if you are going to tell it anything, data out if it is going to give you anything and if there are other devices chip select to know it is selected. This comes out to 4 - 6 depending on configuration.
I2C is simpler. You need power and ground, data and clock so that comes out to 4 pins needed.
There are other methods where you can get it down to two, example temperature sensors.
ATtiny44 has enough IO line to drive MAX7219 by bit banging. Now, I can handle DS1307 RTC using I2C Bus. I will come back with results soon.
Presently, I am developing the hardware/software using Arduino UNO and a 16 x cc-type standalone display unit being driven by two cascaded MAX721. I will switch over to ATtiny44 once the chips arrive by 3 weeks from Chin.
PCB space and cost of the product are really concerned. DS3231 is ten times costlier than DS1307. Showing time of the day on the Waiting Time display window of the Taxi Meter is an optional requirement. Time inaccuracy of DS1307 (about 2-sec/day) compare to 0.16-sec/day of DS3231 could be acceptable from practical point of view.
Is the max7219 on a manufactured board containing the 7-seg display, or are you using a standalone max7219 and display? If the latter, maybe you could switch to using HT16K33 which is i2c.
16 cc-tpye standalone display devices being driven by two cascaded MAX7219 in the following organization:
(DP0) DP1 - DP5 = Fare Meter (Tk) //(DP0) means -- device is absent physically
(DP6) DP7 - DP11 = Distance Meter (kM)
DP12 - DP15 = Waiting Time Meter/Time of Day (MS/HM)
Thanks for the infomation. I have ordered for 28-pin version five pieces and will arrive by 4 weeks from China. Let me have it, program it, and come back here with results/problems.
If I can manage programming the chip and the display intentity level up to satisfaction, then it will be a replacement for 2 x MAX7219 chips.
Problem-1 of post #1 is solved by Bit-bangging scheme (Fig-1, Example of a Distance-drive journey)). It is working fine with Arduino UNO (present Dev Tool). Hopefully, it will also be working with ATtiny44 which is yet to arrive from China.
The alternate solution could be the use of I2C HT16K33 @PaulRB (post #16), which will be tested once the chip arrives by 3 weeks time from China. If the said chip works for me, then I2C DS1307 and I2C HT16K33 can be operated using SDA/SCL lines. As a result, PB0, PB1, and PB3 (Fig-2 of post #1) will be free and could be emplyed to implement the followig user commands:
W = Perform Wheel Test
K = Prform K Factor Test of the Wheel
W-K = Perform Error Calculation
I have received the above display controllers in MSOP package. I will have hard time to bring out connections from the tiny pins of the chip..
I would appreciate if you can refer me to a Tutorial using CC-type 7-segment display unit, UNO, and HT16K33. I have searched and have found few which are not complete.
You can connect 2x 4-digit 7-seg CC displays as though it was a single 4-digit 16-seg CC display. The cathodes would be connected to the same C0-C3 pins on the chip. One display would be connected to the A0-A7 pins and the second display connected to the A8-A15 pins.