Now the time has come for me to dig up an old corpse and give it new life. The corpse in question is twsinit from Bizarre Sources, a project where I once crammed the whole init program in Linux into 1 page of memory.
You see, any program that runs has memory allocated to it for things like code, data, stack, environment, etc. The normal size for init in Linux is about 1-1.5MB in memory. But the init process really only needs to do one job; it inherits all orphan processes and thus has to take care of its “children” terminating. Otherwise they turn into zombie processes.
To do that job you really dont need 1MB of code. So I wrote a program from scratch called twsinit that can do the job of starting the system and buring zombie processes. The last official release did the job in two pages of memory, 1 page code and 1 page stack. But another version after that did away with the stack page as well.
So right now Im digging around in my old code, relearning how it works, and then I need to move on to learning ARM assembly and calling conventions in ARM Linux. Shouldnt be too difficult.
After hooking up eight LED matrices in series, I could see that the LedControl library wasnt up to the task. After digging through the source code I realized what a peice of junk it was.
I had to do better myself. And did. I even ended up writing my new routine in assembler. Better optimized than even the code gcc managed to produce.
Source code in the form of an Atmel Studio project,
is available here: http://joonicks.eu/arduino/LedControl.zip
Finally got around to making a demonstration video of my current limiting and short circuit protection circuit.
Using a LED as a dummy load might not have been the best idea but at least it visualizes the concept in a simple way.
The circuit is intended as an extra protection layer between a power supply and the circuit that uses it. Instead of blowing fuses or magic smoke in case of overcurrent or short circuit, this concept circuit could be tuned to protect the power supply quite well and cheaply.
Though in case of bigger normal loads, the transistor cant be a flimsy BC547. With any luck it might manage a few hundred mA but at 500 mA it’d probably burn up pretty quick.
“Bigger” package arrived today from China. A whole bunch of good stuff. But a lot of it also needs header soldering before it can be put to use. The two ESP-12F modules will be especially tricky to solder any kind of headers on to, seeing as the connection points are not spaced the standard breadbord friendly distance.
View the unboxing video on Youtube here: https://youtu.be/q4k5O6LL3a8
Its also my first unboxing video, so dont expect too much.
A small package arrived from far far awar with some new playthings for me.
- A small 128×32 pixel OLED display, I2C interface.
- 433MHz transmitter and receiver (two separate modules)
- Four 7-segment 4-digit LED thingamajingys
- Header pins…
Got the OLED working pretty quick.
Inspired by Kevin Darrahs video on Low Power Arduino! Deep Sleep Tutorial, I set out to see if I could apply some power saving to the basic blink program.
After the usual trial and error, I did get results. Normal current usage of lit/unlit Arduino nano running blink is 14/12mA. Replacing delay() with my own function going to sleep in power-down mode reduced the current to 6.6/4.6mA.
The power LED is always lit, consuming 2mA. Kevin was running his tests on a breadboard Atmega328P, obviously the Nano has a bunch more circuitry so thats where a bunch of current goes to.
And also, both the Arduino Nano and Arduino UNO will happily run off a 4 volt battery. Just connect + to the 5V rail (not VIN) and – to GND. I was using a battery from a mobile phone (nominal 3.7V but fully charged to 4V).
Source can be found here: PowerBlink.ino
Yesterday I realized I havent even tested the Raspberry Pi 3 that I got from China on the 29th of December, so this evening I spent setting it up.
Since I am an old slackware guy I have been looking at Slackware ARM. I grabbed my biggest MicroSD, a 64GB class 10 card I havent used for anything until now.
Setting up the card for boot was easy. Just dd the downloaded image to the card, dont need to bother about formatting or partitioning because the image contains the partition table already set up.
The installing all the packages took quite some time, but it all went smoothly. Configuring the network took several hours of trial and error though but got it working fine eventually.
In the future I want all my Raspberry/Arduino/ESP8266 devices on a local network even though I have a great ISP and probably could give all the devices a real internet address. But security-wise that wouldnt be the greatest idea ever…
But for now, I just plug in power and my little Raspberry shows up on a local IP listening intently for my ssh input.
I love Slackware. None of that sudo madness that Debian/Raspbian thinks is a security improvement…