Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Internal RTC
Page 4 of 4 | |||||
Author | Message | ||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6097 |
From the PCF8563 data sheet: Before any data is transmitted on the I2C-bus, the device which should respond is addressed first. The addressing is always carried out with the first byte transmitted after the start procedure. The PCF8563 acts as a slave receiver or slave transmitter. Therefore the clock signal SCL is only an input signal, but the data signal SDA is a bidirectional line. Two slave addresses are reserved for the PCF8563: Read: A3h (10100011) Write: A2h (10100010) The first 7 bits are the address and the last bit is read/write The maximite adds the read/write bit as required so we need the 7 bits as the address &HA2 divided by two gives &H51 which is the address that MMbasic needs 10100010 or 10100011 right shift gives 1010001 (&H51) Some datasheets give the 7bit address rather than 8bits just to confuse the issue. Jim VK7JH MMedit MMBasic Help |
||||
crackerjack Senior Member Joined: 11/07/2011 Location: AustraliaPosts: 164 |
Or if you want to make life easy when working with I2C, SPI, Serial, or almost any serial protocol, checkout the BusPirate here and here. It's a very handy little universal serial interface tool which together with a Maximite makes an nice experimentation setup... and can take a lot of pain out of working with serial interfacing as you can pretty much see exactly what is going on without resorting to logic analysers, 'scopes, etc. One of the nice little features of it is that you can do an address scan on the I2C bus. Also, you can even program the BusPirate in BASIC. |
||||
centrex Guru Joined: 13/11/2011 Location: AustraliaPosts: 320 |
Thanks for the info I will read the data sheets and see if it all makes sense. I have been trying all day to get my rtc to work would you believe the backup battery had been soldered in around the wrong way, a quick desolder and refit it is now all working. So much for the QC sticker on the bottom. Cliff |
||||
centrex Guru Joined: 13/11/2011 Location: AustraliaPosts: 320 |
One other thing I find puzzling with the rtc is that it runs of the back up battery continuosly one would have thought that two diodes fitted to the board would have overcome this. One diode feeding the supply voltage to the rtc the other feeding the backup battery to the jumper pins so that the battery is only enabled by fitting the jumper. I will do this on my rtc using a couple of bat42 schottky diodes. centrex Cliff |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
well if it come from asia it prolly was built by a five year old... technicians do it with least resistance |
||||
Page 4 of 4 |
Print this page |