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.

AM623: AM623

Part Number: AM623
Other Parts Discussed in Thread: ADS131A04

Tool/software:

Hello,

I have 3 ADS131a04 devices connected on MCU_SPI0. They are setup according to section 10.1.3.1 of the datasheet where the first device is configured in Asynchronous Interrupt Mode and the other two devices in synchronous slave mode. I also have a program that I use to startup the M4F. The program uses RPMSG to start/stop M4 so I can load and test new code by stopping/starting the M4. My program issues multiple commands to the ADC as listed in the attached log. It starts by issuing UNLOCK followed by REST then NULLs until I get back FF04 from each device.

The first time I load my code it completes fine, and the register dump doesn't show any errors. However, if I stop/start M4 then my next run will fail to get FF04 from all 3 ADCs. I get FF04 from the first device but the second device reports 2220, which I believe is SPI fault. The 3rd device is probably not reachable. Now, if I stop/start M4 again, then this time I will get FF04 from devices 1 & 2, but device 3 now reports the SPI fault. On the 3rd stop/start of M4 then all 3 ADCs report FF04 and my code completes the other sequence of commands. My code doesn't do much other than making these calls when it starts:

    MCSPI_init();
    Drivers_mcspiOpen();
Any idea why stopping/starting M4 will cause this behavior? Is there something else I should be doing every time the program starts? Thanks.
-Ayman
Run-1
=====
cmd:0x0655   len:0x0c   status: 0xff04ff042224
cmd:0x0011   len:0x0c   status: 0x065506550655
cmd:0x0000   len:0x0c   status: 0xff827f827f82
cmd:0x0000   len:0x0c   status: 0xff04ff04ff04
cmd:0x0655   len:0x0c   status: 0xff04ff04ff04
cmd:0x0000   len:0x0c   status: 0x065506550655
cmd:0x4d02   len:0x0c   status: 0x220022002200
cmd:0x0000   len:0x0c   status: 0x2d022d022d02
cmd:0x4eae   len:0x0c   status: 0x220022002200
cmd:0x0000   len:0x0c   status: 0x2eae2eae2eae
cmd:0x4f0f   len:0x0c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x2f0f2f0f2f0f
cmd:0x0033   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x003300330033
cmd:0x0555   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x055505550555
cmd:0x0000   len:0x3c   status: 0x220022002200
cmd:0x2500   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x250025002500
cmd:0x0000   len:0x3c   status: 0x220022042204
ADC INIT COMPLETE ... Dumping registers

cmd:0x2200   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x220022002200	[STAT_1 REG]
cmd:0x2300   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x230023002300	[STAT_P REG]
cmd:0x2400   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x240024002400	[STAT_N REG]
cmd:0x2500   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x250025002500	[STAT_S REG]
cmd:0x2f00   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x2f0f2f0f2f0f	[ENABLE REG]

echo stop  > /sys/class/remote/remote0/state
echo start > /sys/class/remote/remote0/state

Run-2
=====
cmd:0x0655   len:0x0c   status: 0x220000060009
cmd:0x0011   len:0x0c   status: 0x065500060009
cmd:0x0000   len:0x0c   status: 0xff8211000003
cmd:0x0000   len:0x0c   status: 0xff0422200006
cmd:0x0000   len:0x0c   status: 0xff0422200006
cmd:0x0000   len:0x0c   status: 0xff0422200006
**** ADC NOT READY [ff0422200006] ****

echo stop  > /sys/class/remote/remote0/state
echo start > /sys/class/remote/remote0/state

Run-3
=====
cmd:0x0655   len:0x0c   status: 0xff0422240006
cmd:0x0011   len:0x0c   status: 0x065506550006
cmd:0x0000   len:0x0c   status: 0xff827f821102
cmd:0x0000   len:0x0c   status: 0xff04ff042220
cmd:0x0000   len:0x0c   status: 0xff04ff042220
cmd:0x0000   len:0x0c   status: 0xff04ff042220
**** ADC NOT READY [ff04ff042220] ****

echo stop  > /sys/class/remote/remote0/state
echo start > /sys/class/remote/remote0/state

Run-4
=====
cmd:0x0655   len:0x0c   status: 0xff04ff042224
cmd:0x0011   len:0x0c   status: 0x065506550655
cmd:0x0000   len:0x0c   status: 0xff827f827f82
cmd:0x0000   len:0x0c   status: 0xff04ff04ff04
cmd:0x0655   len:0x0c   status: 0xff04ff04ff04
cmd:0x0000   len:0x0c   status: 0x065506550655
cmd:0x4d02   len:0x0c   status: 0x220022002200
cmd:0x0000   len:0x0c   status: 0x2d022d022d02
cmd:0x4eae   len:0x0c   status: 0x220022002200
cmd:0x0000   len:0x0c   status: 0x2eae2eae2eae
cmd:0x4f0f   len:0x0c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x2f0f2f0f2f0f
cmd:0x0033   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x003300330033
cmd:0x0555   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x055505550555
cmd:0x0000   len:0x3c   status: 0x220022002200
cmd:0x2500   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x250025002500
cmd:0x0000   len:0x3c   status: 0x220022042204
ADS INIT COMPLETE ... Dumping registers

