Mighty Gecko SPI Driver
"Help! I've been turned over and I can't turn around!"
By Noah Schwartz
Winter 2021
"Help! I've been turned over and I can't turn around!"
By Noah Schwartz
Winter 2021
The Mighty Gecko SPI Driver project involves the creation of a custom Read/Write SPI driver and device layer, enabling seamless communication between the Thunderboard Sense 2 microcontroller and the onboard ICM 20648 accelerometer. Additionally, the project incorporates an HM-18 Bluetooth module to send orientation-related messages to a smartphone device. The system intelligently responds to the board's orientation, emitting a distress signal and light when upside down and expressing gratitude when upright. This project serves as a testament to my proficiency in applying embedded software principles to real-world applications.
To streamline the development of the SPI Driver, I crafted two comprehensive software flow ladder diagrams—one dedicated to the read operation and the other to the write operation. These diagrams proved instrumental in simplifying the intricate process of driver creation, particularly given its inherent complexity. By diligently consulting the Thunderboard Sense 2's datasheet, which offered concise instructions for configuring SPI, I gained invaluable insights. Building upon this knowledge, I delineated distinct stages (states) for both the read and write operations, identifying the necessary parameters to modify and interrupts to enable or disable at each state.
During the actual software implementation, the driver seamlessly integrates a combination of interrupts and case statements, ensuring efficient and reliable functionality. Additionally, to bolster reliability further, I adopted test-driven development principles when configuring the ICM 20648 accelerometer. This rigorous approach ensured the driver's correctness at each step of the configuration process, instilling confidence in its performance and adherence to specifications.
Demonstration Photos
Everything is fine here!
See how it's crying out for help? The green LED turned on!
Yay! It's back to the way it was, without the green LED on. It even thanked us for our efforts!