Here's how we control #BL602 #SPI Chip Select Pin ourselves ... Using plain old BL602 GPIO
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L47-L128
Nope #BL602 #SPI HAL can't control Chip Select Pin by #GPIO ... Because it has already configured the pin for SPI Port earlier ... Let's control the pin ourselves 👋
https://github.com/lupyuen/bl_iot_sdk/blob/spi/components/hal_drv/bl602_hal/hal_spi.c#L98-L122
@lupyuen wow $48. In Cambodia $2/kilo on any market. 😮
Thankfully #BL602 SPI HAL lets us use GPIO to control the Chip Select Pin ... But we have already configured the pin for SPI Function ... Will this conflict with the GPIO Function? 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/spi/components/hal_drv/bl602_hal/hal_spi.c#L479-L519
Ugh #BL602 is disrupting the two SPI Transfers ... By setting the Chip Enable Pin high ... Let's control Chip Enable Pin ourselves with GPIO
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L70-L114
LA2016 Logic Analyser comes in this beautiful inspirational box ... "Embedded Development Kit: Innovative concept, win-win cooperation"
Nope #BL602 still receiving garbage from BME280 ... Let's do the #SPI Logic Analyser!
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L70-L114
Let's try 2 #BL602 SPI Transfers instead of 1 ... First SPI Transfer transmits Register ID ... Second SPI Transfer receives the result from BME280
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L70-L114
#BL602 SPI Data Pins seem to be flipped ... Based on SPI data sniffed by Logic Analyser 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L49-L67
“The Cantonese word for [ non-starch ], sung, 餸, is so pervasive that “the word for ‘grocery shopping’ in Cantonese is mai [sung], or ‘buying sung,’ since the starch is a staple that would already be in the house.”
https://www.atlasobscura.com/articles/do-italians-eat-spaghetti-and-meatballs
Start programming in #Racket by writing a "guess the number" game
Logic Analyser captures SPI Data between #BusPirate and #BME280 ... So cool! 🤩 Now to capture #BL602 + BME280 and compare
...But now we get pretty Blue and Red Lights on #PineCone #BL602! 🤩 Time to do the SPI Protocol Analyser ... My first time ever!
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L49-L67
Nope Recommended SPI Pins for #PineCone #BL602 also don't work
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L49-L67
IoT Techie and Educator / Apache NuttX PMC