Page 1 of 1

how to read from i2c bus a rtcc PCF8523

Posted: Thu Jun 15, 2017 6:00 pm
by stefan.erni
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
bus_read.PNG
(25.1 KiB) Downloaded 2481 times
fc7_maske.PNG
(13.1 KiB) Downloaded 2481 times

Re: how to read from i2c bus a rtcc PCF8523

Posted: Fri Jun 16, 2017 9:46 am
by LeighM
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()

Re: how to read from i2c bus a rtcc PCF8523

Posted: Fri Jun 16, 2017 10:13 am
by stefan.erni
Hi Leigh

Sometimes life is easy...

Thank you for the help. This way it's working fine.