LEAP#397 I²C Scanner
This is a simple sketch, inspired by i2c_scanner that simply scans for the presence of addresses in the full 7-bit address space.
This can be very helpful when trying to use I²C modules where the default address is not documented. As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub
read more and comment..
LEAP#396 Capacitive Touch Organ
The MPR121 is a capacitive touch sensor. Originally produced by Freescale (now NXP), the part is end-of-life but still widely available, especially on breakout boards.
I wrote some code and built a little penny (5 cent actually) organ to test it out. It implements a simple 12-tone (chromatic scale from C5/523.25Hz) organ:
- on interrupt from the MPR121..
- uses the Adafruit_MPR121 library to get touch state via I2C/Wire
- sounds the corresponding tone with a speak on pin 8
As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub
Here’s a quick demo:
read more and comment..
LEAP#395 8051 Programming with SDCC
The main purpose of this program is simply to have something for testing the LEAP#394 AT89C2051 Programmer, and also my first trial of SDCC - Small Device C Compiler.
It is almost but not quite the simplest LED blinky program possible. It blinks an LED on P1_0, using a do-nothing loop to approximate 1Hz cycle time.
I’m impressed. For a chipset that is meant to be long dead, getting a C toolchain up and running on MacOSX and programming AT89C2051 devices was utterly painless.
As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub
read more and comment..
LEAP#394 Arduino 8051 Programmer
I’ve been meaning to dive a bit deeper into Intel MCS-51/8051 devices and programming ever since I built a Electronic Clock Kit powered by an AT89C2051.
Reading the AT89C2051 datasheet, its seems programming is actually a quite straight-forward process - the only complication being the need for a 12V programming voltage in addition to standard logic high of ~5V.
So while I could go out and buy a programmer, I found the idea of building my own is very attractive for two reasons:
- it is a bit of a short cut to building familiarity with the chip and datasheet
- I can make sure it supports my host platform of choice - MacOSX
I borrowed some ides from similar projects, the result being a programmer on an Arduino Uno shield, with discrete charge pump for the 0V-5V-12V required for the various programming modes, and compatible with the Python-based, open source at89overlord programming software written by piotrb5e3.
As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub
read more and comment..