Morten S. Laursen

MC68HC08EY16 and SPI

Discussion created by Morten S. Laursen on Sep 22, 2008
Latest reply on Sep 24, 2008 by bigmac
Hi,
I'm working with a 908E626, which is a chip containing 2 die's one MC68HC08EY16 and one analog die (motor driver). To communicate between the die's one needs to use the SPI interface of the MC68HC08EY16 die. However it seems that no matter what I do I cannot get in contact with the analog die, the spi registers is set up to
SPCR = 0x28
SPSCR = 0x08
and I'm running of a clock of 9.8304Mhz.
I appreciate any suggestions.

This is how the spi is to be setup acording to the datasheet (a diagram is also attached)

The serial peripheral interface (SPI) creates the communication link between the microcontroller and the 908E626.
The interface consists of four pins (see Figure 11):
•SS — Slave Select
•MOSI — Master-Out Slave-In
•MISO — Master-In Slave-Out
•SPSCK — Serial Clock (maximum frequency 4.0 MHz)
A complete data transfer via the SPI consists of 2 bytes. The master sends address and data, slave system status, and data of the selected address.

During the inactive phase of SS, the new data transfer is prepared. The falling edge on the SS line indicates the start of a new data transfer and puts MISO in the low-impedance mode. The first valid data are moved to MISO with the rising edge of SPSCK.
The MISO output changes data on a rising edge of SPSCK. The MOSI input is sampled on a falling edge of SPSCK. The data transfer is only valid if exactly 16 sample clock edges are present in the active phase of SS.
After a write operation, the transmitted data is latched into the register by the rising edge of SS. Register read data is internally latched into the SPI at the time when the parity bit is transferred. SS HIGH forces MISO to high impedance.

Outcomes