cmd:0x2200   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x220022002200	[STAT_1 REG]
cmd:0x2300   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x230023002300	[STAT_P REG]
cmd:0x2400   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x240024002400	[STAT_N REG]
cmd:0x2500   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x250025002500	[STAT_S REG]
cmd:0x2f00   len:0x3c   status: 0x220022002200
cmd:0x0000   len:0x3c   status: 0x2f0f2f0f2f0f	[ENABLE REG]
  • Hi,

    Allow me sometime to look through the datasheet for the modes you have specified.

    Regards,

    Vaibhav

  • Hi,

    Since it was not specified in the question description, I realized that you were referring to the datasheet of the Peripheral and not the datasheet of AM62x.

    I am assuming you are talking about the following section:

    I am checking this and seeing the configurations side by side which should be done with respect to AM62x MCSPI Controller. Please expect responses in 2-3 business days.

    Regards,

    Vaibhav

  • Thanks for looking into this. Yes, I was referring to the configuration section in the ADS131A04 datasheet. Just to clarify a few things:
    1. The first run doesn't actually complete successfully till the end of the command sequence. Looking at the last 2 NULLs, the first one successfully returns the status of the previous RREG 0x5, but the next NULL returns 2204 for ADCs 2 & 3. That indicates F_RESYNC fault as per Table 18 of the datasheet. Not quite sure what would introduce that fault between the two NULL commands.

    At that point, I tried two options:

    A. If I were to power-cycle the board at this point, then the next run will successfully go through the complete command sequence but again the last NULL command will return 2204 from ADCs 2 & 3.

    B. If I were to reboot Linux instead of power-cycle, then the next run will exhibit the behavior I described in the original post where only the first ADC reports READY and takes a couple of stop/start of M4 to get all 3 ADCs READY.

    Thanks again.

    -Ayman

  • Hi Ayman,

    Thank you for waiting.

    I have been looking at the register maps and ways to interact with the ADS. I have gone through few initialization steps and I see that you have attached the logs above which justify the same.

    I understand that FF04 yield from the 3 devices means good to go. When you say that the data output from the command:

    cmd:0x0655   len:0x0c   status: 0xff04ff04ff04, means that ff04 ff04 ff04 is for first, second and third device respectively or for third, second and first device respectively? Hope you got my question.

    I also see a pattern that after exactly couple of power cycles the values seem to repeat itself and init happens correctly.

    I have read through the datasheet but I would need to spend more time on the same and understand what can be done differently as the Peripheral you are using is new to me as well. 

    NOTE:

    On this note, could you please go ahead and share the example.syscfg file for a quick sanity check from my end. If you are developing on Processor SDK Linux then this example.syscfg will not be there. Let me know on this one.

    Regards,

    Vaibhav

  • Additionally, can you please let me know how the following value which is 0x2204 is mapped to table 18?

    0x2204 is 10 0010 0000 0100b

    Here I see that the bit 2 is set hence F_RESYNC is justifiable. How are we mapping the rest of the bits here from 8:13?

    Regards,

    Vaibhav

  • The way I read 0x2204 is:

    0x22          Read Register 2 (STAT_1 register)

    0x04          Value in STAT_1 register, which maps to F_RESYNC

    I'm not really sure if this is a SPI error vs a momentarily fault that we recovered from. I'm trying to add logic in my code to do hard reset on the ADCs every time I load my program on the M4 and hopefully that will fix the issue. More shortly.

    Right now, I'm struggling with a different issue which I posted on another thread. Basically, the DRDY from all 3 ADCs are connected to a GPIO that should generate an interrupt when the DRDY is asserted, indicating the ADCs have conversion data ready. My code is running on the M4 and the DRDY pins on the ADCs are connected to pin MCU_GPIO0_7, which maps to MCU_UART0_CTSn (A6). Is there an example that shows how to configure a GPIO interrupt on M4F? I tried to follow examples/drivers/gpio/gpio_input_interrupt but no luck so far.

    Here is my other thread: AM623: How to setup GPIO IRQ handler - Processors forum - Processors - TI E2E support forums

    Thanks.

    -Ayman

  • Hi Ayman,

    I load my program on the M4 and hopefully that will fix the issue. More shortly.

    Please let me know how this goes.

    Please continue your discussion on the other forum with regards to GPIO. For the GPIO issue please read through the following to see if it helps you upto some extent: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1504886/processor-sdk-am62x-gpio-toggling-delay-inaccuracy-on-am62x-m4f-core?tisearch=e2e-sitesearch&keymatch=gpio%20interrupt%20on%20m4f#

    Regards,

    Vaibhav