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.

MCU-PLUS-SDK-AM273X: AD7389-4 ADC connection and data acquisition.

Part Number: MCU-PLUS-SDK-AM273X
Other Parts Discussed in Thread: LMX2595, LM2595

Tool/software:

Hello team,

We are planning to use AM273x to connect with AD7389-4 ADC via SPI. Is there any sample project code we can follow to get 4-channel input data so that we can do further processing on those data.

Any advice and suggestion will be appreciated.

Thanks for your help and support

Best regards,

Lin

  • Hi Lin,

    Since the AD7389-4 supports serial 1/2/4-wire mode, you have to set it to serial1-wire mode in order to connect with AM273x MIBSPI which can be set to either 3-pin mode or 4-pin mode. It means you have to connect CS, SDOA, SDI and SCLK of AD7389-4 to AM273x MIBSPI.

    The software should be straight forward. Please follow the instructions in the INTERFACE section, Serial 1-Wire Mode.

    Best regards,

    Ming

  • Hi Ming,

    Thank you very much for your support and help.

    I will check the datasheet and catch up it.

    Best regards,

    Lin

  • Hi Ming,

    Here is an update of my status. We ordered the AD7389-4 evaluation board. Once it arrives, I will do more test and get back to you.

    Regards,

    Lin

  • Hi Ming,

    We have received the EVAL-AD7380-4FMCZ board and wait for EVAL-SDP-CH1Z board. Are you familiar with those two boards? Can we directly power up the EVAL-AD7380-4FMCZ board and connect to AM273x EVM without EVAL-SDP-CH1Z board? 

    If we can do that way, I will prepare my code to test them.

    Best regards,

    Lin

  • Hi Lin,

    Both EVAL-AD7380-4FMCZ board and EVAL-SDP-CH1Z board are ADI boards. I have no knowledge of their EVMs. You should ask for ADI's help!

    Best regards,

    Ming

  • Hi Ming,

    Sure, understood. I am doing that.

    Best regards,

    Lin

  • Hi Ming,

    FYI, the EVAL-AD7380-4FMCZ has been power up in standalone mode. Now it is connected with AM273x EVM via SPI as shown below.

    However, when I run my code to configure the AD7380-4 chipset on the EVAL-AD7380-4FMCZ board. It seems the results are not correct. I try to power down it and bring back to normal mode, set to 1-wire mode and read back to verify it. But I can't get expected results. I share my code and Saleae capture file here. Could you help me to check if I did something wrong or I missed anything? Oh, the SPI setting is same as I did for LMX2595. It's 4-pin mode wire to J16.

    void sendAD738xWrite(uint8_t regAddr, uint16_t regData)
    {
    uint8_t txBuf[2];
    uint8_t rxBuf[2] = {0};
    MIBSPI_Transaction spiTransaction;
    int32_t transferOK;

    // Format: [1][ADDR(3 bits)][DATA(12 bits)]
    uint16_t frame = (1 << 15) | ((regAddr & 0x07) << 12) | (regData & 0x0FFF);

    txBuf[0] = (frame >> 8) & 0xFF;
    txBuf[1] = frame & 0xFF;

    spiTransaction.count = 2;
    spiTransaction.txBuf = (void *)txBuf;
    spiTransaction.rxBuf = (void *)rxBuf;
    spiTransaction.peripheralIndex = 0U;
    spiTransaction.arg = NULL;

    transferOK = MIBSPI_transfer(gMibspiHandle[MSS_SPIB_J16], &spiTransaction);

    if ((transferOK != SystemP_SUCCESS) || (spiTransaction.status != MIBSPI_TRANSFER_COMPLETED))
    {
    DebugP_log("AD738x SPI write failed! Reg 0x%02X\r\n", regAddr);
    DebugP_assert(FALSE);
    }
    }

    uint16_t sendAD738xRead(uint8_t regAddr)
    {
    uint8_t txBuf1[2], txBuf2[2];
    uint8_t rxBuf1[2] = {0}, rxBuf2[2] = {0};
    MIBSPI_Transaction spiTransaction;
    int32_t transferOK;
    uint16_t readback;

    // First 16-bit command: [0][ADDR(3 bits)][don't care]
    uint16_t cmd = ((regAddr & 0x07) << 12);

    txBuf1[0] = (cmd >> 8) & 0xFF;
    txBuf1[1] = cmd & 0xFF;

    spiTransaction.count = 2;
    spiTransaction.txBuf = (void *)txBuf1;
    spiTransaction.rxBuf = (void *)rxBuf1;
    spiTransaction.peripheralIndex = 0U;
    spiTransaction.arg = NULL;

    transferOK = MIBSPI_transfer(gMibspiHandle[MSS_SPIB_J16], &spiTransaction);

    if ((transferOK != SystemP_SUCCESS) || (spiTransaction.status != MIBSPI_TRANSFER_COMPLETED))
    {
    DebugP_log("AD738x SPI read failed! Reg 0x%02X\r\n", regAddr);
    DebugP_assert(FALSE);
    }

    // Second transfer to receive readback data
    txBuf2[0] = 0x00; /// Dummy write to receive readback data
    txBuf2[1] = 0x00;

    spiTransaction.txBuf = (void *)txBuf2;
    spiTransaction.rxBuf = (void *)rxBuf2;

    transferOK = MIBSPI_transfer(gMibspiHandle[MSS_SPIB_J16], &spiTransaction);
    if ((transferOK != SystemP_SUCCESS) || (spiTransaction.status != MIBSPI_TRANSFER_COMPLETED))
    {
    DebugP_log("AD738x SPI readback failed! Reg 0x%02X\r\n", regAddr);
    DebugP_assert(FALSE);
    }

    readback = ((uint16_t)rxBuf2[0] << 8) | rxBuf2[1];
    return readback & 0x0FFF; // Only 12 bits are valid
    }

    void mibspi_loopback_main(void *args)
    {
    uint16_t readbackData;

    Drivers_open();
    Board_driversOpen();

    /// 1) Power down AD738x-4
    waitForUser("Step 1: Powering down AD378x-4 ...");
    sendAD738xWrite(0x01, 0x0001); /// R1-D0
    ClockP_usleep(10000); // Wait 10ms

    /// 2) Back to normal mode
    waitForUser("Step 2: Back to normal ...");
    sendAD738xWrite(0x01, 0x0000); /// R1-D0
    ClockP_usleep(10000); // Wait 10ms

    /// 3) Software hard reset
    waitForUser("Step 3: Software hard reset ...");
    sendAD738xWrite(0x02, 0x00FF); /// R2-D7--D0
    ClockP_usleep(10000); // Wait 10ms

    /// 4) Check diagnostic self test results
    waitForUser("Step 4: Check self test result ...");
    readbackData = sendAD738xRead(0x03); /// R3-D8
    int retries = 1000;
    while ((readbackData & 0x0100) && retries--)
    {
    ClockP_usleep(100); // wait 100 us
    readbackData = sendAD738xRead(0x03);
    }
    if (retries <= 0)
    {
    DebugP_log("Self-test timeout!\n");
    return;
    }


    /// 5) Set up 1-wire mode, no oversampling, no alert, no boost, no CRC
    waitForUser("Step 5: Set up AD738x-4 ...");
    sendAD738xWrite(0x02, 0x0100); /// R2-D9--D8 01-> 1-wire
    ClockP_usleep(100); // Wait 100 us
    sendAD738xWrite(0x01, 0x0000); /// R1
    ClockP_usleep(100); // Wait 100 us

    /// 6) Read back any other register to confirm above setting, (1-wire, no oversampling)
    waitForUser("Step 6: Read back status ...");
    readbackData = sendAD738xRead(0x02); /// R2-D9--D8
    if (((readbackData & 0x0300) >> 8) != 0x01)
    {
    DebugP_log("AD738x is not in 1-wire mode\n");
    return;
    }
    readbackData = sendAD738xRead(0x01); /// R1-D8--D6
    if (((readbackData & 0x01C0) >> 6) != 0x0)
    {
    DebugP_log("AD738x is not in no oversampling mode\n");
    return;
    }

    DebugP_log("AD738x is in 1-wire and no oversampling mode\n");
    ClockP_usleep(100); // Wait 100 us

    DebugP_log("AD738x SPI operation complete.\r\n");

    Board_driversClose();
    Drivers_close();

    return;
    }

    And here is one of my Saleae capture file:

    PK}��Z
    digital-0.bin�	v�qut�cb``Ha```d```H=;�1��So#�o����� )$�����22�BE>m��6��"W�J�K¡�����@�~��
    ��9s���GRbb�7�Xy����g¤�ד������Q�~/����F�;;J8���a�Q\�w�q��/B��C��n�~}q��%�,��x��a8�	i�HH8{�CB��ѫ�APK�Ze�@PK}��Z
    digital-1.bin�	v�qut�cb``Ha```d```H=;�1��So#�o���� )$�-c-��
    ux���)L8�˗$������w�&*=OE"�����7�&���/�&���d&L|ǚg�h�����������s��7t����~�&w6d�8D��F�ᩚO��fI4E�N�^���^�WPK[�&�>PK}��Z
    digital-3.bin�	v�qut�cb``Ha```d```H=;�1��So#�o���� )$0=k-��
    ux���L8�˗$�������?&*;OE"��
    ����E���₩���¥��'`�q#���k�	���3rt���Z�{o/;L���=��r����R����-�!ّ����Q�s�~8��|�Rq�y�>����A=����f��B�	V� �f� �%������PKKI���PK}��Z
    digital-2.bin�	v�qut�cb``Ha```d```H=;�1��So#�o���� )$�=c-����
    ux���L��˗"����w�&*7OE��*k�l�i�wo!'LR�C_�f7HQ��K.0��τь14t�q���w�&ydv�(D�.�d��wa�&�K�!�PyCCCGwC�7�`�5�Ô000��e����UIPK����GPK}��Z
    digital-4.bin�	v�qut�cb``Ha```d```H=;�1��So#�o���� )$P����e��:<�z�&����gd`�J���_���"�R������L~�f��T�p��R�f��L��5τQU:�9�9J8z�f���+Sqxv�(D��bp�5vtu�4rtsss(sd4p�p�0ttw��~���|�Rq�y�>��݌�9ԃ<!e�����B�	�F$��!Pc@:>z�'PK:����PK}��Z
    digital-5.bin�	v�qut�cb``Ha```d```H=;�1��So#�o����� )$�����22�BE>m��6��"W�JK�iT��s��߽��0}��B��7�Xy����g�x�ˠۯ'�{o�
    L���=��^�ݏ��A�9�L?�K�N?�3�E�Rq������Я/�����H<�Ʉ0���%�%$���!!����� PK�i��@PK}��Z
    digital-6.bin�	v�qut�cb``Ha```d```H=;�1��So#�o���� )$�-c-��
    ux���)L8�˗$������w�&*3OE"�����7�&���/�&���d&L|ǚg�h�����������s��7t��b��~�&w6d�8D��F�ᩚo���I4E�N�^���^�WPK1`s�>PK}��Z
    digital-7.bin�	v�qut�cb``Ha```d```H=;�1��So#�o���� )$�=c-����
    ux���L��˗"����w�&*7OE��*k�l�i�wo!'LR�C_�f7HQ��K�0��τQ�124t�q�w�&ydv�(D�.�$��wa�&�K�!�PyCCCGwC�7fF �5�Ô000��e����UIPKt&�L�GPK}��Z	meta.json�[o�8����}�bŬx���>��SL2�֙b��bA��M�,e%�m&�_��9���i1���Q<���o�<��l;��`���9�݂V�B���2�\K�H�\K0��~]�5�
    �����A,�Zɹ,������ILI�eGIm
    ^�7�Zt`�DQ�$�Y��X��8�A�����s�[md��Z}5���R�FJA�`L�!([^h�Լ�~-:a�;k����]������5W���]V�w�V�d�;0��S�j�<��e�����V�y�'�ނ�����_��Y�� Bu������
    f�G��Y��@jn���A:���F�-�JW���bn�t�TZ]��Ӳ
    .�:��,��u���`V򪓣�I��.y]K����� ��V��g^�%�ỻpb����˂��ƀ�����-N���}��$xuz��__�Y�k���і�j��-�����|�i�\V��/�c���e�\-jU���:x����x�~^�rٞ��Tn��g҃&��Z4_�+�U��N��T����\�Z�Vضn��`�~T�VFN71;W:hڠ��Q��@���VJk)����N	o�;Ϭ���!;��KCw�&����Q��e\[J�~G?#ӏ;��{��[
    6
    ��}N����-�:�0o)�!%��;�$�R��tW�S��=��C`�+�	�3�y�A�K�$#���f�O3r��y6k�����\H#��j�O5ra�\?�!rь�qF.��?���3���x��<c�؟g����]<c���g��3v��y�.��?���3���x&�<�ğg����L\<���g��3q�L�y&.��?���3�癸x&�<�ğg����L]<S���g��3u�L�y�.��?���3�発x��<S�ԟg����L]<S���g��3s���yf.��?���3�癹xf�<3�̟g�����\<3���g��3s���yf.�c�cϱ?ϱ��؟���s��s��9��9����t�@�?��տ�a^�Eu�Y�%���u�jsD�Y�N//΂��0oS��e\6o��1o�G����Q�j�ܣ=�=�qzr�}>:����i�=}�5T|�AS��3Ʌ��������1���c+��O8u�ګ��jG�^�Z���}�w�Z�xp������X�R�4~�Cj�}���q�b
    �OUL������-�/�k�W6(0���n%_]5W�]��W`x>���N��^�����c��-z��zL�&
    ~C���BE�֨v�'������:����*b[���PQ�eȃ�Ȗ/��pxCE}�l�'����aٵ��_J9w�׾�[���o
    \{ǖ���ks�7pm
    ���q�{=\wa}��CE��s=���|���1T�8?�P���9����k	}���1T�8?�P��q�������:���G,BuO�������I���'�P<ם{b6�P���)�u�;���*�Lܩm�t��� %��4�R�sH�TB^&������0!XJ�XjxB!P���$~TB�z�(4D��;A�KI�?�_2׈
    ��io�Tr��[�U��&!?�Bn���X�5�H��%) �2���,�0�h�	b����,���t���>�l-.J�J"9�"AZ&%�yNa��˔��S��������tr_˚\���$0/�҄H�I�`Jp��Ź4a�
    Y�or�{���/k��Xq��rH�B�,�3�e1)�$��xj�����
    ���◫��ч{_�9�������\
    S�<���1�N�}m?=��a��Vs��<��$�����#F
    ��8ƄM�����O����]��5��9�X^�JT0H�0xpHh�$�����XW�ߚ��/$���[���e҈���YӘ1�ǹ</S��Ք}�A�\\m&�p��o�6{A�R��ꫬ�
    ]L2���0�p��n^5����V��Z��cq���6��H&EP�9��3�0KJ�`�F���8�o��h����nӞݦ�,�q�N�E$e�W�h:G�9"PdCʢ�L���*(�d�׽��Yc_������6唠�$0�TB���E����S�B����>�;��o�Tb���P$\B�H`���H�fi4]�P�ݫ�R�l{�/��}��y�p��H�T0��B@��DT�1+����J����n�Z˾Ak�"��,=H�KH	�0�D��JV���2���j�׬����7h,�)ƴ@�ȢԌP)�L eIAD˴�nj��l���&ġ ��$1n�nA�.K����<3%��Mў7B��nA���ץ�혰�LE�Z5�鐡b"W�je_��W�Z
    �1��^Q��3]�j�0Z6�n��,k=n��x����~��Au�6���ߥ��-��Nv����ɰ�Bp��:�v�r�3�&�Pu���`ſڿͮ	tEs-���z��n�T�g�!Xޘ��SݥlYk���$�F�L�׺1NS���{ŤA϶2���`��f��|����hV����ʨ
    ���u�W��U��%(0ëfa�S����s�3yȚ��]�?��4�Q@�4KBF���Ef�>d9k�.�&��Fl��۶�mL���j���n�M���RZI�eX��n=6�H��
    ���4]o�Ջ0W�bQI�Ysz�6~�^���j� eϫ����y�v����=�֎2z�����Q�R��Z;�⃔=�֎�� e��2�2��J~�Z^Ls��k3��iI�o6O��M?0>^�~�)�Y����n?t��on�8(�zF��[�\Js��3��7��t?�nf�-�ɮh��'�t���M�;`e=(K����M�'3�^.o:U�j3b�f���	���N��и���}í�(����~�Wh������v_����+����W��{#�vN�gn\	m�����}6�}���򝪴lͻ�w��&1��1����S��s2C#D�"<Χsٙ\h�9L6�І�6��ze�&ݎY��YkU����W6�@�(��`���[Y�u�7e9��O�̙�bY!�_�j-件Y�%o�e_��f9[�~~�{4&v��Wc��A�S�]�����fZ�GB������;U�o%b��ܣ$}\�(�Q5\���N���b\t���4fځ[Su����p���nӯ���v����m���ki#*�ʶ�Zٚ�}�9��|�3�#c����~��{����F��w!ȕ��d��	A�l����NrUۡ���!�H"vH�/�Hɋ$�܄�H_$�9$�I��IL�^⧻�PK���X�sRPK-}��Z�Ze�@
     ��digital-0.binPK-}��Z[�&�>
     ��digital-1.binPK-}��ZKI���
     ��digital-3.binPK-}��Z����G
     ��*digital-2.binPK-}��Z:����
     ��(digital-4.binPK-}��Z�i��@
     ��Wdigital-5.binPK-}��Z1`s�>
     ��^digital-6.binPK-}��Zt&�L�G
     ��Pdigital-7.binPK-}��Z���X�sR	 ��Pmeta.jsonPK		l

    Thank you very much for your help and support.

    Best regards,

    Lin

  • Hi Lin,

    From your Saleae capture and program, I did not see any issue. The question is what is the default mode for the AD7380-4 EVM. Is it 1-wire, 2-wire or 4-wire mode? As long as the Saleae capture matches with the AM273x MIBSPI output, then the AM273x is doing the right thing. I will not help you to debug a non-TI device further.

    If the MIBSPI input is incorrect, then you should ask for ADI's help. You can share your Saleae capture of the whole setup stage. They should be able to tell you where the problem might be. 

    Best regards,

    Ming

  • Hi Ming,

    Thanks for you reply. By checking the datasheet of AD7380-4, the default mode is 2-wire mode. And AD's support person told me the SPI mode should be 2 not 0. However, when I changed to SPI mode 2, still not working.

    Yes, totally understand, I'm working with the AD's support team. Your verifying AM273x side SPI and code works well is great helpful for us.

    I will continue working with AD's support team and will update you once the issues resolved.

    Best regards,

    Lin

  • Hi Ming,

    May I ask questions about Saleae Logic Pro 8. As I just ordered and received it a couple weeks ago and I installed SW Saleae Logic 2 (2.4.29), is this version of SW too new?  I remembered you said my capture is kind of strange. Should I install an earlier version of SW for the Saleae Logic Pro 8? 

    Since we still have the issue of SPI mode not match each other for AM273x EVM and Saleae capture. I want to sync your setting and get the expected result.

    Thanks and best regards,

    Lin

  • Hi Lin,

    I am using the Logic 2 (2.4.29) the key is the Logic Pro 8 can capture the signal at 500MSPS, because it has USB3 connection. As long as you can set the sampling rate to 500MSPS, then you are OK.

    Best regards,

    Ming

  • Thanks Ming, I will try to set to 500MSPS as well.

    Best regards,

    Lin

  • Hi Ming,

    Is there any way I can confirm that SPI MISO line works fine on the AM273x EVM as so far both readback from LM2595 and AD7380-4 are all failed?

    So I want to make 100% sure AM273x side is working well.

    Best regards,

    Lin

  • Hi Lin,

    You can do external loopback (connect the MOSI to the MISO using blue wire). You should receive what you send out!

    Best regards,

    Ming 

  • H Ming,

    I did it. Although the data is same on the MOSI and SIMO, there are some pulses on both lines as shown below. Is that okay? or my external connection cable to too long?

    Thanks and regards,

    Lin

  • Hi Ming,

    More information here. I shortened the external loopback cable for MOSI and SIMO. The setup of connection is shown below (hope you can see it clearly)

    After I run my code 2 SPI write and 1 SPI read, on the Saleae the results of MOSI and MISO are different as shown here.

    Here is the Saleae capture file for your reference.

    PKd��Z
    digital-0.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��30�������8y���*����-i�py�V%��Tڡtd�'�P��Pu�'�ܵf?TI2����j�Q]��Ȃ��8�0߭ԡ��,� p�!"5�g9����!5.�f�8PK�[3���PKd��Z
    digital-2.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��30����@��8y�*����}^��˒�J qF=�4�G�#�C-�C%�C-�C�S9����d�#SԭO�0��?T!�H���bp.bp�`t,!�
    �����0�� :��:�+@��6#���x;Α�'$�T��̮at�dp�����u<U`�,���PKjd^��TPKd��Z
    digital-1.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��30������
    9i&�x��GS��5q� iF�����0�o�[� �lP���[�<`�:f?TQ������"�dA������T��:�aO7tY6��PK������PKd��Z
    digital-3.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��30����@��8y�*����}>��˒�J qF.�4c��#SԭO�09y��5lp5Q���0q�YyA���gIG�O.��.�f/�PKv�%X��PKd��Z
    digital-4.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��C�@�pp �d���]���PKƤt=RPKd��Z
    digital-6.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��C�@�pp �d���]���PKƤt=RPKd��Z
    digital-5.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��C�@�pp �d���]���PKƤt=RPKd��Z
    digital-7.bin�	v�qut�cb``Ha```d```H=�ֱ����F��{�]}O��C�@�pp �d���]���PKƤt=RPKd��Z	meta.json�[o�8����}�bͬx���>��SL:��AvP(����%�D����R��1��q�],�'G�9<����=�"�FV%��d8S��A-J.�OR|](�����6��
    +�K���Z�(D�~�Kq+�b!20��,HH�8	�Ì҅+�U�0�ϒ0 �F���0ۨm-��J��*�����E!��6�B���h�eJV%+vo��"��_����Cԍ�~>���Is��aւ5�Z�E�0�����ru%���d�ݟF���F�ރ�*���_ޅI��`�l6��ȸ���g�q��5+��L7,nރh�R�\j}�@IU��]���Pr�/�F�ڻު��(��/[5,-������Ŋ���j���G�ﭬGu��b+�?<�F�_\�,x_�\o�w���XpQT�;&�+ޛ��_�z�fUo�tM�w�Tj��hn/yo���Q�LoG��:CЎ!�,e.3V*���~�0��]������\m�k҂��jë����4^U��'�w�n��f�X�Y�M[�j��<�{j%���ӌ�N���+���S5+��TJp/�������;�����!{�=JC�G�Ǥ����6��n�-�����~�{ڞ�{��Y
    �
    ԴϜ8K!)�Y
    �H	��)����"%r�Y���R^z�a�-�}�/ �X� �Y�mr^A2��qg�`F�4#�ȝgd��lH#w��
    j�N5�a�,\��!�ь�qF6��;���3v��x��<c�؝gl���m<cw���g��3���y�6��;���3v��x&�<�ĝgb㙸�Ll<w���g��3��L�y&6��;���3q��x&�<�ĝgb㙺�Lm<Sw���g��3��L�y�6��;���3u��x��<S�ԝgj㙺�Lm<Sw���������s�γ�%�[��<6�w�ρ;�z�n�]�<6�w�ρ;ρ�������s��s`�9t�9�����x�ym<��<�6�Cw�C:�j�w6��
    �vG��m�Zd�]U_��+Qz��[�_�����������7��R�M+�*X-՝�{�*�Y�?��jB#zV#zF�x�nw�3rŚ����7z��d�}b��^Uz��+��,��h��|��_�ҡ����:���f���;�]��ѻO�]k���d�#]�m�����-��v����.V���V�����?ͪ��������mܠQ�`���V�kY�t׻Y�)+.�s0G��>s]��A�S��!a"�7��)T��j��"�c�y#w���w�������PQ�cȓ�Ȏ/�owx
    �BEm�l�'
    ���n�6�r�JYW�ۺ�}Y`[�/
    lk˒���϶8p_ؖ�P�0�=��^�۰>��~N����9��^��>�����*z��S��y��BE/��6�>�����*z��S�����ϧP��~�BE�-.��>�?��v��*z�šٜBE��Su�=���*�:�TW_���d��`Rq��i�RH�X@�Gơ��(O03�r�R:�f@6���Yr.��P����%]��xTH#ʘ˪�sP�%��tl�=
    v)�R�M\|�����X�1��9� "�����0�i�	
    XƳ��I�l���?��6�l,�r�D0��؇4�r����<�	q�4[��-�Nw������Z��<M��$�i��FD@F���8̂0:��s��9b����4�=�eL�1�<E�A�g&a��$	IN�c�ݽ|~����������s���!����Tpc�,�"�![N���Y~q�^�6^ig,JY�Q( �}#��(���`l�����8��mx�؝�$H3�B�����4%�"
    y��hl�;�*��呌��qcx#���B�9�y��8����,�c��4��ݵ>�Z-u4�ioݞg���o�7Q���c�P�'$��8�h�>��ju!J%�O�R�i:a���!�S)!&܏a�$�,�Q>�Dq��t�~����>�kk:I��8�Q#��A�Mg�G!C�cH?�,�#(�y�2��y������1�t<�t|hSQJ	�rcJ�q�a�%	�0&a�yHБMm�-9읜j*�M%�w�Iy��~�@d�S��$���8?աr��Z���Op}��M�4�K��3i���	��H� �'��I��[�2�M58�
    γs=!)�!%�„*���T��xuD���~��cL3�ďuGCF�� ��B�����ۻ�<|\�jptD�??f��T� �湨�O�!s�P�MUQ��x\{݃FU��\�z�_a�UT�uU^tY+FrU-�����q�U�u�(�M������u�m-�K��Oq�Q�aY���ج�sۮ�>�F�zP���;�]��MըΎ�����l�E#.�5�yL"
    Y�Y�^g��7�[��@�U1՞�v�U-�UU�O%g`u�3]�F67��D��R�S�XW\g�8ߪJ�<U���|x*Ɲ[9�`Eg�~,�V���n��X����-�64l��Iz|�r�h��t��)fKM_ww5��Ӫ�����i?�6�-)�I�D!Q@�`�z��e���2�n��39HL��ۦ覮t�lr�-���e��؆���J
    �$�r/v.�%��΀,�Џ�4��7n���Y}���6��N�7�j�U�����J�a����W);�֞2�*e���S�J�a�����RvX�=eѫ�=WKy�֛B|dJ\��t[ns�����ns�_6G��{��{�ZX��VS{�g��jմs1l�ܹ�)߹F[5;�lJ:sv�뚨�N�ѴUv�'���Ɵ`��>U�j����,�,#g�o}�gݝެ������!=���΀nr�ݡk����{��5���
    ͉��B�i�T���v��|0Uh���*��Y��h3�� �����P����o��ƾ��e!U�z'%j}�h�;L��A�Ln���hgZm�1|��%ԏ�0�.D�s�yzgY�D��L_۵Ρt?�{�E�d.[dӞb�O�|�\���ʹK��m����5���>��H��oY���]]���٪��`R��E;�߃	��Y�Nj�k։�*2�=����tk'� ��`RM[ߪ¼$3�G��	%��:	Ϫa������=��g`
    uc���@��Z6�tU]�_U�?�~�7�e|ӿ����V�K7��v&�z������J�l)S���{�TK3��u3�_+�gq<�@*��%�_�U��ȥ�Jw������Y*K�k�F�N��T":J"�H�GI$��(��"�%1�H��Z$�GI�,�V���PK��[��}RPK-d��Z�[3���
     ��digital-0.binPK-d��Zjd^��T
     ���digital-2.binPK-d��Z������
     ���digital-1.binPK-d��Zv�%X��
     ���digital-3.binPK-d��ZƤt=R
     ��cdigital-4.binPK-d��ZƤt=R
     ���digital-6.binPK-d��ZƤt=R
     ��Sdigital-5.binPK-d��ZƤt=R
     ���digital-7.binPK-d��Z��[��}R	 ��Cmeta.jsonPK		b

    Could you help me check out the cause of it?

    Appreciate your help and support.

    Best regards,

    Lin

  • Hi Ming,

    Sorry I missed one thing. The data on MISO is the correct command sent out by code. The MOSI data is wrong with too many extra 1 bits.

    Thanks and regards,

    Lin

  • Hi Ming,

    One more result. If I take away the loopback cable, MOSI data is clean and correct (and different from MISO).

    Best regards,

    Lin

  • Hi Lin,

    The external loopback result looks OK. The short spikes (8ns) are well synced with the clock edges. My guess they are caused by the signal interference.

    You can try to capture the analog signal at 50MPS for the MISO and MOSI.

    Best regards,

    Ming

  • Hi Ming,

    I have good results to share.

    I swape from J16 to J7 by changing S2 and following your SPI pin outline you provided in another post.

    Now the setup is as below

    When I run my code, now I get clean and matched MOSI and SIMO data as shown here:

    The Saleae capture file is here

    PK6��Z
    digital-0.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�30���������@\FV������K`�W�K)A�ݠ�5��#�C�C5V����P�f�)�܂�*U��k���CM��3AsdB̿H��Y��ΡƝ͡��t~E�����Yj�$�WD�	�Z�E�*PK #����PK6��Z
    digital-1.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�30����@���r .#+T����e�0��RJq6�t�V�~����*UT�t�����2!�P������uOǧ;�,��PPKg(!|�PK6��Z
    digital-2.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�30����@��.)���*�xe՗*�p���rq�t┍50ш�RJ�PY�
    �NJPW���53�`*gW�BT� �,v����Q&��H[�<�J������+C�F�T00Ȅ��9ۥ��nPK`�6��	PK6��Z
    digital-3.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�30����@ͮ.)���*�xe՗j�p���rq�t┍50���RJ�|0�U�Ŏ������kf���dW�B�q�����Q&W�H[�F����c��Ga���C�02!*aNv鹰�
    PK�����PK6��Z
    digital-4.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�C�@�pp �d�������PKݳ�8=RPK6��Z
    digital-6.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�C�@�pp �d�������PKݳ�8=RPK6��Z
    digital-5.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�C�@�pp �d�������PKݳ�8=RPK6��Z
    digital-7.bin�	v�qut�cb``Ha```d```H=�ֱ�K��FN�yq��O�C�@�pp �d�������PKݳ�8=RPK6��Z	meta.json�[o�8����}�bŬx���>��SL:��AvP(����%�D����R��1��N�],�f��9���x;�_D�ʺ3�� 犃�=hD���_�+�/���3pë�*�W]��JQ��򅸕+1��3�(C$�1�b(]��R�PWyf�Y����1�4��d|�6��+�(-Qk�T���A��l	(b������E�3%늗۷g(!у�AV���C4��>�`ͥ�������+Q��~�샥\,��Q�W���������=��n���]��I|��v]�<����,��\dr�K������{�V(%���w�T�.�p=�e��K%��o�h���yɿ�}թ�i)r0+xيQڤ�.����V�u�>�od3y�/7��Ã?�����f��j0�z���d˂�����2�\��\\���WkV�F���z����J�tKsw�{3����Rd��v�������E%��Jyo���#�9���*͕l���Z�&hyS���ku+�)�W�*�:�lZ彙+^��M]��F0;?x���Rx+-����J�ՍW
    n)���^�+��ȽB��F���;�����!;�=JC�'�������֢�n�-�h~���n�m�۽��,�
    �j�6'�R�E
    u�B-R��f�:K	-R"g)�EJ�+�W���"0���E
    
    �Š�&���M�;��3r��pF�<#�ȝhdC�3�lP#w��
    kd����f�3���y�6��;���3v��x��<c�؝gl���m<cw���g��3���y�6��;���3q��x&�<�ĝgb㙸�Ll<w���g��3��L�y&6��;�zm�;�s��x&�<�ԝgj㙺�Lm<Sw���g��3��L�y�6��;���3u��x��<S�ԝgj㙺�Lm<3w���g��3����yf6��;���3s��xf�<3�̝gf㙹��l<3w���g��3�����x�ym<��<�6�Cw�Cϡ;�!�l5�[z�f����6�:-�����ץ�<Y�-�/�{sqs}����yC����qS����N�=n��N:F�?��r�F�F�������ho䒷ۻ��wo�+�����K�{u�uj��e��tD������ڕ���&���=jo.��{�k�>z��ީkm{�ޕ�~�k�m�RVB{���Tc�®��<��j8_ڪ�������.��+��&(0���j_�ַ�YɊ���އɺ�NU��}f(�g�a�K��?u�&�~C���BE�V���*�[�7rk۾{G@��m)�/���-C��D�|�}��S��*�dc<i>v˶���Tʺ2p`����۪�}Q`[X����Ł����48���I�)T�Bp݆�)T4�s
    =��)T�l��)T4�_�P����BE���*z�?�)�)T4�?�P����BE/��6>�����*�n��}��C���IO���P��=1�S�h��C]k���?����;5��v>=$s0)�r�h)�)�i, /"�PP�IT$�,�\,�<!�֜|��y.��P���M%]��xTH#ʸ���3P���tl�;
    v)R�M��"315�u�Dc2y�$�\�Rsȓ�$�&��,�&&'������w�ecqV V�a��"*`�S
    �� X�,c4�Z��-�Ow
    �?���y-cr�&\P��HH#" '1�1�!3�B�q.����.��J��^�d-�0�QD9�E��$L�$!)� "�xj����/#������|t����y�9�aN!%4���	�E��tj9uvvo���wx�x�1��(�	GPD���0�`0�Q�!&lj���8>�û�;�	K3�B�2id�	
    �y��hj�;�#*���+�b���8F<A	�4`�E��8d�a*r�1
    �����Za�:����γ�sR�F47�(�Q]L���0�p�È�����Q�R���!5_9���H��EJ %��$b�D�0�TL;Q�Wݥ��Wu�0�g��$IBc��8F��p�U�(@!G�I�!eAyRDP��e������������x��UE)%(+�)��E�,I`��1	�<	zeU]Ɲ}U%ߡ�D��1�aqi�%��,�q��D�8���<�2�V;!��j_��w�q�E�y�<��9�1�r�s!i�
    }�}�T_c�qn_��w�p��8���R�)L(�aB�H@EOgQ��������	:���>��%4ƘffI�*���,�H��".�����;�<|\�Wa����
    ~�.1.��A�)
    ����C
    f$�p����P��q�uZU��%�1��6�z����>k�D�j���ޗ=.���seLRa<�dfu���BkB��ETj\V��;9�ݪ�le�����y/��w��[����ϐu��`�)[q�i��#`iȪO���f~�h�z-���jوvY��SI,�t����F4��_�n*�U����U랧.��[�d9�J4�����Y��#�G];0�>X����-�6��Q�^z|�s�h����)fG����j�AgV��K3M�~�&l�[R@�8�"B"F���z��g��2�n��39H��M�MS����jS���g�������J
    �$��_l]�)J�����r���T��7n�Ţ�Y}N�l|���z�h�CG);�e�(e�=����찧v�ѣ��Ԏ2v��Þ�Q�찧v�EG){�)��9_�K�+q=���o��0�;(����fh�l�����w�
    �>�;Mݹ�Qh�U��Ű�s�Z�|���l]�)��ٺ����:F�aT�r�h�F�@g��T��F֓�xo9#
    ?���fy�ʌ�C��	�a��Ƿt�[h:�]�V����[sxj_�9���|����|q���|���|��02g)F�͘6�4 LfBC�u�ߴͦ�����*[�����Wt��\� f&7�A6��V�f�,!,C:�s��h��Y�Y���&��f�s(ݏ)���R�����N�'B��\-�L�B��(��TCY�[�Ѓ�Nl"��[Vnr�Ws��l�=�`R��D7�߃=#�ݫ�hx/ª�L
    �DN�cӵݣ��يu�[U����d>�GI���Q³j�⿯�V���]���PWfh����W���?�w��
    -;L�f���o��n�n�	���zkR���M��⋎2h[��Mu4}_?���Vz��Ri�/��rGs|PH���������TV��<F"�HD���-�$�D�*��"��J"�Hd����)>m��U#�Ĩ����?PKb
    ��RPK-6��Z #����
     ��digital-0.binPK-6��Zg(!|�
     ���digital-1.binPK-6��Z`�6��	
     ���digital-2.binPK-6��Z�����
     ��|digital-3.binPK-6��Zݳ�8=R
     ��Zdigital-4.binPK-6��Zݳ�8=R
     ���digital-6.binPK-6��Zݳ�8=R
     ��Jdigital-5.binPK-6��Zݳ�8=R
     ���digital-7.binPK-6��Zb
    ��R	 ��:meta.jsonPK		U

    So J7's signals are better than J16. I will redo my test for the LMX2595 and AD7380-4 SPI write and SPI read.

    Do you have any hint or suggestion, why J16's SPI signal has that issue? I would like to resolve that problem for our prototype design.

    Best regards,

    Lin

  • Hi Lin,

    Good to hear your test result is correct now.

    I am not familiar with the board design. Please create a new thread for the board design related question. The HW apps team will help you on this.

    Please close this thread.

    Best regards,

    Ming

  • Hi Ming,

    Thanks again for your continuous support and patiently explanation for all the issue's solution.

    Good wishes for you and look forward to getting your support in the other post.

    Best regards,

    Lin

  • Hi Ming,

    Can we continue this thread? I met AD7389-4 data read/conversion issue.

    If not, I will create a new thread.

    expecting for your reply.

    Best regards,

    Lin

  • Hi Lin,

    Please start a new thread for your new AD7389-4 data read/conversion issue.

    Best regards,

    Ming