[Michael Becker] has been using FreeRTOS for about seven years. He decided to start adding some features and has a very interesting C++ class wrapper for the OS available.
Real Time Operating Systems (RTOS) add functionality for single-thread microcontrollers to run multiple programs at the same time without threatening the firmware developer’s sanity. This project adds C++ to the rest of the FreeRTOS benefits. We know that people have strong feelings one way or the other about using C++ in embedded systems. However, as the 24 demo projects illustrate, it is possible.
One nice thing about the library is that it is carefully documented. A large number of examples don’t hurt either. The library is clean with just under 30 classes. It seems to have resisted the trend of having classes for everything. You know the kind of library we mean. To create an Integer object, just build a configuration object to pass to the class factory generator which…. This library doesn’t entertain any of that. It has simple abstractions around threads and timers, queues, and mutexes.
Continue reading “FreeRTOS Gets Class”
Reader [Jasper] writes in with glowing praise for the TFT_eSPI library for the ESP8266 and the various cheap 480×320 TFT displays (ILI9341, ILI9163, ST7735, S6D02A1, etc.) that support SPI mode. It’s a drop-in replacement for the Adafruit GFX and driver libraries, so you don’t need to rework your code to take advantage of it. If you’re looking to drive an LCD screen with an ESP8266 and Arduino, check this out for sure.
As a testbed, [Jasper] ported his Tick Tock Timer project over to the new library. He got a sevenfold increase in draw speed, going from 500 ms to 76 ms. That’s the difference between a refresh that’s visibly slow, and one that looks like it happens instantly. Sweet.
Improving software infrastructure isn’t one of the sexiest or most visible hacks, but it can touch the lives of many hackers. How many projects have we featured with an ESP8266 and a screen? Thanks, [Bodmer] for the good work, and [Jasper] for bringing it to our attention.
Linear voltage regulators are pretty easy to throw into a project if something in it needs a specific voltage that’s lower than the supply. If it needs a higher voltage, it’s almost just as easy to grab a boost converter of some sort to satisfy the power requirements. But if you’re on a mission to save some money for a large production run, or you just like the challenge of building something as simply as possible, there are ways of getting voltages greater than the supply voltage without using anything as non-minimalistic as a boost converter. [Josh] shows us exactly how this can be done using a circuit known as a charge pump to drive a blue LED.
One of the cool things about AVR microcontrollers is that they can run easily on a coin cell battery and source enough current to drive LEDs directly from the output pins. Obviously enough, if the LED voltage is greater than the voltage of the power supply, this won’t work. That is, unless you have a spare diode and capacitor around to build a charge pump.
The negative charge pump works by charging up a capacitor that is connected to an AVR pin, with the other side between the LED and a garden-variety diode to ground. That results in a roughly (VCC – 0.7) volt difference across the capacitor’s plates. When the AVR pin goes low, the other side of the capacitor goes negative by this same amount, and this makes the voltage across the LED high enough to light up. Not only is this simpler than a boost converter, but it doesn’t need any bulky inductors to work properly.
Will this work for any load? Am I going to start any fires by overdriving the LED? Luckily, [josh] answers all of these questions and more on the project page, and goes into some detail on the circuit theory as well. Granted, the charge pump doesn’t have the fine control over the power supply that you can get out of a buck or boost converter (or any switch-mode power supply). But it does have good bang-for-the-buck.
Hands up if you’ve ever used a machine running CP/M. That’s likely these days to only produce an answer from owners of retrocomputers. What was once one of the premier microcomputer operating systems is now an esoteric OS, a piece of abandonware released as open source by the successor company of its developer.
In the 1970s you’d have seen CP/M on a high-end office wordprocessor, and in the 1980s some of the better-specified home computers could run it. And now? Aside from those retrocomputers, how about running CP/M on an ESP8266? From multi-thousand-dollar business system to two-dollar module in four decades, that’s technological progress.
[Matseng] has CP/M 2.2 running in a Z80 emulator on an ESP8266. It gives CP/M 64K of RAM, a generous collection of fifteen 250K floppy drives, and a serial port for communication. Unfortunately it doesn’t have space for the ESP’s party piece: wireless networking, but he’s working on that one too. If you don’t mind only 36K of RAM and one less floppy, that is. All the code can be found on a GitHub repository, so if you fancy a 1970s business desktop computer the size of a postage stamp, you can have a go too.
There’s something gloriously barmy about running a 1970s OS on a two-dollar microcontroller, but if you have to ask why then maybe you just don’t understand. You don’t have to have an ESP8266 though, if you want you can run a bare-metal CP/M on a Raspberry Pi.
[Sami Pietikäinen] was working on an embedded Linux device based on an Atmel SAMA5D3x ARM-A5 processor. Normally, embedded Linux boxes will boot up off of flash memory or an SD card. But if you’re messing around, or just want to sidestep normal operation for any reason, you could conceivably want to bypass the normal boot procedure. Digging around in the chip’s datasheet, there’s a way to enter boot mode by soldering a wire to pull the BMS pin. As [Sami] demonstrates, there’s also a software way in, and it makes use of
mmap, a ridiculously powerful Linux function that you should know about.
Continue reading “Flashing An ARM With No Soldering”
Hackaday readers (and writers) are an odd bunch. While the rest of the tech press falls over for the newest, shiniest CPU on the market, we’re the type who’s more interested the unexplored dark corners of metaphorical Silicon Alley. So when someone comes to us with a good writeup of a chip that we’d never heard about, we’re all ears.
[Remy]’s writeup of the CoolRISC 816 microcontroller CPU makes it obvious that he shares our taste for the esoteric. It has a 22-bit “RISC” instruction set. It has a dedicated 8-to-16 bit multiplier. Some of the instructions are so un-reduced that [Remy] calls bunk on its RISC claims. All of the operations, including the un-RISC ones, run in a single cycle. And the CoolRISC does this by cheating — the last stages of the pipeline run not on every clock tick, but on the rising and falling flanks of the clock respectively.
Why all these odd bits? They make the job of the assembly programmer, or compiler designer, a lot easier. With all single-cycle instructions, counting cycles is the same as counting lines of code. The not-really-RISC instructions are great for compiling C into. So what happened? [Remy] speculates that the MSP430, another not-really-RISC microcontroller that came out about the same time, ate the CoolRISC’s lunch. The MSP430 is a 16-bit machine, and chances are good that you’ve heard of TI. The same may not be true of Xemics, maker of the CoolRISC.
But still it’s nice to have someone saying the eulogy for this strange little chip. Or maybe the reports of the CR816’s death are premature — it seems to be inside TI’s bq20x80 chip that’s used in a number of battery power monitors. Oh, the irony! Indeed, watch [Charlie Miller] tear into a battery and find a CR816.
Have any of you used a CR816? What’s the strangest microcontroller architecture that you’ve ever seen?
The review embargo is finally over and we can share what we found in the Nvidia Jetson TX2. It’s fast. It’s very fast. While the intended use for the TX2 may be a bit niche for someone building one-off prototypes, there’s a lot of promise here for some very interesting applications.
Last week, Nvidia announced the Jetson TX2, a high-performance single board computer designed to be the brains of self-driving cars, selfie-snapping drones, Alexa-like bots for the privacy-minded, and other applications that require a lot of processing on a significant power budget.
This is the follow-up to the Nvidia Jetson TX1. Since the release of the TX1, Nvidia has made some great strides. Now we have Pascal GPUs, and there’s never been a better time to buy a graphics card. Deep learning is a hot topic that every new CS grad wants to get into, and that means racks filled with GPUs and CUDA cores. The Jetson TX1 and TX2 are Nvidia’s strike at embedded deep learning, or devices that need a lot of processing power without sucking batteries dry.
Continue reading “Hands-On Nvidia Jetson TX2: Fast Processing for Embedded Devices”