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.

Master - slave network commands problems

Other Parts Discussed in Thread: CC8531, CC8520, DIR9001

I have problems in getting expected responses to some commands from master and slave.
First I establish a network that I check with NWM_GET_STATUS on master. Then I want to stream audio with NWM_ACH_SET_USAGE. I prepare the 16 1-byte parameters where only the first two are 0x0 and 0x1 then 0xFF. After execution of this command I do again NWM_GET_STATUS on themaster but both the ACH_USED in the conected slaves enumeration part and the ACH_USED in the main part bytes[3:4] show only zeros which suggests no slave streams audio while I issued the NWM_ACH_SET_USAGE command just a few moments before.
The second question is about datagrams where I am also unsuccessful so far - when I send a first datagram as I understand it should reset the connection setting the LSB in the first parameter of DSC_TX_DATAGRAM. Is the procedure that it has to be master who sends this reset connection datagram (length irrelevant and has to be e.g. 0 ?) or it can also be slave or they both have to exchange reset connection datagrams ? Should the slave get the EVT_DSC_RX_AVAIL flag set when the master has sent the reset connection intiating datagram ? That does not happen at me - the slave does not see the EVT_DSC_RX_AVAIL flag set - what can be wrong in my datagrams implemenetation and understanding ?

Best regards,

