2012-01-25 01:13 AM
Hi
Can somebody point me in the right direction. I have a peripheral that uses a strange SPI where the data is triggered on both rising and falling edge of the clock. I have heard the i could use a timer as a divider and make an output that changes it state by triggering on the rising edge of an input pin, I have made an image of it. I'm using a STM32f103c8. Can somebody please help #spi-timer2012-01-25 01:48 AM
Hep Mikkel,
not sure, what it is you want, but why dont you use an external interrupt.... /Finn2012-01-25 02:04 AM
Hej Finn!
The problem whit an interupt is the delay(i have tried it already), i still use the SPI data pin, so the data is not aligned whit the new clock that i create in my interrupt routine. Men ellers tak :)2012-01-25 04:58 AM
No, not really, the timers aren't that efficient, you could try an external flip-flop? Getting the timer to do a divide by 2 might be possible, you'd feed the source clock in via an ETR pin, and get it out via a CHx pin. They'd probably be a lot of phase/delay.
Other that that consider bit-doubling the data you want to send, so instead of transmitting 8-bits, send 16-bits. ie 01010101 -> 0011001100110011 You could extract data in a similar manner. Not sure if that achieves what you need. You could also just bit-bang the GPIOs directly.2012-01-25 05:36 AM
Ok but after reading a bit i still think it is possible what if i use a counter that has a external clock source, eg the SPI clock and connect i back ind to the processor to a TIM etr, then make a counter that counts to 2 and make that toggel a pin?
2012-01-25 07:27 AM
Thank for the input! We have deside to use a D-type flip-flop to do the trick.
Thanks Mikkel