Skip to main content
Siragh ASUTP
Associate II
Jul 10, 2017 3:26 PM UTC
Question

The problem with receiving signals by SPI

Posted on July 10, 2017 at 17:26

Hello.

I want to connect an electronic micrometer to the microcontroller stm32f103�?8t6. The electronic micrometer has 2 outputs (date and clk). Judging by the readings of the logical analyzer, this is similar to the SPI protocol.

In the cube I connected SPI1 (Receive Only Slave, Hardvare NSS-disable) through DMA (DMA in normal mode).

In the program, sw4stm32 indicated the function of receiving spi through DMA (HAL_SPI_Receive_DMA (& hspi1, (uint8_t *) pBuffer, 3)).

The reception of bytes occurs (every 100ms), but the buffer array constantly increases with the arrival of each packet and is not overwritten.

How to overwrite an array of DMA with the reception of each parcel, clearing the previous value?
    This topic has been closed for replies.

    2 replies

    David Littell
    Senior II
    Jul 10, 2017 6:18 PM UTC
    Posted on July 10, 2017 at 20:18

    Possibly circular mode might help.  Or just re-issue the HAL_SPI_Receive_DMA() using the base address after each transfer.

    Siragh ASUTP
    Associate II
    Jul 10, 2017 9:26 PM UTC