Richard Klinda

MCF5373L and 13202 radio chip communication problem (SPI)

Discussion created by Richard Klinda on Oct 26, 2007
Latest reply on Oct 27, 2007 by Richard Klinda
Hello, I have a problem and I could use some ideas for troubleshooting.

I have an MCF5373L ColdFire processor connected to 13202 radio chip via SPI. When I try to read/write data I never get the SPIF flag in the QIR register. What can cause this?

Thanks in advance!

Here is an example section of code:

Initialisation:

MCF_QSPI_QMR = (0
| MCF_QSPI_QMR_MSTR
| MCF_QSPI_QMR_DOHIE
| MCF_QSPI_QMR_BAUD(0xFF));
MCF_QSPI_QWR = (0
| MCF_QSPI_QWR_CSIV
| MCF_QSPI_QWR_ENDQP(0x01));

MCF_QSPI_QAR = ( 0
| MCF_QSPI_QAR_ADDR(0x20));

MCF_QSPI_QDR = 0x8000;
MCF_QSPI_QDR = 0x4000;

MCF_QSPI_QIR = ( 0
| MCF_QSPI_QIR_WCEFB
| MCF_QSPI_QIR_ABRTB
| MCF_QSPI_QIR_ABRTL
| MCF_QSPI_QIR_WCEF
| MCF_QSPI_QIR_ABRT
| MCF_QSPI_QIR_SPIF);

MCF_QSPI_QDLYR = ( 0
| MCF_QSPI_QDLYR_DTL(0xFF)
| MCF_QSPI_QDLYR_QCD(0x7F));

//-------------------------------------------------------

An actual read attempt:

MCF_QSPI_QAR = 0x00;
MCF_QSPI_QDR = (ABEL_reg24 | 0x80);
MCF_QSPI_QDLYR = ( 0 | MCF_QSPI_QDLYR_DTL(0xFF) | MCF_QSPI_QDLYR_QCD(0x7F));

// this line hangs forever
while (!(MCF_QSPI_QIR & MCF_QSPI_QIR_SPIF));

MCF_QSPI_QIR = ( 0 | MCF_QSPI_QIR_WCEFB | MCF_QSPI_QIR_ABRTB | MCF_QSPI_QIR_ABRTL
| MCF_QSPI_QIR_WCEF | MCF_QSPI_QIR_ABRT | MCF_QSPI_QIR_SPIF);
MCF_QSPI_QAR = 0x10;
MCF_QSPI_QDR;

Outcomes