Joined: 12 Apr 2015 Posts: 6 Location: New Zealand
PCF2127 clock IC RAM write/read
Posted: Sun Apr 12, 2015 3:20 pm
I am trying to write & read to the RAM in the PCF2127 clock IC
using SPI.
The data sheet only shows the IIC sequence.
I can wr/rd the clock date & time and the configuration regs OK, so my hardware is good.
Has anyone done this?
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sun Apr 12, 2015 4:00 pm
It's shown in Figure 38b on page 64 of the pcf2127 data sheet.
www.nxp.com/documents/data_sheet/PCF2127.pdf
The diagrams on the lower 2/3rd's of the page show how to do it.
Compare the code below to the diagrams.
The code above is for writing one byte only. The diagrams show how
to write multiple bytes. In that case you would supply a pointer to an
array. The function above would have to be re-written somewhat.
The reading of RAM is shown on page 65. You can write that one.
donW
Joined: 12 Apr 2015 Posts: 6 Location: New Zealand
Posted: Sun Apr 12, 2015 4:19 pm
thanks for quick reply!
my 'write byte' is in the same sequence as you show.
Can you show me the 'read a byte' code?
The datsheet IIC routine is confusing: it shows to setup the read adress,
then a write to reg 1D ? then data read....
donW
Joined: 12 Apr 2015 Posts: 6 Location: New Zealand
Posted: Sun Apr 12, 2015 4:43 pm
your datasheet is newer than mine.. which does not have the SPI examples
I am doing write & read as per your datasheet, but still can only get 00's back from the RAM...
donW
Joined: 12 Apr 2015 Posts: 6 Location: New Zealand
Posted: Sun Apr 12, 2015 5:15 pm
Found my problem ! my write routine was using the wrong port for /CS pin..
ram now working...
Thanks for the newer version of datasheet..
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum