2017-02-06 09:09 AM
Hello,
I'm trying to implement a software that will allow me to send additional one pulse (on the data wire and clock wire). After one pulse I should send data (32 bits) over spi.
Frame should look like:
1 bit + 32 bit
clock pulse every bit
I tried to send 0x80 over SPI and USART but no luck - for 0x80 i have 8 clock pulses. How to implement one clock pulse? PWM? Timers? Dma?
I would be grateful for every idea !
John
#solution-needed #idea-needed2017-02-06 09:18 AM
Momentarily flip the data and clock lines into GPIO mode and as outputs, start a timer for one bit time, flip them back when the timer runs?
2017-02-06 09:33 AM
I would like to mention that SPI is not required. It's about synchronized data send (one bit per one clock pulse)
2017-02-06 10:28 AM
Thanks, that's a good idea but using that solution i'll propably lose on performance for a larger sets of data.
2017-02-06 10:41 AM
Is there no solution to generate synchronized PWM with clock pin?
2017-02-06 10:55 AM
Does your part's USART support 9 bit mode?
2017-02-06 10:56 AM
Yes, it does. Currently working on stm32f10x.
2017-02-06 11:24 AM
It wouldn't be a performance win either but perhaps send the first byte of the 32 bit transmission in 9 bit mode with the leading bit set the way you want it? Or externally gate clock and data with a timer output?
2017-02-06 02:30 PM
No, the peripherals are of pretty simple and limited functionality. Want to do odd things, use an FPGA/CPLD
Want to send 8x 33-bit values, have the SPI DMA 33x 8-bit values where your 32-bit data is slewed across the buffer.
Use TIM1/8 in One-Pulse, 33x Repetition (or x66 for transitions), and DMA to GPIOx->BSRR, from a pattern buffer.
2017-02-08 12:18 PM
8x33-bit? You mean 33 bytes?