Buffered serial port interrupts
Mecrisp only implements the minimal serial interface required, i.e. USART1 with polled I/O. This is very limited, because the serial port has no buffering capability: if we don’t poll it often enough...
View ArticleMuch faster SPI with hardware
Unlike an USART-based serial port, SPI communication is not timing-critical, at least not on the SPI master side. Since the data clock is also sent as separate signal, slowdowns only change the...
View ArticleTalking to a 320x240 colour LCD
Now that we have a fast SPI driver, we can tackle a more ambituous task of driving a 320x240 colour LCD display. In this example, we’ll use the HyTiny board with this 3.2” display, because the two can...
View ArticleThe Dime-A-Dozen collection
One attraction of the STM32F103 series microcontrollers, is that there are lots of them available on eBay at ridiculously low prices. There are many variants of this µC, with flash memory sizes from...
View ArticleLCDs need a lot of bandwidth
So far, we have created two display implementations for Mecrisp Forth: a 128x64 OLED display, connected via (overclocked) I2C, and a 320x240 colour LCD, connected via hardware SPI clocked to 9 MHz....
View ArticleThe amazing world of DMA
There are a lot of features hiding in today’s microcontrollers - even the STM32F103 series includes some very nice peripherals: 2 to 3 A-to-D converters, sampling up to a million times per second on...
View ArticleReading ADC samples via DMA
Now that we have seen how to push out values to the DAC without CPU intervention… can we do the same for acquiring ADC sample data? The answer is a resounding “yes, of course!” And it’s not even hard,...
View ArticleDiving deep into STM32F103's
Mecrisp Forth 2.2.2 has been flashed onto a new series of boards here at JeeLabs, all with an STM32F103 µC, but of different sizes and with different features on-board. Haoyu Core Board One Well, it’s...
View ArticleThe lack of USB support
Those pictures you’ve been seeing in recent articles, with over a dozen boards by now, all have the same configuration in common: boards with a USB port on them, connected and powered through anything...
View ArticleJET and Forth, some thoughts
The JET project is about “creating an infrastructure for home monitoring and automation” (it’s actually considerably more, but this is a big-enough bone to chew on already…). Note that JET is not about...
View ArticleUSB on STM32F10x µCs
Every µC from the STM32F10x family has hardware built-in to support USB. The earlier (i.e. smaller) STM32F103’s have a more limited implementation that more recent models. There are some really strange...
View ArticleForth in 7 easy steps
Forth is a simple language, with simple rules and a simple execution model. It’s also self-hosted and interactive - you can type this at the prompt: 1 2 + .<cr> What you’ll get as response is...
View ArticlePreparing for serial re-flashing
The STM32F103 µC chips all have a ROM-based boot loader on board. Most chips variants can only be re-flashed via USART1, using the PA9 and PA10 pins, so we will need to connect to that serial port...
View ArticleA new serial tool: vive la Folie!
UPDATE Jan 2017: this article still describes Folie v1. All the links below have now been changed to point to Folie v2. The usage of v2 has changed a bit, see GitHub and this page. Working with embdded...
View ArticleAdding the RFM69 module
The last step to create a wireless node is to hook up the RFM radio. Here is what we’re after: There are 4 signals and 2 power pins to connect (more can be added later, for pin interrupts): RFM69CW...
View ArticleThe limitations of the ADC
The Analog-to-Digital-Converter (ADC) we all know from Arduinos and other µCs is a marvel of integration and electronics engineering. Able to measure at rates of over a million samples per second...
View ArticleMeasuring negative voltage
The task to be tackled here is measuring voltage ranging from +N to -N Volt with an ADC input which needs to be kept in the range 0 to 3.3V. There are numerous resources all over the web which solve...
View ArticleOp-amps and virtual ground
The voltage-divider-tied-to-3.3V trick allows shifting the level of an input voltage to another range. But there are a few issues with it. The first one is that we still cannot measure anything above...
View ArticleFixing the offset problem
There is still a fairly serious flaw in our little voltmeter setup: its Vin input is not at ground level. It’s connected via Z1 and Z2 to that 2.4V or so virtual ground we just created, and when Vin is...
View ArticleLet's measure ± 20V @ 11MΩ
So much for theory and design. Here’s a built-up version of the voltmeter: It was built as add-on for the RF Node Watcher, here’s the side view of this sandwich: Everything was built with through-hole...
View Article