STM32F042 SPI DMA: Gaps between SPI Frames
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-02 2:44 AM
Hello
Is there a possibility to reduce the time gap between two consecutive SPI Frames? Background: I would like to use only the MOSI signal without the clock to send information to some addressable LED (WS2812). They just measure the time between rising and falling edge of the signal to determine the data. With gaps between the frames, the timing of the MOSI signal is destroyed for a MOSI without Clock usage.
I have the following Setup:
- Atollic TrueSTUDIO for STM32 9.0.1
- STM32F042K6T Nucleo Board, with internal HSI48 Clock
- CubeMx HAL (STM32Cube FW_F0 V1.9.0)
- SPI Configured with baud rate 3MBit/s, 16bit data size, transmit only, SPI Tx DMA, highes priority
In the main programm I have a uint8_t array with values to send over SPI.
uint8_t DataToSend[]={0xBB,0xBB,0xBB,0xBB,0x88,0x88,0x88,0x88,0xBB,0x88,0x88,0x88,0x88,0,0,0,0,0,0};
In the main loop, I call the following functions:
HAL_SPI_Transmit_DMA(&hspi1,DataToSend,sizeof(DataToSend));
HAL_Delay(1000);
With an attached scope, I can measure that the data is transmitted.
But between two blocks of 16 bits, there is a time gap of about 660ns (about two bit times) is there a possibility to reduce that gap close to zero so that no time space between the frames can be seen?
Attached you can find my minimal project. In Atollic TrueSTUDIO use File-->Import-->Existing Projects into Workspace and select the attached zip file. In the zip file, you can find the oscilloscope screenshot as well.
Thank you for your help.
Marco
Solved! Go to Solution.
- Labels:
-
DMA
-
SPI
-
STM32Cube MCU Packages
-
STM32F0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-03 2:34 PM
> hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
is what makes the spaces between frames.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-03 2:34 PM
> hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
is what makes the spaces between frames.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-04 1:19 AM
Thank you for your answer. This solved the issue.
Thanks a lot for your help.
Best, Marco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-04 5:20 AM
If resolved, please mark as so (Best). Thanks.
JW
