how to read the time from RTCC PCF8523 with i2c-bus (NXP8523)
I know the adress for reading (D1) and writing (D0) from the IC and I know the Register for seconds 0x04
But there is addrH and addrL
and some start and stop and acknowledge
hmm I need a litle help
how to read from i2c bus a rtcc PCF8523
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: how to read from i2c bus a rtcc PCF8523
Ignoring any checks for Slave Ack/Nak, you would need the following:
Code: Select all
Initialise()
Start()
TransmitByte(0xD0)
TransmitByte(0x04)
Stop()
Start()
TransmitByte(0xD1)
data = ReceiveByte(1) // 1 = Last byte, no more requested
Stop()
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
Re: how to read from i2c bus a rtcc PCF8523
Hi Leigh
Sometimes life is easy...
Thank you for the help. This way it's working fine.
Sometimes life is easy...
Thank you for the help. This way it's working fine.