Pawel

  • One more question I forgot to ask about datagrams: is there any place (PPWC ?) where it set or determined whether master or slave supports data-side channel, ie datagrams ? If in CC8531 chips  used in the eval board they have datagram support then I am having strange reponse with this flag unset when I run NWM_GET_STATUS on master (byte 20). It seems that the correct value wiht bit 0 set sometimes appears a byte earlier (19-th) which is reserved but it may have been just a coincidence.

  • I have taken shots of the SPI lines for the problematic commands and I did not find any deviation here but maybe someone can notice sth improper:

    That's a connection reset DSC_TX datagram to a 1000033F chip, the yellow line is the MISO and the sending chip response.

     At the receiving chip there is no DSC_RX_AVAILABLE flag set after it is completed (I also put in some delay).

     And below is NWM_ACH_SET_USAGE on the slave connected to a master configured for front left and right.

     

     After sending that the NWM_GET_STATUS at the master shows ACH_USED 0x00000.

    Hope you'll put back to the right track...

  • The latter diagram is hardly intelligible so I'll try to paste a smaller one, the bytes on the MOSI line read: 0xCB, 0x10, 0x00, 0x01 and 14 times 0xFF:

  • Hi Pawel,

    I see that you don't write any payload after you perform the DSC_TX_DATAGRAM. This command should be followed by a WRITE command with payload. So you actually don't send anything in your scenario. To comment on your questions regarding the data side channel, you should send the CONN_RESET flag in the first packet in each direction after a connection has been established. So in the first datagram from master to slave this should be set, and also in the first datagram from slave to master. If you only send datagrams in one direction you don't have to reset the direction you are not using. Also, a device supports data side channel traffic if it's running in host controlled operation. Are you running in host controlled operation? You set this in the PPW Configurator.

    Regarding the ACH_SET_USAGE problem: If you perform a NWM_GET_STATUS on your slave what do you read in byte 13 and 14? This is the audio channels supported by the master.

    Regards

    Kristoffer

  • Hi Kristoffer,
    the magic of the forum works :) -  half of the problems solved - you were right - 0 payload does not work with datagrams.
    The ACH_SET_USAGE problem has not surrendered yet. To provide posiibly full info, the sequence of my relevant actions is:
    1. Master  NWM_CONTROL_ENABLE();
    2. Slave NWM_DO_JOIN();
    3. Slave NWM_GET_STATUS(); - shows ACH_SUPPORT (byte 13-14): value "3" which seems right
    4. Master DSC_TX_DATAGRAM();
    5. Slave   ACH_SET_USAGE();  sets 0x00, 0x01, 14x 0xFF
                     DSC_RX_DATAGRAM();
    6. Master NWM_GET_STATUS();  - shows "0" in ACH_USED (3:4 bytes) and "0" for the ACH_USED in the 16-byte slave (connected node) data block (although it shows the slave device_id, manf_, prod_id  correctly).
    There is one more problem with the status info from READBC() - byte 20 in the slave data block shows "0" as though slave did not support datagrams which is clearly not true - I reprogrammed it with PPWC for host control to be sure and it sees and reads the datagrams from master (as long as the payload is >0:). But that is probably a typo in the Family user Guide - page 80 top of the page - WPS_DSC_EN is specified at the same byte 20 as the preceding line bottom of the page 79 labeled as "Reserved". Byte 21 actually returns non-zero value, but not "1" as one would expect but consistently "3" which does not quite correspond to one bit LSB information about slave datagram support. And this would fit, maybe by sheer coincidence, the actual ACH_USED of the slave...

    Thanks and hope for the magic to continue

    Pawel

  • Hi Pawel,

    You seem to do everything right, as far as I can see. What version of the PPW Configurator are you using? Try downloading the latest PPW Configurator and reprogram your chips.

    Regarding the last thing you mention, about the last bit from the NWM_GET_STATUS() on the master, this bit should be set if the connected slave supports data side channel traffic. My last bit is set:) Again, see if upgrading the firmware with the newest Configurator helps. Also, I'm guessing you are reading from an old version of the Family User's Guide. I'm having trouble to understand (probably due to the page numbers you're referring to are not correct). The newest revision of the document, i.e revD, could be downloaded here: http://focus.ti.com/docs/prod/folders/print/cc8520.html

    Regards

    Kristoffer

  • Hi Kristoffer,
    I have dowloaded the latest PPWC ..05 ver, upgraded  and reprogrammed the chips but no change in the response - both ACH_USED in the master block and ACH_USED in the node part show "0".
    Regarding the last bit of NWM_GET_STATUS() on the master it was my mistake - the last bit of byte 20 is set at me  as well although except the last one also the preceding bit is set (Reserved according to the documentation) which was the reason why I thought this may have sth to do with channels used as it reads "3" which is the expected valued for slave's channels used. But that is probably just a conicidence.
    Is there any other way to check if the slave has correctly set up the logical audio channels ?
    I have thought maybe the channels used have sth to do with volume settings as at first the devices are muted on power-on so maybe it means they reply they do not consume audio.
    And here I am also having some problems:
    I send VC_SET_VOLUME command with 0 at byte 0 (global, Output) and bit 7 and 4 set  at byte 1 (Unmute + Absolute volume) and "7" as volume as attached (yellow - MISO, green - CSN):

    When I read at the slave it shows the following: "0xFC00" which seems not to correspond to "7"  ? - the command to get the volume is following:

     

    Regards,

    Pawel

  • Hi Pawel,

    The volume should be a signed 2's complement number which then is multiplied with 0.125dB, i.e. 0x0007 is too large (0 dB is maximum volume). The volume should be between -63.5 dB and 0 dB. Try e.g. 0xFF88 which is -15dB (-120 x 0.125 dB = -15 dB).

    Regarding NWM_ACH_SET_USAGE: I see that the returned status word when performing NWM_ACH_SET_USAGE is 0x8B4E (see picture below). Bit 1 is set meaning "PS: Join attempt failed or disconnected after successful join operation" according to table 23 in the user's guide. This could be sticking from previous operations, and then you should clear it, but it's maybe a clue to the strange performance. Can you find out when this bit is set?

    -Kristoffer

  • Hi Kristoffer,
    following your suggestions I logged all statuses from my master and slave interaction:
    M entry Status: 0x8a4c or 0x8a40 ( I do not know why sometimes after power-on both the master and slave can have dual state ?)
    M: clear flags:
     EHC_EVT_CLR(EVT_DSC_RESET);
     EHC_EVT_CLR(EVT_SPI_ERROR);
     EHC_EVT_CLR(EVT_VOL_CHG);
     EHC_EVT_CLR(EVT_PS_CHG);
     EHC_EVT_CLR(EVT_NWK_CHG);
     EHC_EVT_CLR(EVT_SR_CHG);
    M Status: 0x8a40
    M:     DI_GET_DEVICE_INFO();
    M Status: 0x8a40
    M:  
    NWM_CONTROL_ENABLE(1); // sending  CMD_REQ(0x0C,2); pars[0]=0; pars[1]=1;
    M Status: 0
    x8a50  //!! - SPI Error but in following commands it will see the slave ?

    S entry Status: 0x8a4c or 0x8a40
    S: clear flags:
     EHC_EVT_CLR(EVT_DSC_RESET);
     EHC_EVT_CLR(EVT_SPI_ERROR);
     EHC_EVT_CLR(EVT_VOL_CHG);
     EHC_EVT_CLR(EVT_PS_CHG);
     EHC_EVT_CLR(EVT_NWK_CHG);
     EHC_EVT_CLR(EVT_SR_CHG);
    S Status: 0x8a40
    S:     DI_GET_DEVICE_INFO();
    S Status: 0x8a40
    S: NWM_DO_SCAN(25); 
    S Status: 0x8a40
    S: NWM_DO_JOIN(35); 
    S Status: 0x8a40

    S: NWM_GET_STATUS_S();  // sees the master and reads its ID-s/data including ACH_SUPPORT is set to 3
    S Status: 0x8a40
     NWM_ACH_SET_USAGE();
    S Status: 0x8a40

    Master Status: 0x8a52  // i.e. NWK_CHANGE detected

    M:   VC_SET_VOLUME(UNMUTE | (1<<4), 0xFF88);       //  #define  UNMUTE    0x0080
    |Mater Status: 0x8a52 

    S Status: 0x8a40
    S:       VC_GET_VOLUME();  //value read:  0xFC00
    S Status: 0x8a40

    It actually turned out that most probably the slave did not read the VC_GET_VOLUME() command as I did not clear the flags in the beginning and often the EVT_VOL_CHG flag is self-set and that made me think it receives the volume. So the problem is I cannot properly send the volume either.

    Regards,

    Pawel

  • Pawel,

    Is the slave's volume remote controlled? I ask because you say you perform the vc_set_volume on the master. You configure this in the configurator, see pic. The parameters should be:   0x00 0x90 0xFF 0x88.

    -Kristoffer

  • Kristoffer,
    that was it - now remote volume is working without a glitch :) But that also means the user guide (I have version "d" yet:) asks for a correction - bottom of the page 59 - the volume range is defined as -128 up to plus 127 dB while actually it cannot exceed zero and cannot be changed in the PPWC.
    So we are left with just one item on the list - the ACH_USED issue. I checked the status messages again - the thing that you spotted that bit 1 is set does not repeat itself neither at the slave nor master now. The SPI error that I mentioned previously has also been demystified - it is set if  NWM_CONTROL_ENABLE() with parameter=1 (enable)  is repeated - so just signals the command will have no effect as the master has already been enabled. 
    Any ideas what else to check ?

    Thanks,

    Pawel

  • Pawel,

    Thanks for the User's guide input. I will take care of it. For the ACH_SET_USAGE problem, could you please post your master and slave device configurations (.ppwcfg)?

    -Kristoffer

  • Kristoffer,
    files attached as .zip, let's see if it can be downloaded

    Regards, Pawel

     

    7144.My projects.zip

  • Hi Pawel,

    I was able to download your files and I flashed two EMs and plugged them into the PPW audio EB. Everything works for me. But I see that you have a digital system (didn't know that before), and maybe this is what causing troubles for you... You have to have valid audio on the master side in order for byte 3 and 4 in the master's NWM_GET_STATUS() info to turn 0x0003. If you have valid digital audio, LED D4 on the Master's PPW Audio EB is lit, and both the Master's and Slave's network status LED are constantly lit (meaning ACTIVE mode). If yoy don't have valid digital audio then D4 is dark, and the status LED on both devices are blinking indicating STANDBY mode. Also important: the jumper on J14 on the master Audio EB must be placed on the middle pin and the COAX pin, if you're using a coax cable and OPT if you're using optical signal.

    -Kristoffer

  • Also important: The jumper block on P15 (default placement, for using the AIC3101) should be moved over to P13 on the Master Audio EB, and P12 on the Slave Audio EB.

    -Kristoffer

  • Hi Kristoffer,
    I finally managed to put together the hardware needed to test the audio path. And it seems we are getting at a happy end. First I spent some time last night fot 2 reasons - one your last post mentioning the jumper blocks was not immediately visible (next page) and my SPDIF did quite start in the beginning. As that was rather simple (and probably well-documented in the manuals:), I quickly figured out  I needed to transfer the signal jumpers to P13 (master got SPDIF input) but it was not quite natural for me that the power supply for DIR9001 is also provided via a jumper... But finally it worked as advertised and I am getting 0x03 as ACH_SUPPORT, I also get 0x11 for ACH_FORMAT [15][6:4] and ACH_FORMAT [15][2:0] - that translates to PCM16 - correct. But one last thing that is troubling me is why do I get zeroes for ACH_FORMAT [15][7] ACH_FORMAT [15][3] - ACH_ACTIVE flags ? I also have zeroes for ACH_USED - under what conditions are they filled ?
    To feel fully happy I'd also need one more thing - so far I "played" the music only as I2S on my oscilloscope - and this looks fine but I would feel better if I could hear the sound via the headphones output.  I reprogrammed the slave to talk to the codec but I did not manage to get musi out although I moved most of the jumpers to the P15. I am attaching also my PPWC config and if you could checklist :) me on this setup would be of great help.

    Thanks and regards,

    Pawel

    5482.Slave stereo analog.zip

  • I will have a look at this Pawel.

    -Kristoffer

  • Hi Pawel,

    I tried your configurations (digital master and analog slave). It works fine for me. I'm hearing audio in the headphones. I also get 1 for the [15][7] and [15][3] bits in the NWM_GET_STATUS() command on the slave. If I don't have valid audio input I get a '0' in these bits. Are you sure you are feeding the master valid digital audio? Also, the jumper settings should be the following:

    Digital Master: P13 should should have all the jumpers mounted, P12 and P15 should have none mounted.

    Analog Slave: P15 should have all the jumpers mounted. P12 and P13 should have none mounted.

    -Kristoffer