MCF5373L and 13202 radio chip communication problem (SPI)

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

MCF5373L and 13202 radio chip communication problem (SPI)

1,555 Views
KRichard
Contributor II
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;
Labels (1)
0 Kudos
2 Replies

289 Views
w_wegner
Contributor III
Hi,

I am also still haveing some trouble with QSPI, but in your example, I can not see the transfer being started?

Before waiting for the transmit/receive to finish, you have to start it by setting bit 15 of QDLYR, so I think the line

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

should be

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

HTH,
Wolfgang
0 Kudos

289 Views
KRichard
Contributor II
Thanks WolfgangW, that was the problem indeed!

Cheers, Richard
0 Kudos