When an input pin isn't one
The article about the ESP-Link ended with what turned out to be an ominous note, in hindsight:There’s still a buglet in this setup: the “reset” word leads to a runaway loop of “Unhandled Interrupt...
View ArticleGreat ADC/DMA performance
For the “JEM” JeeLabs Energy Monitor, we’re going to need to put the ADC on the Olimexino’s STM32F103 to some serious work: the goal is to acquire 4 ADC channels at 25 Khz each, so that we can capture...
View ArticleSome µC speed measurements
Not long ago, Ken Boak very generously donated one of his assembled PCB designs to JeeLabs:This is a break-out board for the STM32F746VG, an ARM Cortex M7 CPU with floating point and a whopping 1 MB...
View ArticleTracking pulses w/ interrupts
There are three pulse counters for measuring power at JeeLabs - one for solar PV production and two for the kitchen stove and the rest, respectively:These generate 2000 pulses per kWh, that’s one pulse...
View ArticleFrequency aliasing in ADCs
This is a pure sine wave, captured by the ADC + DMA code, as described previously:The plot above consists of 800 samples, sampled 40 µs apart, i.e. at 25 kHz - for a total of 32 ms. A quick calculation...
View ArticleSimple variable packet data
Until now, most of the wireless sensor nodes here at JeeLabs have been using a simple “map C/C++ struct as binary” approach as payload format. The advantage of this is that it simplifies the code in C...
View ArticleParsing P1 smart meter info
The smart meter at JeeLabs looks like this:It’s a Landis & Gyr E350, which monitors all power coming into the house and going out (when solar PV production exceeds local consumption). There’s an...
View ArticleThe need for multitasking
With an increasing number of sensing and reporting activities taking place on the JeeLabs Energy Monitor (JEM) prototype, things are starting to become a bit more complicated.How can we deal with such...
View ArticleUsing a buffered serial console
Mecrisp Forth comes with a serial-port command line interface. This makes both tinkering and uploading new code a breeze, but it’s nevertheless a fairly limited setup:no input buffering: if characters...
View ArticleUSB serial in Forth, progress!
A while back, an article was posted about the lack of USB on STM32F103 µCs, when it comes to Mecrisp Forth, that is. Unfortunately, getting the built-in USB device-mode hardware working is quite a...
View ArticleLet's start with a Blue Pill
If you search for “stm32f103c8t6 board” on eBay, you will get lots of hits for what is essentially a single product, to be called the “Blue Pill” from now on:The price of these boards is absolutely...
View ArticleUSB serial is a good way to go
Note: let’s use “F103” as shorthand to avoid typing “STM32F103C8T6” all the timeThe F103 has a built-in ROM-based boot loader, so there’s no risk of ever damaging it, but it’s quite limited since it...
View ArticleWe need a toolchain and library
Now that the connections and uploading have been dealt with, let’s turn to generating code.First of all, we need a C/C++ compiler: this one. GCC is now at version 5.0, but 4.8 is also fine (there have...
View ArticleLED blinks and serial echoes
Compiling software for the F103 is very easy but – as so often – does take a little preparation. In this case, we will need set up a few build files and make sure they are correct for the F103.But...
View ArticleHooking up an RFM69 radio
It’s time to step things up a bit. Let’s create a wireless node, with an RFM69 attached to an F103 µC, and then see if we can make it sing…We’re going to need two nodes, if we want to actually test...
View ArticleFancy serial with a SerPlus
So far, to upload new code to a Blue Pill, you had to change a jumper, press reset, perform the upload, change the jumper back, and press reset again - this will quickly become very tedious!So why not...
View ArticleStop staring at that screen!
Embedded software development can usually be characterised by the following diagram:In other words: a “host” computer with a cross-compiler, where you enter code, compile it, and upload it to a...
View ArticlePeeling off layers of complexity
As you know, compilers generate code. They take one or more source files and turn them into an executable. In the case of embedded software development, the compiler is actually a cross-compiler...
View ArticlePolish notation and tiny words
Ok, so what is this “Forth” thing like, as programming language?One way to answer this question, is to point to the Forth in 7 easy steps article, published a while back on this weblog. Go ahead and...
View ArticleLet it burn, then press CTRL-C
We’re about to try out Forth on real hardware. The implementation used here at JeeLabs is Mecrisp Forth by Mattias Koch. It’s fully open source (GPL3), it’s well-supported, it’s robust, it’s available...
View Article