MENU

Fun & Interesting

Beginners Guide to SPI on the Raspberry Pi Pico (BMP280 Example)

Learn Embedded Systems 55,976 4 years ago
Video Not Working? Fix It Now

This video covers the basics of the SPI communication protocol and how to use it on your Raspberry Pi Pico. We use a Visual Studio Code project to program the brand-new Raspberry Pi Pico microcontroller board in C. We created a project which uses the BMP280 temperature and pressure sensor to read values of temperature over SPI and print them to a serial monitor over a USB connection to a PC. This video provides the fundamental background of the SPI communication protocol and explains how to correctly wire an SPI compatible device to the Pico. It explains which functions in the Pico SDK to use in order to communicate with this device. We also cover how to configure the Raspberry Pi Pico correctly, in both the CMakeLists file and the C file, in order to enable SPI communication. As an example, the BMP280 breakout board from Adafruit is used to demonstrate writing to, and reading from, registers on a peripheral device. This video also shows you where to find the required information in your particular peripheral device’s datasheet in order to get your peripheral device functioning correctly. The source code for this project (and a written article version coming soon!) is available here: https://learnembeddedsystems.co.uk/bmp280-and-pi-pico-over-spi BMP280 Breakout board is available at Amazon (Affiliate): UK: https://amzn.to/37xenFP US: https://amzn.to/3qCwMZi Timestamps 00:00 Introduction 00:53 SPI Basics 02:41 Pico Wiring 03:49 SPI Protocol 05:11 Pico SDK I2C Functions 06:12 Read/Write Operations 07:02 Programming Example 13:38 Conclusion If this video helped you, please consider leaving a like and subscribing, thank you! To see my other videos on the Raspberry Pi Pico, check out the playlist here: https://www.youtube.com/playlist?list=PLEB5F4gTNK68IlRIJtcJ_2cW4dSdmreTw You can find more embedded systems tutorials and projects on my website https://learnembeddedsystems.co.uk -- Equipment I use regularly -- The following links are affiliate links where I may make a small percentage on qualifying sales through these links. Use the respective UK or US links listed. Budget Soldering Iron: UK: https://amzn.to/3pQpvUu US: https://amzn.to/3bBawIJ Breadboards: UK: https://amzn.to/3solZCe US: https://amzn.to/3dGsHiS Jumper Cables: UK: https://amzn.to/37JfToi US: https://amzn.to/3r384S9 Camera: UK: https://amzn.to/3qKLwFr US: https://amzn.to/3pK0V7C Lens: UK: https://amzn.to/380lQxp US: https://amzn.to/3knH3WL Tripod: UK: https://amzn.to/37H0Nzw US: https://amzn.to/3byKHsV All videos and tutorials on this channel and mentioned websites are for educational purposes only.

Comment