Frequently Asked Questions
Mon-Fri, 9am to 12pm and
1pm to 5pm U.S. Mountain Time:
Chat With Us
May 31, 2010
about 3 years ago
I bought an evaluation kit so I could get the new firmware. The kit came with a USB TTL adapter, which was useful for easily updating the firmware on the breakout board. I also used the evaluation kit as a reference to debug my hardware and software. The kit was $260 plus shipping, but it saved me a ton of time.
Yes, finally! First, you need at least the 2.3 firmware. I am using 2.3.5. The module I received only had 2.2.
My MPU is an atmega328p. The programming notes in its MPU manual are straight forward for setting up the SPI and work as needed.
The problem I had arose from the GainSpan documentation. Although this module’s manual has been updated to conform to the 2.3.5 firmware, it is lacking some details on the SPI interaction that make it somewhat misleading.
SPI interactions are full duplex. As the MPU is shifting bits out to be written, bits are being shifted in from the target device. Consequently, when the MPU is reading data from the module it must send idle bytes on the bus to generate the master clocking.
The GainSpan manual discusses an escape sequence for byte stuffing bus control including the special idle character. This is misleading in that you don’t actually need to escape the idle character, just send it directly. This tripped me up for days.
The other secret is that the firmware implements the SPI as a completely binary interface instead of a character-based one like the USART uses. GPIO28 is asserted high when there are data available and goes low when the buffer has been completely read. The result is that the MPU must read everything from the module while GPIO28 is asserted.
The MPU will receive a bunch of idle characters as well as the character commands it is interested in for every complete buffer read. The application software will need to parse the characters from the buffer to extract the data it needs. This tripped me up as my software always stopped reading when it received the complete OK or ERROR response.
No public wish lists :(
Forgot your password?
No account? Register one!