This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC8520 SPI Communication and Network-Scanning/Joining

Other Parts Discussed in Thread: CC8520, CC2591, TLV320AIC3204

Hi everybody,

we are working with the cc8520 together with TLV320AIC3204 and cc2591. We developed an evaluation board, where we can use the cc8520 in autonomous as well in host controlled mode. If both (we have two boards running) boards are in autonomous mode, everything works fine. But we have problems in host controlled mode...

First of all: Is it possible to combine a master in autonomous mode and a slave in host crontrolled mode (or reverse) or must all devices work in host crontrolled mode?

1. Problem: Status word

We often see EVT_SPI_ERROR-errors in the status words. For example when we send a DI_GET_DEVICE_INFO, we get the following status word (I've sent it twice to get the right one).

Confusing is, we get the right answer (DEVICE_ID etc.) by executing a READ command but the status word indicates a SPI error.

This happens with many other commands but it is not really repeatable, sometimes an error, sometimes none (we always reset the errors)?

I think we complied to all SPI restrictions, as you can see on the pictures.

 

2. Problem: NWM_DO_SCAN, NWM_DO_JOIN

!!Please remember, we are working with a Master in autonomous mode and a slave in host controlled mode.!!

When we try to do a NWM_DO_SCAN or NWM_DO_JOIN to check for available networks, the slave device does not find any, even if the master device is in pairing mode. We can see that the slave is scanning (higher current consumption for 500ms) but nothing is found. The status word indicates a EVT_NWK_CHG.

Thats our DO_JOIN command:

And thats the answer from a READBC for 28 Bytes:

It indicates that 0 networks were found and that we only get the status word.

In general:

Whats the proper way to establish a connection? We do the following:

1. Power-Up the device

2. Scan for or Join to a network

3. Check if we found anything

Is there any further step we missed. Could anyone tell me the general approach to manage a connection?

 

Regards,

Oliver

  • Hi Oliver,

    You seem to do everything right according the family user's guide. But try to wait for 10 ms or so between the CMD_REQ and the READ/READBC. Does this fix your problems? And also, host controlled devices and autonomous operated devices can operate together :)

    -Kristoffer

  • Hi Kristoffer,

    thanks for your immediate reply!

     

    1. Status word:

    Still the same problems, sometimes EVT_SPI_ERROR...

    Can you mention where these errors come from. Any idea how to debug them? The oscillogram looks good, but I cannot read the values out of the cc8520's register, so I do not know if he gets the right commands? At some commands he behaves like i expect it (eg.: Power State ON/OFF or Read the device an man id).

    EDIT: I now also traced the INT-Flag so you can see when the EVT_SPI_ERR occurs. I only activated this INT-Source.

    The command is a IO_GET_PIN_VAL:

     

    2. SCAN / JOIN:

    Still same problems, slave does not find the network, the master opened. Do you mean at least or minimum 10ms (or nearly exact).

    How can I understand the following statement for the NWM_GET_STATUS command on page 82 of the family guide:

    "nBytes will always be 30 when connected and 0 otherwise"

    The READBC we get when we readout the status after a NWM_DO_JOIN is the following:

    Does the "1E" for nBytes indicate, that we can read 30Bytes out of the data field? Confusing is, all 30Bytes are "00"? (Again, here we have an SPI_ERROR :-().

    How should the status led behave when I send the NWM_DO_JOIN? In our case, it starts flashing (with a period time of 1s) and never stops (until I power down the device).

    Regards,

    Oliver

  • I mean 10 ms or above. Try 100 ms.This shouldn't really be necessary. It used to be necessary in old firmware revisions. What firmware revision are you using? You see this on the start page in the PPW Configurator.

    Which signals are you connecting between your host controller and your CC8520?

    You can configure the LED blinking pattern in the Radio panel in the PPW Configurator.

    -Kristoffer

     

  • Hi Kristoffer,

    JOIN / SCAN problem is now solved. Reason was a FW missmatch. We are able to pair and read the NWM_GET_STATUS command (with usefull data ;-)). Sending audio data might now be possible. I'll check that tomorrow.

    Because of that, all other commands like Write data to nonvolatile ram etc. that did not work before, are now working. What is great!!!

    But we still have the status word issue (sadly this was not caused by the FW missmatch).

    Connected signals are:

    CS

    SCKL

    MISO

    MOSI

    IRQ

    RES

     

    Regards,

    Oliver

  • Hello,

     

    streaming audio works! Also setting volume etc...

    But still the status word issue, sometimes SPI errors.

    Any further idea?

     

    Regards,

    Oliver

  • Hi Oliver,

    Sorry for the delay, I'm a little overloaded these days.

    When you observe that the SPI_ERROR flag is set, remember that it's the previous command that causes the flag to be set. Could you please do a GET_STATUS() (page 69 in the family user's guide) immediately after every EHIF command you do, and then show me a screen shot where the SPI_ERROR is set in the GET_STATUS()? I need the error-making command to be in the screen shot as well.

    -Kristoffer

  • Hi Kristoffer,

    I will send you the screen shot the next days. I've got another question regarding the spi error.

    What errors does the SPI_ERROR flag report exactly. The manual on page 76 says:

    "Indicates invalid SPI command/parameters or unexpected read/write
    operations"

    Could this also be a SPI command, which the cc8520 did not expect. Like Power On if we are already powered?? Or does it mean, the SPI command could not be analyzed because of timing constraints or something else.

     

    Regards,

    Oliver

  • Hi Oliver,

    The SPI_ERROR flag indicates that commands are used incorrectly...

    Some examples:

    *If the number of parameter bytes is not equal to what you stated in the n field in the CMD_REQ commmand.

    *If you execute a command on a master which is only supported by slave devices or vice versa.

    *If you execute a command which is not supported by the operation mode you're using (e.g. if you execute a production test command when the device is runnning in host-controlled operation).

    *Incorrect use of CMDREQ_RDY.

    Also, if you have electrical errors that trigger the above cases the SPI_ERROR flag will be asserted.

    -Kristoffer

  • Hi,

    i have the same SCAN/JOIN problem in the same situation (slave host control with a master in autonomous).

    I see that Oliver solved the problem. Could you please describe me how?

    You told that there was a FW mismatch...but where? into the FW of the CC85xx or into your host?

    Please let me know.
    Regards.
    Silvio.

     

  • Hi Silvio -

    As far as I remember, our two CC85xx devices where on different FW versions. After fixing this issue, SCAN/JOIN worked fine again!

    Cheers,

    Oliver