Java Grinder Spits Out dsPIC and MSP430 Assembly Code

java-code-grinder

[Michael Kohn] sent in a link to the set of projects he’s been working on lately. The Java Grinder is a project that converts Java code for use on microcontrollers. This actually started back in 2009, when he mentioned that the project was worthless because there were already a ton of Java virtual machines out there. But if he had really thought that he’d never learn anything. We’re glad [Michael] picked this back up and made something out of it.

The image above shows the proof of concept. It’s a box bouncing around the Nokia 6100 screen. He wrote the animation in Java, and used his grinder to turn the code into dsPIC assembly, which was then compiled and flashed onto the microcontroller. That’s not all, he’s also coded a Mandelbrot set generator or the same hardware. As it stands he can also produce assembly code for use on MSP430 chips.

This kind of exploration is great for the brain. We see it as a natural extension of the learning you acquire from Nand2Tetris which walks through the essential text The Elements of Computing Systems. If you’re not familiar, that’s a trip from building your first logic gate, which you plunk together with others to build an ALU, then start coding all the way up to a virtual machine to run on your simulated hardware.

Video of the bouncing box and Mandelbrot set is below.

Continue reading “Java Grinder Spits Out dsPIC and MSP430 Assembly Code”

A Better USI I2C Library For The MSP430

USI

TI’s MSP430 chips are rather interesting – they’re low power, very capable, and available for under a dollar in most cases. Some of these chips, though, don’t have native SPI or I2C interfaces; instead, everything is done through a USI, or Universal Serial Interface module. [Jan] found the stock I2C USI module was a little rough around the edges, so he created his own.

[Jan] found the TI example code for using the USI as an I2C device overly complicated and something that an intern whipped up in a week and was never touched again. In response to this, he created a much, much simpler USI/I2C module that’s actually readable. It’s available over on the GitHub if you want to grab it for yourself.

Compared to the TI code, [Jan]’s library is dead simple. There are only two functions, one for initialization, and another for sending and receiving. Easy, small, and it works. Can’t do much better than that.

Porting Contiki to the TI MSP430 Launchpad

For many years Contiki has been one of the main choices when it came to choosing an IPv6 over Low power Wireless Personal Area Networks stack (aka 6LoWPAN). It is developed by a world-wide team of developers with contributions from Atmel, Cisco, ETH, etc… and is open source. As most platforms to which Contiki has been ported are quite expensive, [Marcus] decided to bring the operating system to the TI Launchpad. For our readers that don’t know, the latter is based on a msp430g2452/2553 microcontroller, which only have 256/512 bytes of RAM and 16kB of ROM. As a side note, Contiki typically requires 10k RAM and 30k ROM.

[Marcus] therefore had to remove several features from Contiki: queue-buffering, energy estimation and regrettably uIP. His test setup (shown above) uses the TI CC2500 radio that can be found for less than $2 on Aliexpress, for which he wrote radio drivers from scratch. He also coded his own radio duty-cicling layer, as the one included in Contiki was too big.

Wireless Encryption Between Galileo and a MSP430

[Mark] recently finished his latest project, where he encrypts wireless communications between the new Intel Galileo and a Texas Instruments MSP430. The wireless interfaces used are the very common nRF24L01+ 2.4GHz transceivers, that had a direct line of sight 15 feet range during [Mark]’s tests. In his demonstration, the MSP430 sends an encrypted block of data representing the state of six of its pins configured as inputs. This message is then received by a sketch running on the Galileo and stored in shared memory. A python script then wakes up and is in charge of decrypting the message. The encryption is done using AES-128bits in Electronic Codebook mode (ECB) and semaphores are used to prevent simultaneous accesses to the received data. As it is the first project using an Intel Galileo we received, don’t hesitate to send us a tip if you found other ones.

The Cramp: A MSP430-powered crane lamp

theCramp

If you think your last project required a lot of soldering, take a look at [Multivac’s] remote controlled and fully-articulable desktop crane lamp. Sure, it’s a 430 microcontroller combined with an LED driver, 32 LEDs, PWM control, and some moving parts: but take a closer look at the structure. The Cramp uses an old HDD as its base, with the crane spinning around the main bearing that previously supported the platter. A system of spools and pulleys provides a reasonable range of motion to the rest of the build. Relocating the entire assembly, however, is evidently an unpleasant task.

[Multivac] based his design on a Liebherr LR1750 Crawler Crane, which he meticulously pieced together using leftover copper salvaged from an upgrade to his home’s mains wiring. A mountain of solder secures what must include several hundred joints—possibly more. The head of the lamp is an elegant exoskeleton-interpretation of industrial designer Eero Saarinen’s TWA Flight Center. You can see the Cramp in action in the video below.

Continue reading “The Cramp: A MSP430-powered crane lamp”

MSP430 alarm clock project

msp430-bedside-alarm-clock

[Markus] turn his breadboard LED matrix tinkering into an alarm clock which wakes him each morning.

Don’t be fooled by how clean his assembly work is. That’s not a fabbed PCB, it’s a hunk of green protoboard which a lot of point-to-point soldering on the back side. It’s driven by the MSP430 G2452 which is oriented vertically in this image. The two horizonal ICs are 595 shift registers which drive the LED modules.

We already mentioned the cleanliness of his assembly, but there’s one other really cool design element. On the back of the unit is what looks like a battery holder for two AA cells. He’s using just one Lithium Iron Phosphate battery (3.2V) which is in the upper of the two cavities. This let him cut the lower part of the holder at an angle to act as a stand for the clock.

Don’t miss the video which walks us through the user interface. It has what you’d expect from an alarm clock. But there is a really bright white LED which mimics a sunrise clock and it does more than just buzz one note when the thing goes off.

Continue reading “MSP430 alarm clock project”

MSP430 touchscreen piano

msp430-touchscreen-piano

[Rohit Gupta] wrote in to share this touchscreen piano project he built around the TI Launchpad. It provided a way for him to explore using a resistive digitizer found on a lot of mobile devices. These are simply stuck to the top of LCD screens and replacements are inexpensive, but salvaging one from old hardware is an option as well.

The first thing he did was to test the four outputs of the digitizer with his multimeter. Logging the changing resistance will help make sure you’re reading the correct wires and are able to zero in the settings before you start coding. [Rohit] uses the ADC on the MSP430 chip to read from the screen. He went with the algorithm from one of TI’s app notes to convert the readings in to X and Y coordinates.

He separated the screen into seven columns, each generating a different tone. Touching higher or lower on that column will alter the pitch of the note produced. You can hear an example of this in the demo after the jump.

Continue reading “MSP430 touchscreen piano”