I'm writing a library to access a DS3234 real time clock via SPI from an MC9S08DZ128.
After power-on, I'm getting a lot of read errors for about 15 seconds. This means the time read from the clock registers jumps around and I'm getting inconsistent SRAM reads (I know because I get checksum errors). After those initial problems go away, the device works fine until power cycled again. The RST pin is steady high after power on.
I'm waiting 400ms after power on before initialising the rtc. During initialisation, I'm writing 0x00 into the control register and and I'm disabling BB32KHZ, EN32KHZ and setting CRATE to 00 in the control/status register.
Only after the initialisation I start periodically reading the time and temperature registers and allow SRAM read/writes.
SPI is configured with mode 3 at 1MHz baud rate.
Solved! Go to Solution.
Fixed.
The problem was another device on the same SPI bus. It's CS was connected to an unconfigured pin of the CPU, which lead to corruption on the DOUT line during start-up until the unconfigured pin settled into friendly state.
Fixed.
The problem was another device on the same SPI bus. It's CS was connected to an unconfigured pin of the CPU, which lead to corruption on the DOUT line during start-up until the unconfigured pin settled into friendly state.