1 Reply Latest reply on Oct 23, 2014 3:26 AM by JaWa_2142591

    SPI timing

      Hi all,

       

      I have a problem when I use SPI as slave mode ( BCM20732).

      When I receive data from external MCU via SPI, I try to write this data to a characteristic value.

      Code below:

                          spiffyd_slaveRxData(SPIFFYD_2, length, &buffer[1]);                 

                          db_pdu.len = length;

                          memcpy(db_pdu.pdu, &buffer[1],length);

                          bleprofile_WriteHandle(HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE, &db_pdu);

                          bleprofile_sendNotification(HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE, (UINT8 *)db_pdu.pdu, db_pdu.len);

       

      It's take about 3ms to do this.

      And when I don't write data to characteristic value:

                          spiffyd_slaveRxData(SPIFFYD_2, length, &buffer[1]);                 

                          db_pdu.len = length;

                          memcpy(db_pdu.pdu, &buffer[1],length);

                         // bleprofile_WriteHandle(HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE, &db_pdu);

                        //  bleprofile_sendNotification(HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE, (UINT8 *)db_pdu.pdu, db_pdu.len);


      It's take only about 100us.

      Why do bleprofile_WriteHandle() and bleprofile_sendNotification() functions take a long time?

      How can I speed up this?

        • 1. Re: SPI timing
          JaWa_2142591

          Can I know how do you measure the time? Start and stop at where?

           

          If you are talking about late receiving at central side, you can try to use an aggressive connection interval by calling lel2cap_sendConnParamUpdateReq() after connection is up but that could consume more battery power.

          1 of 1 people found this helpful