cancel
Showing results for 
Search instead for 
Did you mean: 

How to send additional bit?

John Doe1
Associate III
Posted on February 06, 2017 at 18:09

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-needed
12 REPLIES 12
Andrew Kitaev
Associate
Posted on February 09, 2017 at 13:59

I had a similar task.

One solution is to switch to 11-bit mode and send three 'words' of 11 bits. Of course with prior bit shifting and splitting of original 32-bit data.

Posted on February 09, 2017 at 14:41

 ,

 ,

The 3x11 trick may be nice but possible only on newer STM32s which have more flexible setting than the '

SPI which allows only 8 or 16 bit frames.

JW

Posted on February 09, 2017 at 16:46

I mean 33-bits eight times, a frame of 264 bits total arranged in memory as 33 bytes. You want to clock out 32+1 bits, if you don't need a chip select pulse every 33 bit, array the memory so you can fit the frame into the granularity the hardware offers.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..