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: MIBSPI MOSI data is not correct.

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

Tool/software:

Hello support team,

I used MCU+ SDK sample project and AM273x EVM to test MIBSPI setting right now. I choose MSS_SPIB as standard SPI and switch the SPI signals to the J16 of EVM by setting the S2.

Now I can get the CLK, CS0 and MOSI signals on the J16. However, the MOSI data (3-bytes measured by Saleae Logic Pro 8) is not matching with my input data in the SPI transaction code.

Could you help me on that?

If you need my example.syscfg and modified mibspi_loopback.c files, I can share here.

Looking forward to your response and advice.

Best regards,

Lin

  • Hi Lin,

    Can you share your example.syscfg, linker.cmd and modified mibspi_loopback.c?

    Also can you share your Saleae capture too?

    Best regards,

    Ming

  • Hi Ming,

    Thanks for your quick response even in weekend.

    Here are my files:

    example.syscfg / TI DRIVERS (20) / MIBSPI 2/4

    Name                                               MSS_SPIB_J16

    Mode of Operation                           Controller

    Clock Frequency (Hz)                      5000000

    Transmit End Delay                         0x0

    Chip Select Active Delay                 0x0

    Delay Between Transmissions        0x0

    Data Size                                         8

    Frame Format                                  Mode 0 (POL0 PHA0)

    Transfer Mode                                 Blocking

    Enable Multi ICount Support           unchecked

    Transfer Timeout                             0xFFFFFFFF

    Pin Mode                                         3 Pin Mode      

    Shift Format                                     MSB shift out first

    Enable DMA                                    unchecked

    Number of Transfer Groups            1

    Show Advanced Config                  unchecked

    XBar Instance                                 MSS_MIBSPIB

    SPI Instance                                   MSS_MIBSPIB

    Signals                                                           Pins                          Up/Down

    MIBSPI CLK Pin(MSS_MIBSPIB_CLK)         PAD_AJ/D18            Pull Up

    MIBSPI MISO Pin(MSS_MIBSPIB_MISO)     PAD_AI/C19            Pull Up

    MIBSPI MOSI Pin(MSS_MIBSPIB_MOSI)     PAD_AH/C18           Pull Up

    MIBSPI Channel Configuration

    MIBSPI Channel Configuration      0

    Peripheral Chip-select                    0

    DMA Request Line                         0

    Add GPIO setting

        Name                            GPIO_LMX_CS

        PIN Direction                Output

        Trigger Type                 None

        Trigger Level                Low

        Open Drain                  Disable

        XBar Instance              MSS_GPIO

        GPIO Peripheral          MSS_GPIO0

        Signals                              Pins                     Pull Up/Down

        GPIO Pin(MSS_GPIO4)   PAD_AK/D19       No Pull

    mibspi_loopback.c file

    #include <drivers/gpio.h>

    #include <kernel/dpl/DebugP.h>

    #include <kernel/dpl/SemaphoreP.h>

    #include <kernel/dpl/HwiP.h>

    #include <kernel/dpl/ClockP.h>

    #include <drivers/mibspi.h>

    #include "ti_drivers_config.h"

    #include "ti_drivers_open_close.h"

    #include "ti_board_open_close.h"

     

    void mibspi_loopback_main(void *args)

    {

        int32_t             transferOK;

        MIBSPI_Transaction  spiTransaction;

     

        uint32_t      gpioBaseAddr, pinNum;

     

        ///uint8_t   reg_addr = 0x1A;

        ///uint16_t  reg_data = 0xAA55;

     

        ///uint8_t   reg_addr = 0x75;

        ///uint16_t  reg_data = 0x3355;

     

        uint8_t   reg_addr = 0x6C;

        uint16_t  reg_data = 0xCA55;

     

        ///uint8_t   reg_addr = 0x4B;

        ///uint16_t  reg_data = 0x6C55;

     

        uint32_t lmx_frame = (0U << 23) | (reg_addr << 16) | reg_data;     // 24-bit frame from LMX2595

     

        uint8_t txBuf[3] = {0};

        uint8_t rxBuf[3] = {0};

     

        txBuf[0] = (lmx_frame >> 16) & 0xFF;     // MSB: [R/W + Address]

        txBuf[1] = (lmx_frame >> 8) & 0xFF;      // Mid-byte

        txBuf[2] = (lmx_frame & 0xFF);           // LSB

     

        Drivers_open();

        Board_driversOpen();

     

        /* Get address after translation translate */

        gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(GPIO_LMX_CS_BASE_ADDR);

        pinNum       = GPIO_LMX_CS_PIN;

        GPIO_setDirMode(gpioBaseAddr, pinNum, GPIO_LMX_CS_DIR);

     

        DebugP_log("[MIBSPI] MSS_SPIB_J16 started ...\r\n");

     

        /* Initiate transfer */

        spiTransaction.count        = 3;

        spiTransaction.txBuf        = (void *)txBuf;

        spiTransaction.rxBuf        = (void *)rxBuf;

        spiTransaction.peripheralIndex   = 0U;

        spiTransaction.arg          = NULL;

     

        while(1)

        {

            /// start SPI transfer

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

     

            GPIO_pinWriteLow(gpioBaseAddr, pinNum);    // Assert CS (Active Low)

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

            GPIO_pinWriteHigh(gpioBaseAddr, pinNum);   // Deassert CS

     

            if((SystemP_SUCCESS != transferOK) ||

                (MIBSPI_TRANSFER_COMPLETED != spiTransaction.status))

            {

                DebugP_log("SPI transfer failed!\r\n");

                DebugP_assert(FALSE); /* MIBSPI transfer failed!! */

            }

            else

            {

                DebugP_log("SPI transfer succeeded!\r\n");

            }

     

            ClockP_usleep(100000);  // 100ms delay between transfers

            ///ClockP_usleep(10);  // 100ms delay between transfers

        }

     

        // Not reachable due to infinite loop

        Board_driversClose();

        Drivers_close();

     

        return;

    }

    Sorry, I can't find the linker.cmd file. 

    As I know, I can't share the screenshot in this post.

    However, If I input 0x1AAA55, on the Saleae Logic 8, I will see the 0x1A552A.

    Hopefully above info is helpful.

    Appreciate your time and help.

    Best regards,

    Lin

  • Hi Ming,

    One more observation to share with you. On the Saleae Logic 2, the total 24-bit CLK is not perfect smooth or continuous. There are a bit delay or gap between the 8th and 9th, 16th and 17th CLK. Or there are delay or gaps between each Byte. I guess that may cause the MOSI data shift. Right now I use 3 pin mode SPI. Should I change to 4 pin mode? After that mode changing, can I get the smooth or continuous CLK?

    Thanks and best regards,

    Lin

  • Hi Lin,

    Can you share your Saleae capture file?

    What is your data sampling rate for the Saleae Pro 8? Please try 500MS/s to rule out the possible issue caused by sampling rate is to slow.

    Best regards,

    Ming

  • Hi Ming,

    FYI, I'm using the Saleae Logic 2.4.29 SW. My current data sample rate is 125 MS/s under the Device Settings.

    Here are my Saleae capture files with input 0xAABBCC and 0x010203 at 125MS/s and one at 500 MS/s. With the 500MS/s sampling rate, CS0 signal looks like not correct and MOSI data can't be decoded.

    I tried to upload capture files, but failed. Here I share my google drive link hope you can get it. If not, please let me know.  

    https://drive.google.com/drive/folders/1RzEiPagliljvpkyLmSWQ5hYlT6CfKJRy

    Hope above info will help your analysis.

    Best regards,

    Lin

  • Hi Ming,

    I exported the SPI results to TXT files. Could you check them if they are helpful?

    Time [s],Packet ID,MOSI,MISO
    0.000000000000000,0,0x80,
    0.000001632000000,0,0x81,
    0.000003264000000,0,0x03,
    0.167827624000000,0,0x01,
    0.167829256000000,0,0x02,
    0.167830880000000,0,0x01,
    0.339265352000000,0,0x01,
    0.339266976000000,0,0x81,
    0.339268608000000,0,0x01,
    0.506126496000000,0,0x80,
    0.506128128000000,0,0x83,
    0.506129760000000,0,0x03,
    0.675963664000000,0,0x80,
    0.675965296000000,0,0x83,
    0.675966928000000,0,0x03,
    0.842658480000000,0,0x80,
    0.842660112000000,0,0x83,
    0.842661744000000,0,0x03,
    1.012745648000000,0,0x80,
    1.012747280000000,0,0x81,
    1.012748912000000,0,0x01,
    1.182049120000000,0,0x01,
    1.182050752000000,0,0x02,
    1.182052376000000,0,0x01,
    1.353211008000000,0,0x01,
    1.353212640000000,0,0x02,
    1.353214264000000,0,0x01,
    1.523284544000000,0,0x81,
    1.523286176000000,0,0x02,
    1.523287800000000,0,0x01,
    1.692477184000000,0,0x01,
    1.692478808000000,0,0x81,
    1.692480440000000,0,0x01,
    1.862212648000000,0,0x81,
    1.862214280000000,0,0x02,
    1.862215904000000,0,0x01,
    2.036054136000000,0,0x81,
    2.036055768000000,0,0x02,
    2.036057392000000,0,0x01,
    2.211083168000000,0,0x01,
    2.211084800000000,0,0x02,
    2.211086424000000,0,0x01,
    2.384303856000000,0,0x01,
    2.384305480000000,0,0x81,
    2.384307112000000,0,0x01,
    2.554037024000000,0,0x80,
    2.554038656000000,0,0x02,
    2.554040280000000,0,0x01,
    2.724111896000000,0,0x01,
    2.724113520000000,0,0x81,
    2.724115152000000,0,0x01,
    2.892326080000000,0,0x80,
    2.892327712000000,0,0x81,
    2.892329344000000,0,0x03,
    3.060881400000000,0,0x01,
    3.060883024000000,0,0x81,
    3.060884656000000,0,0x01,
    3.228299648000000,0,0x01,
    3.228301272000000,0,0x81,
    3.228302904000000,0,0x01,
    3.398728680000000,0,0x01,
    3.398730304000000,0,0x81,
    3.398731936000000,0,0x01,
    3.568656752000000,0,0x01,
    3.568658376000000,0,0x81,
    3.568660008000000,0,0x01,
    3.740561256000000,0,0x80,
    3.740562888000000,0,0x02,
    3.740564520000000,0,0x03,
    3.909759440000000,0,0x01,
    3.909761064000000,0,0x82,
    3.909762696000000,0,0x01,
    4.077943344000000,0,0x80,
    4.077944976000000,0,0x02,
    4.077946608000000,0,0x03,
    4.245860144000000,0,0x80,
    4.245861776000000,0,0x02,
    4.245863400000000,0,0x01,
    4.418276136000000,0,0x80,
    4.418277768000000,0,0x81,
    4.418279400000000,0,0x03,
    4.594937248000000,0,0x01,
    4.594938872000000,0,0x81,
    4.594940504000000,0,0x01,
    4.778453824000000,0,0x80,
    4.778455456000000,0,0x83,
    4.778457088000000,0,0x03,
    4.947135200000000,0,0x80,
    4.947136832000000,0,0x02,
    4.947138456000000,0,0x01,
    
    Time [s],Packet ID,MOSI,MISO
    0.000000000000000,0,0x80,
    0.000001630000000,0,0x81,
    0.000003260000000,0,0x01,
    0.177312326000000,0,0x80,
    0.177313956000000,0,0x81,
    0.177315586000000,0,0x01,
    0.349262566000000,0,0x80,
    0.349264196000000,0,0x81,
    0.349265826000000,0,0x01,
    0.518654418000000,0,0x80,
    0.518656046000000,0,0x81,
    0.518657676000000,0,0x01,
    0.689256234000000,0,0x80,
    0.689257864000000,0,0x81,
    0.689259494000000,0,0x01,
    0.857668770000000,0,0x80,
    0.857670400000000,0,0x81,
    0.857672030000000,0,0x01,
    1.025603422000000,0,0x80,
    1.025605052000000,0,0x81,
    1.025606682000000,0,0x01,
    1.194842878000000,0,0x80,
    1.194844508000000,0,0x81,
    1.194846138000000,0,0x01,
    1.368024806000000,0,0x80,
    1.368026436000000,0,0x81,
    1.368028066000000,0,0x01,
    1.537100758000000,0,0x80,
    1.537102388000000,0,0x81,
    1.537104018000000,0,0x01,
    1.706603634000000,0,0x80,
    1.706605264000000,0,0x81,
    1.706606894000000,0,0x01,
    1.877254388000000,0,0x80,
    1.877256018000000,0,0x81,
    1.877257648000000,0,0x01,
    2.045940352000000,0,0x80,
    2.045941982000000,0,0x81,
    2.045943612000000,0,0x01,
    2.216253914000000,0,0x80,
    2.216255544000000,0,0x81,
    2.216257174000000,0,0x01,
    2.384628846000000,0,0x80,
    2.384630476000000,0,0x81,
    2.384632104000000,0,0x01,
    2.557259372000000,0,0x80,
    2.557261002000000,0,0x81,
    2.557262632000000,0,0x01,
    2.727969316000000,0,0x80,
    2.727970946000000,0,0x81,
    2.727972576000000,0,0x01,
    2.897079488000000,0,0x80,
    2.897081118000000,0,0x81,
    2.897082748000000,0,0x01,
    3.066824986000000,0,0x80,
    3.066826616000000,0,0x81,
    3.066828246000000,0,0x01,
    3.237200978000000,0,0x80,
    3.237202608000000,0,0x81,
    3.237204238000000,0,0x01,
    3.404597490000000,0,0x80,
    3.404599120000000,0,0x81,
    3.404600750000000,0,0x01,
    3.570743856000000,0,0x80,
    3.570745486000000,0,0x81,
    3.570747116000000,0,0x01,
    3.740292964000000,0,0x80,
    3.740294594000000,0,0x81,
    3.740296224000000,0,0x01,
    3.913987594000000,0,0x80,
    3.913989224000000,0,0x81,
    3.913990854000000,0,0x01,
    4.090259982000000,0,0x80,
    4.090261612000000,0,0x81,
    4.090263242000000,0,0x01,
    4.260101128000000,0,0x80,
    4.260102758000000,0,0x81,
    4.260104388000000,0,0x01,
    4.430090590000000,0,0x80,
    4.430092222000000,0,0x81,
    4.430093852000000,0,0x01,
    4.603987976000000,0,0x80,
    4.603989606000000,0,0x81,
    4.603991236000000,0,0x01,
    4.773761384000000,0,0x80,
    4.773763014000000,0,0x81,
    4.773764644000000,0,0x01,
    4.944396540000000,0,0x80,
    4.944398170000000,0,0x81,
    4.944399800000000,0,0x01,
    

    Thanks and best regards,

    Lin

  • Hi Ming,

    I tried to renamed .sal file to .txt to upload here. You can change back to sal when you get it.

    PKł�Z
    digital-0.bin��_HSq��\����Y�o�?�,B��9j	G%$�I-S���� %����je���@*�@4�|�A�B�����zw��{�����g�s�CU�P�,G�$�p	!D�Dh"9��w	1髙�ߘ=&�.c���c6��֤�+���k
    S�ġ�V�Ȼ�TJz�f�?�G���M7���^�q�G��k[��Lǔ���(�8�h��u�\��!��f$y
    �Ǿ굶_�k�#R��QLo�d�f��F�޻)�=�C��uD^�I��J�$z�*yV{Ne��a����^DcO�3Ƭ��S��wn�-fm�Hd�
    �"-��NTP����XRI���C��ݞ
    c;�$��ĭ|Dλ�6�b�G31�
    ���Msh����{�����cm��Z��܈�&�d�=�"rһ�5;��B"G|�3�5t%."�l/���Fh��7C>Cx0^�H���~�9$Ѱ�ϗɍ����Z�H�`�N����$����È�F^-?W(�v�uu@�L�B1MFf��%��;�.#���v�`R�$���*"���{�1�TYi�Ϭ��K"O~�Ple��/_�kx�X�HY�|_Fo��D�x�0r������^YPK��udW	PKł�Z
    digital-2.bin�	v�qut�cb``Ha```d```H=;����ݜ3�Iޒ�yl�� �B�?��X�����q0�$/M����PY	���p�pH74�x"�L�y=3>�i��^�����q[��t��I��`ʴ�8��r̤�%0e$}�	)�0�
    ��Qs2v�� ��3cV1LYϾk�ؕ#B�o�Lٚ�R܄�O8XS�$&��ri��S?z��)Y̋U9R4���){������Eaʦ���S�fd���)LYYG� >�h��lS��|M���v0e2�E�)E���0eŮ���+����J��@x�>�AʗO��)s��.NH���0eM,%	)��S��� �U9R"�}��,��mi�ʡ�2o�����R�Ů\\��S��]*�)�d�/�U9�cV���)��e#����]��0e�m�����������p:*�SJ���a�
    �)�Unh�ݺA�l�—*X�#yu�&�2{E5T��`�����
    `��)���pw��SPK�\�R��PKł�Z
    digital-1.bin]�AH�a���kk���[��
    ��0ă�M$�\�|�Ct�H!��
    �j�hköh��!��Ai$c"��� L�Y��Cl�{4�����<��}�����s����cD��x'��e��
    {������ߑ7���P+�HՒ�],?�	�6���Y/y�v��u7���])e�ἄ��N�n����nDLM��\Ҳ�N������t�;0В�_Y��H����Ŧg݄���x������������|�M8�l!� �J�[p|�,��������s!�����u����š�u+F�m�w��'YWcp��|�}��uo֓�'̬K����x�o�E��{%�V�ee]������=��������p7UE~=�,b0�h%�T�*f݌���3�ʇ���tsy�/s���G�r�V>ͺ���9�X)�ڦ�W�乱��u��*ȟ�Ԗ�~�3yG>˻���5�PK�ZH��PKł�Z
    digital-3.bin�	v�qut�cb``Ha```d```H=;����ݜ3�Iޒ�yl�I��5�*����zPK���L=RPKƂ�Z	meta.json��[o�8����}�bŬx���>t�)ZL:��AvQ(��&F���6�/��/5��q�'��s!?����=����M�f$��F��=j�V�~��un�[d�րf�Z֯k���Y�UP�_�n�
    �P�� "J��.e!2����m�ԪC��"����8IYʒ,!"a�!D�\�Ms#[ceZ��Z��?���$�$��(�Dģ$De+��ZV�͢�8J���]/>��Oh;+v������}��C�V �M+�M�f����^,���׵�����r���=*��i���m��Y�B�t����'��74C��TP蕬P�ji�C���(D���w��6����qn�L�TF�m����Ǎ	�y%o!x_jd^�B�RVl��M��R�5X�����o�۽>����ч�pς��.�ד7�e,8�{Y5ş�������o?[�i7����@���CQ�j>�|�C�9ߎq�FCȁ!s��u�Y��m�x������*��Jw�s��ǀ�j��j��7��X���ߩ��3��������}��mq�!�e`����n��\��i�
    ��Bw�ieݭ�1����C{�ޣ����8
    �rd�Ny��'y��_��5�������'�3��x��q��G�zK��᭚aΙ��½�p��-E8���Rb���[J␒K�ѣ��5u̎���!�D�bH����K�?��3񧙸p&�<�ğh�B��3M\P��k�����g����L]<S���g��3u�L�y�.��?���3�発x��<S�ԟg����L]<S���g��3s���yf.��?���3��پZ�yf.��?���3�癹xf�<3�̟g�����\<s���g��3w���y�.��?���3�登x��<s�ܟg�����]<s���g��3w�,�y.��?��ų��Y�x�<�Ÿg��Y��,\<���g�ϳp�,�y.��?���s��s��9��9v����x��y�]<��<�|/Ԕ��L�y��A��k�u	u�k������ǫ�_A��M���A�uS�V�;�z*=>�m�Ӌ�	��Q����#w��K�Fk_66�F�.�,+����W ����������c�:�n��&�`PO��i�����^�nt��{zhǀ����ЎZ*]�����D���-����P�ޓ=��e��}m�⦿�
    ��iA�n�hW������>�n�WhF��P+�m�v��K���<Q��s!s���,��8�,)3*Q���Kc��鮿�R�RPo�|F��������o�[{#TH���C3T�Bw6�=\��m��)�����h6\��&3PI^�K�s�J,���,�eD�B{&g��ŗ��|��۔��$�d q��2)q.s�ˤdRQ�[L�-/ꦱ� Wo��e�I�,�y���'�d��)�1��`�͉.�M�6`�5����n{�[q���K��B�,�3�e1+90($}���v�ݥRTNq+�9�9�A1�B˄CIc���[�o���-e��LI���R2�#�
    N�8��*|��r&����\f"/x���8*,"3G��*�Q�2v[1gڝ��NS"3�q�#Qb^fNc!p�d^�<Vv���ڦ#4��}�\�	͢O����Z��ϻ�,�4ʘ�F4N����z���\Bm��<����aݗ$@"�ʜaΘę�R�%%K�L#R4�w�g�?�:y��9v�eYLS*h��$b�����uI"K°��\D%�Y�`Nˌ\�]F�xʼ6�S��Ӯӧ�Jr�HQ2�r����y�e8.�ũR1#��������O���>e)V�̣"�R	Ns3 i�F���36ڧoX���/�o��e"e�#UH�S%p*
    �� �X�6q����}�Fw�_���EN�=��\��3�qƙ�Q��C���A���)���R^\dQj��KV&���`��!-�_(�����)�3���KܾTݣ|S����_�!G3%tH>l?4
    vo_��3��ui��f$�}�hV���S��V���c�ի1�q��hE��M�Ջ��2e��#���l_���:rn���O�ӵ=T���(}L^\7���e�)�R�h��:x�i�M�"u=�g�����}�B]Ѭ�?��a�-t˦�o�!Z�ٴE�tw
    m���"!Z5ʦ:�ޘƮ;M�>��vVl�(y��!jAV��vZ���[�'����t���V	�ܘ����	�(4CcS{�����O?�DY����?��qNl6D�x�fI�X"x1�Ȯ�cz�U��Ep�6A�P��G���n[���^m�q���B�e�+m4���9����Z"]+�S߻5��ႛf�������ٱ�����5��ȳ�=�ב2�,eO�u��=K��z)��R��^G�ij�=�ב��Yʞ��HY�,e���E�ZW�I����;�f�FO�_��0�ҩ���LŇ���C	N��t�(tlzX�j-�������̥d4��~���^s0����G�����2�e}W���c�S���^/�:]�jZ�mD�n���~������[�v�<����S�pSv����:U�� ���~י���g{V��q؞��oB���)�oue��mapu{(����a��,4|�];�����O_D@g�G	l�~�2F��,6+��~���⽂��R��n�F�B�_�2K4#}�
    �rS��.��v[���ؓ"�VTo�f5�ˡ�C���
    �-��И�ٓ�V�"�������W0��Z�,�'���*zpC��N~'�����JxT�4�U�i��8)v�vs�WZg�	�����Jw�鮶�%o���6���������
    �!��98~ژ|���Y��@���-�Sg�>���3��-�B�������Y/!*u�1��?��G�����9�C"9K"uH�gId�l�����PK}�_�y�6PK-ł�Z��udW	
     ��digital-0.binPK-ł�Z�\�R��
     ���digital-2.binPK-ł�Z�ZH��
     ���digital-1.binPK-ł�Z���L=R
     ���digital-3.binPK-Ƃ�Z}�_�y�6	 ��]meta.jsonPK#
    
    PK���Z
    digital-0.bin�	v�qut�cb``Ha```d```H=;��䝓�3Ξ�7�� )$P�S�@i�7�`�	����bd0���p�@~T.��k�BA�!�]x�A� CS����*n��m�0C��;a�bt��.��]Q3�m\+E.�|�X
    3d��i6��j>T3d�QT�нI �V������ĉj��<<�%[�6^х�p�f.��aD�˹yx��5%�Y$��0d�<�<豇�T���ʅ�`�/�a��aش�Y0C�Mo�C5�T�u�*���}��0.CC�y��a���
    �F���7���h�(D�ax�9pk�0e��:+
    3�ڶ�"�����6y�1��؜��	f�����a��پY�0C8�t��r$�h�>˅�T���a�f�����0C�mT�������^v��)��!M�a�6Z�yٸA�a豇�ya����M�2�f~��rh�3�nDT((�σ.�t�f��E�^��kFO*^���I�|N�4Ð� �^�6F��іT�k�X��fH��bT��lF���^��g���vX�0���F���k��r�!
    jC5�0�Oo+PKN�!PW	PK���Z
    digital-2.bin�	v�qut�cb``Ha```d```H=;��䝓�3Ξ�7�� )$P�S�12�@E��ި��&�?6���*�'�(*�h�5o�L��/3DM����6O���P+�Tz����ɾ��b�n���&E��.��l誤A�2�j>,�]�G�]��+�;�d�4�8�UA��x%&�h�f.tU`����5s�d���ƪ��k�ia����v���D@��6I&�lz#�*p�w���6y��Ǫ��k�c]��)�� VU�^�Ya���p��p &{��jaLU"���^��:�d�o�,�Eȏ�7g�d=ܜ�0U���o�3L�sO�8�*px�}.�}*{C]4��׃ɦۨH������0����8TM��}ٸAM�.Ԭy�`���|�ES�CF^3?*�d-s�fMx��|$L�ʢC�Y��y�d�.�Sġj��Z�����2U+WK�d3_�`Ue���Lv��aU�����n�A�6�aW���,PK�{�\��PK���Z
    digital-1.bine�[(�q��g���6Ǝ9�0�SH���ˢ��g)�K���ݥm[��fڝ�2�\Ҡa[���傈r�ȶ���h��������|������Z��"X�C�	d�C���'�l�o����������x�%�0Q���u���ջ�"�Z�E���<߬�R7��M+y�Y-^+�0�:򆼼������++�AX��^��J%_�F���'5 ���F9�z��w��L�*��`y@}������K��*V��F�-KrGo�F�?�я�>�:t�#�Wj��.é`*yfN������@nܛ�a݄�+��/���8<I��̬c]���*�6=�18t���ȸ��u9z�kȗRbY�F��=��-�u��]�B��Ⱥ
    ]�������u
    :O�c��⃐�/ά��;_�%�����$֟�ฆ�K�!��8t��$_=�Na]��rɕ��T����T�����������PK�����PK���Z
    digital-3.bin�	v�qut�cb``Ha```d```H=;��䝓�3Ξ�7�P)�44�A��P�����PK��;RPK���Z	meta.json��[o�8����}�bŬx���>t�)ZL:��AvQ(��&F���6�/��/5��q�'��s!?�����
    m���H"%�D�;�B�������H��ܮ�е�_��?M�B!��4����̡@��"��$����q���-de�4���fQQ��CTȵٴ07�5V�յ��w����*�M�H"� Q�FY���leatS��Yt���Ju�� �?������}��R����!Z��6-��6���K��z����P��eu�W/��˽�P�TM�f�oo�,�R"��u%o?I���zߥ�B�d�BTK��_�G!��]/��;d��lՇ�s[g��2zmdg�
    >nL�+�����F�(4+e��V��,].e]�U[�>��6����UV@3z�Y�~��e��z2��Ƽ�z/����@q_������g�3�B4:(���#y�y(
    ^���s��0��1��h90d��.u!k����0x���Y��^��vn����Rm�Vͷ��Uә�u�[�v&x57�V�U��S�-��8������홝k4mP�tT�.0����6TPZ}hoR�;�W���v@���I#�_�$����6]��6�������q&v��=l��(Po)�:�U3�9��R���"�����[J쐒xKIR�c)�=J;XS���X�#�g)$�C"��g�L\r�Y&.��?�ą3�癸�&�D�ğiₚ�SM\X׏`H\4���g��3u�L�y�.��?���3�発x��<���fA�y�.��?���3�発x��<S�ԟg�����\<3���g��3s���yf.��?���3�癹xf�<3�̟g�����\<3���g��3w���y�.��?���3�登x��<s�ܟg�����]<s���g��3w���y�.��?��ų��Y�x�<�Ÿg��Y��,\<���g�ϳp�,�y.��?��ų��Y�x��y�]<��<�.�c�cϱ?ϱ��؟�҃�����?/�7h�]p�|�-�tm��_!xuy��*�W��ySm�j�q�T���ֶކJ�_�
    ����F�F��ӑ��ȥ���/}#�t|��VAS��+�J׋�^u�q}���qj�^Z��joZ��#�'G�׻���1�}��9���J�`G���������<��Z8U�=�ѽ��[6���v.n�K��poЙ�ꦹ�v�kY��|��s�F�{�f$�Hl��ͷn�ɣ���'�a.d�y��eBp�%eF%
    ��bi�4"���X�V
    ��Ϩ~��ٻ_��mw�co�
    i`Ѵ�h�*X���Ƽ���7z�M9��.`�5�
    �$��T���� ǜ��,�8�xA�PŞ�Y�m��<:���6���(�(H�E4¼LJ�˜�2)�T���So�Nj�i�9���[or�g8Kp^�%�	,Y*p�hL�B�9�gs�o�ǩ
    ��C��}���^�E��$��P8��gY�J
    I_�n~��|gw���S\Ɗc�x�sP��2�P��*|����-vvK��2�C�eD����H���$�)�
    _�n����w��;����c ��<�
    ��Č�$��h����V̙v';�ӔȌd�H���Y��X��9(��)�Ձ�?w�����nl?.�CnB���,����ߡ��,(�8�2&8��>5���5�Ph?��yX�e	��2g�3&q��gI�*ӈ���(M�]�Y�O�N�'�]gYӔ
    ��)�X*����.IDbIV������2+�i���K���O��r�uz�u�TWI�)J�S��T8/��E��8U*f�<W�7�S����>e)V�̣"�R	Ns3 i�F���36ڧoX����Q6���T?y~�4/)3�Bb�*�SQ(�$�Ǣ��Kg�<���7�S���,r��1��ĜI�3��8��E��RO� O���������"�R�T�X�2�\$SEi��Bq�O�XO�����]�����囲�v���9��(�C�a��Q�{��C�i֯K�6��E�Z5���'״z�7�v/]�^����DF+J
    oR7�^,��)���W����깯c� �fxo��;]�s@��?A�����uәю_���'E�֛��7�V��>+R�C:&	�J~��w)��N��f�B�l*���M[�Nw��P���,�U�l���i��T�cYng%���+��Q�m���l���?Y�Ќ�h��OGM��H���4'�
    v�N�@���3�@����}��f��W�7�9͎�pb�!ij4K����шDv��C���.��	��Ҿ�8�}�u��
    ���jS��8&r-s]i���x����6�����Z���ޭA�
    �4�E},Ħ	�ݶ��W�]�a�F���i����g){Z�#e�Yʞ��H����:R&���i�����R��^Gʒg){��
    (�պ�O����t�1�6C�|4ܱL�t*�3s�R2�:%88�ӱ��б�a��e<�<h8*?(?8(s)�9hG�6�:��^s0����G�����2�e�P���c�S���^/o;]�jZ�mD�n���~������[�v�<����S�pSv����:U�� ���~�q�s4����?~���E�M�|�+�m���CѸ���;8�<
    g�ᓎ���4�η[�:��I`�����1��X�Y�������F�z�@w�������Y��c�o����Lu���7�����ƞ�����(x�6�9ȶX����KV0l�w�ƤĞ�X�r�T�o���e?}�ޞ�BHda<�f��T�"�w�;�$}X�Vƒj����N[g�I�C�����:3M�4�?V�kNw���]-q��Ndz���6����o������������>�Z.�Ldm�63Ќl����{c�9��庿8�?�yօK�J�t������E��~{�D�HΒH�Y�C"$~��?PK<��^j�6PK-���ZN�!PW	
     ��digital-0.binPK-���Z�{�\��
     ���digital-2.binPK-���Z�����
     ���digital-1.binPK-���Z��;R
     ���digital-3.binPK-���Z<��^j�6	 ��+meta.jsonPK#�
    PK���Z
    digital-2.bin�	v�qut�cb``Ha```d```H=��q������£7�c�� �B=o&�t102�@EC�䆉n�z�"��u�v(r	wHv��Zܐ����M��C�KH]���RP�ҏ�BXե�zfl\j�W�GS�7���2���,4u{A�M����Y���C�WF�Ku�<�-54u{�\������FS�7s�/[�|�P��:�y�/;�䏺��T��8L�ݶ�
    ��뷹a�gM��q����&_5s��:�?2�n-��6Z䉡�2&-��v>���)<a����
    FSgNW�x�yH
    &����4up�2V���K~���b(���*��o=Ǖ��a����0y����ԥ�,�_��;��s�3`���E8�yfl�N��Ot7+GS���-ge`��k�����ռ�&?�U[#.u��`�6W���Tw�p)L~�cݸ�e�z*�w�zu�:�?��Fƞ�0y�bQ�J�� ��¢l^��)vPK5�2{�PK���Z
    digital-0.bin�	v�qut�cb``Ha```d```H=��q������£7�c�� �B]o&�t100�@EC�䄉��z�$��`
    �50B��(\#��E��a������8CCCC$A!C�,DLf�_�3��#��qH��8 &�@��%�0c�;��Q�3�h�x�����]��3�v���q��i��M�0c,W(*Rj\�A�1��t�(5n�Ef�1�ô)4.s�Ou�1�B	��!%P`$3���t`�v��_
    �qƖkL0cXl��(u����0cN�v٣GzB�}�fL�̹.�wvK̘�F�<Q�È
    P~�970.�Θ4�f���~�C7��Aq33sJ�1̘9k���(<��@�L+�"��A~�1�=�@7I/�3Ϯ��3F��XT���F����ә3f�9�dJ�;�"f�G�
    �K���f̢��9�ơ�1a�~n^�	�"
    �����3��ݬ�B�2��a�3Q���8�c6�y�̘�Wm����!�˫��(5��x�1}�u��YHm�Q�bd�z�3����	8������02�|K�ñ��TJ��>�fÁY�vq�6PK�W׸N�	PK���Z
    digital-1.bin�	v�qut�cb``Ha```d```H=��q������£7�c�� �BϟN�b`d`���>��Z�"��-��Z�&^���M�=�����W�Bh���`�m���h�~W���ĽRd��3&O凉/\���&��rJ&YG
    M�1cͦj�x�d�6�|T��f0���	���9˷�ąrMQ��2�lO��7�5[��'d\��
    7��G��˘}P&~e�\4y팳�
    a��:�<��c3&5V�ĭm����kdN���\~7M^%��b�������u+vq�����*_ ����L\�W2�<s���<�x�+�4���/S�`�Ϳs��9��5���wr��Ggl}c��`V�&/��e�L�S��M^9��9&��q[#��|ƾ�n0�=禷��+f^�	��y�U>?;sױ ���sW'���g칑O\�z*��qƵ������.6iPKw�0��PK���Z
    digital-3.bin�	v�qut�cb``Ha```d```H=��q������£7�c�I���Y&+T������PK�'�=RPK���Z	meta.json��[o�8����}�bŮx���>t�)ZL:��AvQ,(��&F���&���/5��q�'��s!?����=�
    m���H"%�D�{�B�������H��ܭ�е����?M�B!��4����̡@��u�
    A�(���8D�V��-�Zu�UEQ̘��8g���C�
    �6��F��ʴz7����?���$�$�
    ��2�BT��0��eu�,z�f)����l����bW۟!ZKݗ><�h�۴���th��/!Z����B����ݟ�[.���GES5-������4KQ���֕��$��E3�n��B�d�BTK��_@!��]/��{d��l�ǫ��3MS���3�W�J~��C=��y
    �JYu���7iKY�`�ïO���n��|��Ќ><�{|�_�,�PO\m��Xp���j�?�%������~�>�n D��с�_k;������|>�<�
    
    s��l���C�zQ�R�6�/ڎ���
    ��U��l�fm�/�6k�|�o��X���ߩ��3��������}��mq�!�e`����n��\��i�
    ��Bw�ieݭ�1����C{�ޣ����8
    �rd�Ny��'y��_��5�������'�3��x��q��G�zK��᭚aΙ��½�p��-E8���Rb���[J␒K�ѣ��5u̎���!�D�bH����K�?��3񧙸p&�<�ğh�B��3M\P��k�����g����L]<S���g��3u�L�y�.��?���3�発x��<S�ԟg����L]<S���g��3s���yf.��?���3�癹xf�<3�̟g�����\<3���g��3s���yf.��?���3�登x��<s�ܟg�����]<s���g��3w���y�.��?���3�登x�<�Ÿg��Y��,\<���g�ϳp�,�y.��?��ų��Y�x�<�Ÿg��9��9v����x��y�]<��<�.�c�c�jJzCs���`ޠEw�e�-���:е
    �������e� r���� 㺩d�͝m�
    �G��
    ����F�F��ӑ��ȥ���/}+�t|��VAS��K�J׋��|�q}��qj�^Z�0�'�޴RWGzO�n�w7���==�c��R�?shG-�����R���Ώ��k��Q�b�ɍ�?ݲ����sq�_
    ̆{�δ W7�
    �+]�
    �����p�S7
    >(4#QDS+�m�u��K���<Q��s!s���,��8�,)3*Q���Kc��鮿�R�RPo�|F��������o�[{#TH���C3T�Bw6�=\��m��)_uӭ�l�$�Mf���d�9�4�Xf�Y�ʈ��*�L�Ro�/����)��EID�@�,��eR�\��I�(��<޷�z[<^�Mc��A��z��<��Y��2/1O`�R�SFc"��>�\x�<Nm��j��s���V�,�'	�����Y�g8�bVr`PH�2v����;�K��$��2Vs�s��b8�(�	���V���8�n��[�$��$�0/#��dG��&qL�U�v�'�L��ݹ�D^�)�qTXD$f<� �UF��e�bδ;�ٝ�Df$�G�ļ�2��B�<�AɼLy�����MGhvc�~�r�E�vq
    ����ϻ�,�4ʘ�F4N����z���\@m��<����aݗ$@"�ʜaΘę�R�%%K�L#R4�w�g�?�:y��9v�eYLS*h��$b�����uI"K°��\D%�Y�`Nˌ\�]F�xʼ6�S��Ӯӧ�Jr�HQ2�r����y�e8.�ũR1#���򗽀��.�)K�J$`��Hp���I�4�?͜��>}�:��b�G�����y�H��H�T	��Ba%�<�M\:�i~��ѝ�W���e�Se�!,�%�Lr�q�p�A,�P�/t�z�y����e<��Y�ڥ*Œ�	�")�*bH���3x~��z�����R�/U�(ߔ%�s�'|�ьE	�ۏ�����=�L�~Sh��v�(�ժ�/��=��ի��X�{�j�jL}�%6ZQjx��i�ba�L�}��Bm�/V�}97�{�'��ڞ*]�j�>&/��Όv�2�ϔB)B��T�ݴҦ��Y���3I�V��mߥPW4k8���v�eݲ��p��w6m:�]C[@m���H�V����o6���NS����Ί�%O�2D-�j��NK�1vk�d�C3���?5�j#!�Ӝ`7�1A��fhljϘ5S�����(k_����4;�É͆��,IK�"F#ٵsL�l���&�J���h�U�mc+t7׫M5N�XXȵ�u���>�u<_�|�CkC�kv�{�6\p�,���3v�>�^�v���y����:RF���i����g){Z�#e�Yʞ��H�x����:R?K��z)K���^6�(W�
    >IW��c�m&l�����rS)��J�T|X:
    8����O���BǦ�������������\JFsڑ���;�5�
    ]��~����4��T�C����ғu�5��T��.��˻N���q��㰺l�}"��V�]0�`���"�ߔ��쯿NU�>��e��u&�&&����4����?~���E�M�|�+�m���CѸ���;8�g�ᫎ�u��$�ow�9t�3���W(cн��b������.>(��.�`��ۃ)�M+�D3҇��B)7���r��o`w���=Y!�ۢ�(x�6�9ȶX��LV0���Ƥ�Þ�X�r�T�����e?~�ޞ�BHdY<�f��T��"�w�;�$}\�V£j���[5��Ό�b�h7}�uf-2}O�5�{�ʣ��i^����~����N�7�߀�g����i��GKe-c&�������ȶ~�7��zQ��[��[�gݶ����@��9><8z��_��#�8$��$R�Dz�D���^�A◇�PK�^��u�6PK-���Z5�2{�
     ��digital-2.binPK-���Z�W׸N�	
     ��0digital-0.binPK-���Zw�0��
     ���digital-1.binPK-���Z�'�=R
     ���digital-3.binPK-���Z�^��u�6	 ��Dmeta.jsonPK#�

    Hope they are helpful.

    Best regards,

    Lin

  • Hi Ming,

    I changed SPI setting from 3-pin mode to 4-pin mode (without GPIO). And repeated my tests got following results:

    When input 0x010203, Saleae captured and decoded as 0x008101.

    When input 0xAABBCC, Saleae captured and decoded as 0x555DE6. The data is not correct, with one-bit shift, but the results is consistent or stable not like the 3-pin mode the data was changing.

    Another observation is that CS signal extended some period, not 24-bit, causing some extra bits of CLK at the end, but that doesn't affect the MOSI decoding results.

    Here are the files and screenshots.

    PKݐ�Z
    digital-0.bin��_HA�)���B��9rw���?�[*u�PB���Ʈ���fD(>X	փ�=D�/VpI����R����>Y�Ջ3��۝�Co�;��Ο��9�.�
    �V!�*B.��{�嶥��r!T������B[�)�+�w�;�6�e㣻���v8��](�<+)�-�KU���
    ��L��~灖12����lI�T-vH�ʲ��{�Sx/��ߵmm�����U�&��m	g�^��7���γ�W��RC��HI���-�L�U�Ê�u�4WIxr�D����?�I���k�y�^b�&G(�J�~�h���.^uf�gK�>E2�_[ςv���ǫVLz$D
    8���>=�m�វ������.�~�'��d�:�1���l^]���dY}N��珚���Y��hh��yu峕N�F�K7h�P��P
    �zg,ZMmS�
    �/<1�m�6Ц�5�j<D\�h=�^Z��[«B�x�W�o.�vf2R��{�Z=��gY]/m>m��-ȅ�R@�����&��	�*Y����\wp�R[��:�^o�#~�����T{a
    �M3���A�}���=({\�q,���&��vA�m�U�<�-Ȍf+8�_�!�DI�T@;���
    �ƛ&���p6��>��4hO[�Z���ky#d��Bhus/�:U��\6�������A)[��T�Y��l��	{i��H�4�_�ɫ��^d�Jle���@��[�ū\�e�
    2�:ز4�P7��<�A�$����PK��� �o
    PKݐ�Z
    digital-3.bin�	v�qut�cb``Ha```d```H=��Ѷ]�k#C����O�R i�	a�BE<���_PK�nj)<RPKݐ�Z
    digital-2.bin�	v�qut�cb``Ha```d```H=��Ѷ]�k#C����O��ARH�����.T4�����Œ# aF>��C�K�C���iơ��0�g'o��P�q��&��_!�l3�lх�甉H�P�q�m<L��[K�:͌�}�0y)wG%4u�.`Tfܾ��O��RGS�f��n%����I:h�@�%�z��d<���/�\l�������"��V=�|Ԏ�fh� �y��g�xX��<g���>�O��`��˿;�PǙ��=L�YB�
    M�&�3�[���ܼ�ԁ�Mr��g�\p�&�[Z�E(�$g�Y�������߈�9��`�.K������9�!L^���x���26M��oV8��ҳIƇ��0��^_3���W=sΎl�|��|,�@��Ȝ�!�_~=��:��ͷ*`��.E�8�if,ݛ����]�C]PƳ#0�ʖe��@���?.�U++L��Ӿu�|^��p�L�5���:����a��&�P�9�L��!a�:X:���֑�g``�����\�=�PKw*(PKݐ�Z
    digital-1.bin�	v�qut�cb``Ha```d```H=��Ѷ]�k#C����O��ARH@}�ff���*{�L���D�
    *��q�L\��
    ^4y���m�0q������3�����/+�@��ϸ�4&��CKM^8�z[L<��Q	M>%��e[��,�*u4y���͆0q��I:h�vO��ו-6D�W�8��&>y�F34�Č��`���Y�ɫe|�Y��U>�8s�?��Q97T�d�̙�=a�}ݼQ��2�e���U��'�f�Y�����&�1�[&�4
    M�>s�iG�x܍��h�����a�odρ�#,���d|x\���5U>Y0sΆ�����h�L��T`��d��ɛdm���u,�D��X��&���M�:��M����e�h�/���ij���@�O�x�=&�?��M^,k�N�x�j��h���s����mf�ɫgnk�E�3�D�ww���PK����PKݐ�Z	meta.json��[o�8����}�bŬx���>t�)ZL:��AvQ,(��&F���6���/5��q�'��s!?����=����M�f$��F��=j�V�~��un�[d�րf�Z֯k���Y�UP�_�n�
    �P���XF��D̳,Y���+de4���,���(��?���k�iandk��iS�o��]U��z�DPAb��g!*[Y�Բ:l]�I?�zu�� �?������C��R��!Z��6-��6���K��z���[�^ײ���`��޿��h��E3��q�f)
    ��ݺ�w�������oRA�W�B!��uͯߣu`��V�=2�T���ǹ�3MS���3�7&敼��}=��y
    �JYu���7M�KY�`�ïO���n����jhF�=��?�,x_O|ܘ���@�e�(�K�W�W���l}��@�F��ſ�v$4E���|�y�|;��
    !����֥.dm�_��O��7��+�����>^�m֪�Z��7c�j:|�.x�����F�J���u��q�@��YB��r�=�sm��
    *��
    ���u��ƀ
    J��MJx�����4�ȑu;i��˞�}�Ѧ��7֖ڟ8���㑶��>�-�Z��j�9g�R�C
    ���R���{K�Ro)�CJz,�G����!0;��3�y�!�K�3H&.9�,�ğf�™��L\@��i��4qAM��&.����`H\4���g��3u�L�y�.��?���3�発x��<�3��fA�y�.��?���3�発x��<S�ԟg�����\<3���g��3s���yf.��?���3�癹xf�<3�̟g�����\<3���g��3w���y�.��?���3�登x��<s�ܟg�����]<s���g��3w���y�.��?��ų��Y�x�<�Ÿg��Y��,\<���g�ϳp�,�y.��?��ų��Y�x��y�]<��<�.�c�cϱ?ϱ��؟�҃�����?/�7h�]p�|
    �.�tm�����x�+�����6x5ȸn*�jsg[oC��/[���byB#yT#yD����h�Rv��ڗ����F�>�J����A�H��E`�:츾{�ظ�[/��?�joZ��#�'G�׻����1�}��9���J�`G�����Q��yt��p�(T���F��n�|}_۹��/fýAgZ����ڕ�e����Bl�ϩ��{�e����n�ɣ���'�a.d�y��eBp�%eF%
    ��bi�4"���X�V
    ��Ϩ~��ٻ_��mw�co�
    i`Ѵwh�*X���Ƽ�˼7z�M9��V0�͆K��d*�KV`	�cNS�eQ�E���Y�b��,���r�o�p��[\�D�$�"a^&%�e�q���B*
    ��}�����E�4�����7��3	�%8/���,8e4�q!��9q���������f�>��mi/�8�I�%�e�p�β�������|����R)*	���ǜ��N!�e¡��U��-η[��2�e&	�$�ˈb)ő`�ISf����	9��xgw.3�<�@
    �y��#Hb��(y���3�Nvv�)��8�(1/���8�sP2/S���zm����ؾ_��܄f�gZ\C{��AէZP�qeLpB#'|jj�;�Mk.�6�~������� Ve�0gL�LE)Β�%T�)�WQ�����r�<L��β,�)4IS�TLM�$�%aXe�b.�ˬL0�eF
    .�.�g<e^�)��i��S]%9g�(N9��R��2q��T����\��xN��^�_f���X%0��KQ$8�Ù�Y�f��h��a����Gٌ#�S����ҼL��p�
    �y�NE����C��&.���4�O��N�+^�߲ȩ����s&9�8S8� 
    q(�:H=}�<��R;w~O)��E�v�J�de��H
    ���r���������79��/�T��K�=�7e	�\�	r4cQB�|��C�`��u�:Ӭ_��m��7�f�j��1qO�i��o>��^�Z��w��V�ޤnZ�XX-Sv�=�[����깯c� �fxo��;]�s@��?@�����uәю_��R(E�֛��7�V��>+R�CF&	�J~��w)��N��f�B�l*���M[�Nw��P���,�U�l���i��T�cYngŦ��'[�d5�h������ޡ�Jן��l��ɍiN
    �옠j�B346�ǵ������M����o�s����fC�gi�$�%�g����9��^5]�m�	�}�q���붱���զ�qL,,�Z��FC��:��/�m�页!ҵ;��[�.�i�
    �X�M�mo�^�P�؍<K��z)��R��^G�س�=�ב2�,eO�u�L<K��z)����i���%�R�X/P��u������c�m&l����98S)��J�T|X:
    8����O���BǦ�������������\JFs���!�:��^s0����G�����2�e}W���c�S���^/�:]�jZ�mD�n���~������[�v�<����S�pSv����:U�� ���~י������*�8�����C��6����-�nE�6�?��L�4����:�Bm"I6�m��9t���F��(c���b��I���//�+��.�`��k�)$�U+�D3�Ǡ�@)7���r��o`���+�=Y!�oE�Q�mVs�m��=�_��`؂��	�I�=��l�(©�߾��~c�=����ByR��ߩ�7Dj��wBI�����G�H#��j:m�'��n�J���Zv���kN���G=-wӼN�����g6����o��
    �����F���>�Z.�LdM�930�l���{c�i��庿>�?�yֵK�J�
    t���)��E��~{�D�HΒH�Y�C"$~y�PK,���s�6PK-ݐ�Z��� �o
    
     ��digital-0.binPK-ݐ�Z�nj)<R
     ��:digital-3.binPK-ݐ�Zw*(
     ���digital-2.binPK-ݐ�Z����
     ��digital-1.binPK-ݐ�Z,���s�6	 ��meta.jsonPK#�
    PKh��Z
    digital-1.bin�	v�qut�cb``Ha```d```H=�בc��F��]�}�;Ş�A$����U32�@E�g�d��N����R�ΙS&����\�F��ʚ�M&.%}MU>�&c�/���U�DQ哕2����=�$�&o��aN2L����V��c0�5[稢�'Udo?�	����F�O���g{hn�&/��)&>���)��B����0�K�<���93�=ׂ����ۣɇf|۔
    o�tA�g�8~5&~��eO4y���U`��z����2z��čn��e�?P�����@�O��x+&>��s,�|2�Ϲ�0���%��'զ��k
    ��ʗ�*�,���nu�&M�6s�>A���vEh��xa�Š��h�)�a�.Q�5h����ą����2��2���omiC��ʸ֢	g{/҃&o�s� L<�/�D4y���?Ua�#�OE�WH�;�!�0M� �i�1PK�Y��PKh��Z
    digital-3.bin�	v�qut�cb``Ha```d```H=�בc��F��]�}�;�*����&+T������PK��e=RPKh��Z
    digital-0.bin��kHTA�Q�D�2��E�}(�{"�EwQ	�H-2H�G{}D&D*V�Ee�&=�/Fe~2
    +��h�"�¢�%Ai)f��=�]T�޹��ۿ3���<GN�#35�1V�a����^G�����Ɔne>���1�N��;�v�݌-1��W��C�f߹0Qa6��_��34�f��[["A�X�*��E�����)�*ͪ�zE�Th��J���du��#F�L=h��_Wcu�h$<OR���|�<�C-T_`��6���ڪ��x��@9")�
    ���k0	��ג��+������PQ�ur�*{���V�c7b���G��ʉ�J�
    ?mհ�
    $Ucd�1s*��c�[�jf�AH��+�k����Y۱���Զo����q�aB�g�,��7�[�S�׃֜[��U3�X�"���R���A{��uV@U�s���x�T+�����cU��~�_�c���M�����-V�Uj�h!hq���Ū�ZSIĊ��ZG�;ke�1�!	�+'�c�6�Q��*D�+�
    ��dІ�~cu~�U׽}��r���[
    Z�(�����hV��]��T���A�z3��Wؼ�6�z3��ԞG٠}I���.]��x��y�b4M�͒�8�`�
    /U�Oh9�v���YM��k�R�_��6��	��W��ΚWU�k�:��0hiݍ��*"y���Y3P/�
    wc	hQ�1�����I��DV��$�#�e���i�����54]ڗ����S	B
    �_�Ƕ0�kh_�Z-�䟼S�PKMӸ�e
    PKh��Z
    digital-2.bin�	v�qut�cb``Ha```d```H=�בc��F��]�}�;Ş�A$�z���U30�@E�g�䆉.���fdP��:$9� �b�I�!�Y����=sʒ8��e<���&; �"�7kj�L���5���j9�8�:z8�eL�v��y��(�^<�f�c��a8�$�Go�C1��3>�K��9����[X�ݜ��FL���sT��"�8�-����́���FӋ�^��Ox`z����koƯ)�0=˟:�b��G����]�i���f4�fL�Q�#�nO��oG�az&U�����s+��sG.{��7��ev�7��~z��(�e�t��5���W�B�r��Q����9�1�U��7:0=��?ǒ�7��z�����%���͹Z���|8���R� �Q�L9���Gmrq��-]en� ���]�^�p�Л��b	�#��X�G/��3:��`z��k��⏣�`zd�I���8L��֖6���XwG��k��azދ��E+�a��[΁G0=��'������3�0=�"�O%�7�IV��]n����0M/.7�딐�])PK<g�>YPKh��Z	meta.json��[o�8����}�b�,o�؇N:E�I��:��.�%��ȒW��f���u񥦓0N���rn�DR���
    m���h"%�D�;�B�������H��ܮ�е�_��?M�B!��4����̡@3rAD�eqJ�����[[��6ij���!���rm6-̍l��cumj������JwS/�D,�q��8�CT��0��eu،\F��^��d�'�������Z���>D+�ݦ�ԦC��~	�R/�W��׵�n���r���*��i���m��Y�B�t����'��w4C��TP蕬P�ji�C���(D���w��6����qn�L�TF�m����Ǎ	�y%�B��ȼ�f��:�J��˥�k�j���'��F�{}��jh����=��?�,x_O|ܘ���@�e�(�K�W�W���l}��@�F�Ɂ�_k��CQ�j>�|�C�9ߎq�FC�!s��u�Y��mc���i�}�ʡ�ҝ�ܬ��1��f��o�
    |7��3�ꂷ��L�jnd�d�z_�n[�8������홝k4mP�tT�.0����6TPZ}hoP�;�W���6 G����/{����E�.XC�X[Jhb���#m�}�-�Y��j�1��R�C��"R"o)�CJ�-%vHI��$)鱔����C`v,��3�J��P����K�?��3����p��<S�ԟh�B��3M]PS��k�����f�3u���yf.��?���3�癹xf�<3�̟g�?Z,�?���3�癹xf�<3�̟g�����\<s���g��3w���y�.��?���3�登x��<s�ܟg�����]<s���g��3w�,�y.��?��ų��Y�x�<�Ÿg��Y��,\<���g�ϳp�,�y.��?���s��s��9��9r����x��y�\<G�<G.�#�#ϑ?ϑ��ȟ���s��s��9��9r����x��y�]<��<�.�c�cϱ?ϱ�;jJ������
    Zt\5߂oK�]ۃ�����x�+ �ü�6x5ȸn*�jsk[o�J�_�
    ����F��F����'w��K��־���id��೬�
    �:�^�T�^��������:�n��&?�joZ��#�'����E���C;x_��g�v�R�l�_�Zl9u~�G�X�cG{O.���t����ڎ�M)0�
    :ӂ\�47Юt-+4��Wb�}N�(x�ЌB�9�m�u��K���"Q�
    �E$s,��,���`<)3&Q���Kc��鮿�R�RPo�|F��������o�[{#TH���E3T�B���{��{���S
    ���[��pIқ�A%y�,r,X*����4��*�L�Ro�/��|��۔�⢤Q�A�0�E��8���eRriTD"޷�y[<^�M�f������2�$���K,X�4�)g1��(��>�"�6yڀ�jޯs�݄Rq��DH,�B�,�3�e1/p(${���v��ݥRLR�p+�9�Aq��e"�d�U��η;��-e��LRIX��a)9�$�`I3n����	9��xgw.�(/D��1),"sHb�1����V̙v';�Ӕʌf�X�Y��8�p�d^�"Vv���ڦ#4���8]�	͢ϴ���Z��O�`<�d<�'bjj�;�Mk.�6�~����0�K	P�U�s,8�8S$�YR�ɔ�re���>�)����ϱ�<�b���%iJ	O���#�KJh,)�*S���Xfe�+3Z	v=�)�Z@N��N�Ξ�*��E�q*`��
    �E�ḈS�JŜ����s�_��r;��<�*��)2,�"�i�b4�R���9c�}��u�_�e3�O���7K�2�2�D�TE8�
    ����8*m��(O���6k�\�"g�nCx.K,�8\�L@Tp"�L_h#������Eʘ((.2�ک*Œ�	QRpUĐ��/g��������~٥
    n_��P�)Kh��/���'	�
    �������L�~]h�I�v�(�ժ�/��=��ի��X�{�j�jLw��2ZQjx��i�ba�L�}w�Bm�/V�}97�{�'����*]�	j�>&/��Όv�2�gJ��B��T�ٴҦ��Y��22i�V�{�۾K��h�pʟ�0��eS�7�-om�"t�������{��eS_oLc睦R�r;*��W�'Z�d5�h������ޡ��Jן��l��ɍiN
    �옠j�B346�{́������M����o�}���c�GHdi�$�'��g�;w��W�B�u�}Bi��v_u�6�Bws��T�0����\�\W�h�3^�}��A��7=�6D�V`��wka�n�Ţ��,Ħ	�ݶ��W��Q�؍>K��z)c�R��^G����=�ב2�,eO�u�,z����:R?K��z)K���^�@Q��|�>�㎇n�Ȟ�ؿ>g*eS�A)��KG�������P�����2Z4�����A�K�h�A;{�jC�e��Nk�AP�+Z�G��`��2�e�P�����S�;�^/o;]�j��퉰]���`�������y[?\�&����Te�u�����[��Ug�jb���U�8��~����E�M�|�+�m���MѸ����ý��U��4$!$%4�.us��'�=�����������M^��~q�^Amt�t7\LG�ߴ2K4��u�J���T��~��M_o��
    |/����m���l������d��{�NhL��ؓ�V�"���e�n���/��Z(%:6�w��
    ����P�>�c+�A5��?VM��3���Ơ���L8����Jw�鮶�%n�i{6���������
    � 㶳9�vڳ��S�����2C�-��f��=��ƽ��,��C�������Y.!*u���?����\�����!��%�9$��$r�D>H�r�PKz�:�p�6PK-h��Z�Y��
     ��digital-1.binPK-h��Z��e=R
     ��digital-3.binPK-h��ZMӸ�e
    
     ���digital-0.binPK-h��Z<g�>Y
     ���digital-2.binPK-h��Zz�:�p�6	 ��Kmeta.jsonPK#�

    If you need more information from my side, please let me know.

    Best regards,

    Lin

  • Hi Ming,

    For the data results, looks like the MOSI data is not ready when the first rising edge of CLK coming, 0x010203 => 0x008101 and 0xAABBCC => 0x555DE6,  just one bit delay. Any hint or suggested solution?

    Best regards,

    Lin

  • Hi Ming,

    One more test result to share with you.

    I verified the one bit shift by changing the mode from 0 to 1, CPOL = 0, CPHA =1 as shown in screenshot, and get the correct decoded data. I mean 0x010203 => 0x010203 and 0xAABBCC => 0xAABBCC.

    However, our peripheral SPI devices, such as LMX2595, are all in mode 0, CPOL = 0, CPHA =0. How can we modify controller SPI in AM273x side to meet the requirement?

    Best regards,

    Lin

  • Hi Ming,

    Sorry for sending your too many messages today, as i'm blocked by this SPI issue so felt pressure and wanted to catch up a bit.

    As I sent out the last message, I should come to some kind of solution. However, I'm kind of hurry and not in good condition. So it's delayed to have the results. The main finding is as below. The SPI mode between AM273x EVM and Saleae Logic 2 does NOT match. The relation is as below:

    AM273x EVM                                       Saleae Logic 2
    Mode 0 (POL0 PHA0)                          Mode 1 (CPOL=0 CPHA=1)
    Mode 1 (POL0 PHA1)                          Mode 0 (CPOL=0 CPHA=0)
    Mode 2 (POL1 PHA0)                          Mode 3 (CPOL=1 CPHA=1)
    Mode 3 (POL1 PHA1)                          Mode 2 (CPOL=1 CPHA=0)

    Could you double check them on your side?

    Did I mis-doing anything in my setting and code? Or is it a bug in TI's MCU+ SDK?

    Looking forward to your confirmation.

    Best regards,

    Lin

  • Hi Lin,

    I also confirmed that the issue is with the SPI mode 0. When I change to mode 1. It works perfectly.

    I know the AM273x EVM SPI modes are matching your description. I also confident what AM273x EVM doing is correct. I do not know what the Saleae Logic 2 is doing.

    Best regards,

    Ming

  • Hi Ming,

    Thanks for your confirmation.

    May I know if you can get and open my Saleae capture files those I sent in the previous messages within the Saleae Logic SW? I wanted to make sure in the future we can exchange/share the results and status in that way.

    In addition, I have questions about your confirmation SPI signal capture. I saw two pulses in the SPI enable/CS signal and SPI CLK signal also has some delay between bytes. Will those be potential problems/issues for the SPI communication? Or they are acceptable.

      

    Thanks and best regards,

    Lin

  • Hi Lin,

    Yes. I can open your *.sal file.

    The CLK pauses between the bytes is OK.

    Best regards,

    Ming

  • Hi Ming,

    Good to know that. Later on I will share my Saleae capture file in that way,

    Your confirmation of the CLK pauses are okay makes me more confident for my project development.

    BTW, I have got the 60-pin ZX100QTH adapter. I would like to check the MSS_SPIB signals on the J7 of the AM273x EVM. Could you make sure, once the S2 switch to DBG_SPI, which pins I can get CLK, CS, MOSI and MISO signals from J7mof EVM?

    Thanks for your continuous support.

    Best regards,

    Lin

  • Hi Lin,

    Yes, set S2 switch to DBG_SPI, you should get CLK at Pin9, CS0 at Pin7, MOSI at Pin11 and MISO at Pin12 of J7 of EVM.

    Best regards,

    Ming

  • Hi Ming,

    Thanks for your information. I will test them with the adapter.

    Best regards,

    Lin

  • Hi Ming,

    To get SPI MISO signal, what should I pay attention in the coding? When I tried to read back from slave/peripheral device, the data on MISO is meaningless.

    Appreciate your help.

    Best regards,

    Lin

  • HI Lin,

    Since the AM273x is the SPI master, so it has to provide the clock for the MISO when reading from the SPI slave. In order to provide the SPI clock, the AM273x has to transmitting data, even the data to be transmitted is garbage.

    /* Initiate transfer */
    spiTransaction.count = APP_MIBSPI_MSGSIZE;
    spiTransaction.txBuf = (void *)gMibspiTxBuffer;
    spiTransaction.rxBuf = (void *)gMibspiRxBuffer;
    spiTransaction.peripheralIndex = 0U;
    spiTransaction.arg = NULL;

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

    Best rergards,

    Ming 

  • Hi Ming,

    I really need your help to read back LMX2595 register content. I know you told me that you are not familiar with the LMX2595. So I created another post and ask for help on LMX2595 chip set configuration. However, when I told the person that we want to use the AM273x EVM to control/communicate with the LMX2595 chip set, then the support person let me back to AM273x expert. So I hope to get your help for our development. Right now the only issue is the register read back. 

    I follow the datasheet created the read back code based on our original 4 pin MSS_SPIB setting. I share the code here, could you help me to check if there is anything wrong or I miss anything?

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

    txBuf[0] = regAddr;
    txBuf[1] = (regData >> 8) & 0xFF;
    txBuf[2] = regData & 0xFF;

    spiTransaction.count = 3;
    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("LMX2595 SPI transfer failed!\r\n");
    DebugP_assert(FALSE);
    }
    }

    void lmx2595_read_register(uint8_t regAddr)
    {
    uint8_t txBuf[3] = { 0x80 | regAddr, 0x00, 0x00 }; // Set MSB for read
    uint8_t rxBuf[3] = { 0 };
    MIBSPI_Transaction spiTransaction = {
    .count = 3,
    .txBuf = (void *)txBuf,
    .rxBuf = (void *)rxBuf,
    .peripheralIndex = 0U,
    .arg = NULL
    };

    int32_t transferOK = MIBSPI_transfer(gMibspiHandle[MSS_SPIB_J16], &spiTransaction);
    if ((transferOK == SystemP_SUCCESS) && (spiTransaction.status == MIBSPI_TRANSFER_COMPLETED))
    {
    uint32_t value = (rxBuf[1] << 8) | rxBuf[2];
    DebugP_log("Read R%u = 0x%04X\r\n", regAddr, value);
    }
    else
    {
    DebugP_log("SPI read failed! Reg 0x%02X\r\n", regAddr);
    }
    }

    In the mibspi_loopback_main() 

    sendLmx2595Frame(0x00, 0x2518); // Set MUXOUT_SEL = 0 for readback  R0-D2
    ClockP_usleep(5000);
    lmx2595_read_register(110);       ///per datasheet, only R110, R111, R112 can be read back 

    Appreciate your time and help.

    Best regards,

    Lin

  • Hi Lin,

    Again, I am not familiar with the LMX2595, so I do not know the SPI protocol it used to read its register content.

    I went through your code. I saw a potential problem in  lmx2595_read_register():

    You only sent a SPI 3-byte command:

    { 0x80 | regAddr, 0x00, 0x00 }; // Set MSB for read

    The LMX2595 gets the command at the end of this SPI transaction, therefore it cannot return the data you requested in the same transaction. The chip needs time to prepared data you requested. It will be able to send the data you requested in the next SPI transaction. You will need to do another 

    MIBSPI_transfer(gMibspiHandle[MSS_SPIB_J16], &spiTransaction);

    after some delay (for the LMX2595 to prepare the data you requested) with the TX buffer filled with 0s and the RX buffer ready to receive the requested data. The AM273x will provide the SPI clock for the LMX2595 (SPI slave) to send the data to AM273x (to RX buffer)

    Above analysis is purely based on the general principle of how the SPI works. Please check with the LMX2595 person in the details.

    Best regards,

    Ming 

  • Hi Ming,

    Thank you very much for your taking time to check my code and explaining the SPI reading principle.

    I will try that second read or write to see if I can get correct data. I will update you once I have done.

    Best regards,

    Lin

  • Hi Ming,

    by running the MIBSPI_transfer(gMibspiHandle[MSS_SPIB_J16], &spiTransaction); second time or by running a dummy write command, looks like the read back data is still not correct. I'm trying some other ways.

    FYI, I keep setting the AM273x SPI in mode 1 not mode 0 to communicate with LMX2595 (it requires mode 0) in my above testing. If I change AM273x SPI mode to 0, it get even worse.

    If you have any other suggestion, please let me know.

    Thanks and best regards,

    Lin

  • Hi Lin,

    You will need to talk to the LMX2595 person to get the details of the SPI read protocol including the delay needed between the sending read command and start reading data from LMX2595.

    You can share your data to and from the LMX2595.

    Best regards,

    Ming

  • Hi Ming,

    Thanks for your suggestion. I will do that way.

    Best regards,

    Lin

  • Hi Ming,

    I think I got super support from you for the "MIBSPI MOSI data is not correct" issue in this post. I will check the box This resolved my issue and close this post. I hope I will continue talk with you for the AD7389-4 ADC configuration and data acquisition in another post. 

    Appreciate your help and support.

    Best regards,

    Lin