SPI / RTC Write Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI / RTC Write Problem

617 Views
salmanc
Contributor III

Hi everyone,

I am working on #5674F and #RTC #DS1390. Spi.c and spi.h files that I wrote are ready to use. I have initialized  associated spi registers/pins and make it work. I can send data and I can see clock, data and cs signals on the ossiloscope in a correct way. 

My problem is, I cannot #write data and I cannot configure RTC. According to #DS1390's  data sheet, I read data with 00h, 01h, 02h, .. 0Fh commands and see the result in register(clock information) but when I write with the commands 82h, 83h, .. etc  and try to configure RTC, nothing happens. It doesn't allow me to write and make any changes. Also I still and always see the same result (the result that comes after read command).

For example: 

data send: 0200h (read address - reads minutes) answer: 0x00000003

data send: 8244h (write address - writes minute information) answer: 0x00000003 expected answer: 0x00000044

after write command also I send read command again 0200h and answer didn't changed (0x00000003)

How can I slove this problem? 

Thank you in advance.

1 Reply

388 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do you use SPI mode 1 or 3 (CPHA=1)?

Also do you deassert /CS after write command is sent, before read command is issued?

BR, Petr