Skip to main content

Posts

Showing posts from 2018

California fires + Air Quality + Ada + Bluepill + PMS7003

Camp fire The Camp fire has had a big effect on the Air Quality Index (AQI) in the Bay Area over the past week or so. AQI is typically measured as an entry in one of 7 bands: https://en.wikipedia.org/wiki/Air_quality_index To compute the AQI (typically cited from the PM2.5 #) a formula is used. See the wiki page above. The PM2.5# is in  µg/m 3  fortunately there is a Chinese sensor, the PMS7003 that can provide PM1, PM2.5 and PM10 in those units: https://botland.com.pl/index.php?controller=attachment&id_attachment=2182 So we have a sensor, we already have a Bluepill running Ada with an SPI screen to display the results.  The sensor is a $20 eBay purchase. Bluepills are < $2 as documented on this blog, screen is a little over $3. So for $25 or so you can build your own AQI meter. Code is in:  https://github.com/morbos/STM32/tree/master/F/F103/aqi3

Bluepill+: Diagnosing bad solder joints

If your like me... a FW engineer attempting to do soldering then this might sound familiar. I have been replacing Bluepill STM32F103C8's with STM32L443CC chips. Its a hack as I do it as I use hot air for the remove and then residual pad solder for the stick down of the replacement. Not surprisingly, some pads don't get good adhesion. Worse, some pads don't show this lack of adhesion until much later when you need the pad to do something useful. The STM32 series are quite good, I think all user pads can be made into GPIOs. What if we wrote a program that toggled each pad every second and then walked the pins with a meter. So that program was written. https://github.com/morbos/STM32/blob/master/L/L443/pinny/src/pinny.adb That's great! Take a look at that code for the abstraction on the GPIOs that the Ada Device Library provides with type GPIO_Points is array (Positive range <>) of GPIO_Point; The magic decl in pinny is: BP_Points : GPIO_Poin...

Tracing a Bluepill

Did you know the lowly STM32F103C8 has non-invasive trace logic along for the ride? Did you also know that via program control: 1) Trace can be enabled out to a pin on the board (PB3). 2) 32 channels can be used to emit 32, 16 or 8bit (char) values from running code. Useful to monitor values from your code. 3) A cycle count can be emitted 4) Data Watchpoints can also be reported. See a picture below. Showing SysTick exception handling: Showing a sensor range value being emitted on channel 16 (that's the max 1FFE in mm's btw) Showing a watchpoint on the read modify write of the Green LED on PC13 (HW watchpoint on: BSRR @0x40011010). Also an Overflow is seen (first time I have seen that actually). Can be mitigated by bumping the output rate. Bluepill shown with a VL53L10X range sensor. The trace is the yellow wire connected to TRACESWO PB3 and green wire is connected to GPIO1 from the sensor. That is plumbed up to go low when a new sample is re...

The Bluepill+

The STM32L443CC 'Bluepill+' Following up from the work I did on getting Ada going on a Bluepill.  http://www.hrrzi.com/2017/11/ada-on-2-ebay-bluepill-board.html Is a Bluepill a fixed entity? Looking at the SoC the Bluepill uses we see it is a Cortex-M3 running at 72Mhz with 128k of flash and 20k of ram. There are newer STM32 chips all the way out to Cortex-M7's. I have this tool from ST called the ST MCUFinder. You can screen all their parts by different parameters. I had already hacked Ada onto the STM32L432 for the Make-with-Ada contest last year so the L series was still quite fresh in my mind. So looking at the package the STM32F103C8 on a stock bluepill was there a newer, pin compatible, STM32 cpu across the family that could drop in and work in place of the original? I will spare dear reader the suspense, indeed there are a bunch of parts that have the same footprint. The candidate CPU for Bluepill+ STM32L443CCT6 That part uses a Cortex-M4F, runs at...

Seaplane VH-NOO

We took this 29/12/17. On 31/12/17 this ac crashed in the Hawkesbury River nr Sydney http://www.bbc.com/news/world-australia-42527530