Hi all,
pls help me, how i programmed 9bit spi?
Thx
Hi all,
pls help me, how i programmed 9bit spi?
Thx
stafil - The STM32F103 in Maple and Maple-mini only support 8 or 16 bit SPI transfers. So you could try the hardware route and get a board with a newer MCU, like an STM32F3, STM32F4, STM32F05, for example on one of ST's Discovery boards.
Or you could do it by 'bit-banging', which is changing the state of output pins in software.
Very helpfully, tlgosser has posted a link to code which does this on the thread http://forums.leaflabs.com/topic.php?id=11844
So you could try reading that, and come back with questions.
How fast does the transfer need to happen? A carefully written software approach will run at a few megabits/second. So software SPI might be too slow.
Does the program need to do anything else? If it has to do a lot of other processing at the same time, software SPI might take too much processor time.
In either case, you could 'make' you're own SPI. SPI is just a shift register, which are typically under $0.50, and with care two can be 'stacked' to make 9 bits. It could be loaded 9 bits at a time, or less bits if the MCU is short of pins. You'll look for Parallel In Serial Out (PISO) shift registers, for example 74HC165 (http://uk.rs-online.com/web/p/counters-shift-registers/1697453/)
The other SPI signal is a 'clock', which is a continuous square wave which runs will data is being moved. This would be generated by a timer output compare (PWM) pin.
You must log in to post.