The DS12887 uses multiplexed Address/Data Bus, Atmega, on the other hand, doesn’t have that bus ..
There is a lot of I2C-based RTCs so that would be the natural choice, or you can change horses (8051-microcontroller) but if you really have to connect the DS12887 to Atmega32 here is what you can do:
- connect the DS12887 8-bit A/D bus to any Atmega’s 8-bit port ..
- connect /INT to INT0, INT1 or INT2 and set them to be triggered at the falling edge
- connect DS to a general purpose pin – this will be your /RD signal
- connect R/W to a general purpose pin – this will be your /WR signal
- connect AS to a general purpose pin – this will be your ALE(Address Strobe)
- connect /CS to a general purpose pin – chip select has to be low before any operation is performed ..
And finally, connect pin 1 (MOT) to GND(0V) if you prefer the Intel bus timing ..
Now you have to follow timings form the DS12887 data sheet to create the multiplexed address/data bus in the ATMEGA’s software ..
Good Luck ..
Rgds,
IanP