Showing posts with label microcontrollers. Show all posts
Showing posts with label microcontrollers. Show all posts

Tuesday, May 29, 2012

simple tone/music player

Here's a reasonably simple way to get ugly square waves playing music, much like an old Nokia ringtone. It has been configured to use the G2211 that comes with the MSP430 Launchpad. It doesn't really need any special functions and can run on other value line MSP430s. This project uses Code Composer Studio 5.2 with Grace.

All you need to add is a speaker between P2.6 and GND (they're adjacent pins) and press the button connected to P1.3. The code isn't all that elegant and I've ignored all the new ULP rules.

The DCO is set to 12MHz for the purposes of interrupts. I have included a spreadsheet that calculates the constants from music note frequencies into the adjusted DCO periods. The main function changes the note and duration while the interrupt routine toggles the output and keeps track of time for the note period and total duration.

http://db.tt/HKXGJrFq

This particular file plays 'Thaxted'. I found the sheet music from the Mutopia Project's website.

Saturday, October 30, 2010

MSP430F2012 (ez430 usb stick target board) to breadboard

In between accepting delivery of a ez430 USB stick programmer and when my Launchpad boards come (if ever) I decided to cook up a slot-in method for using the F2012 target boards.
 No fewer than 26 right-angled SIL header pins were used. Though I could have gotten away with 24 had I not connected the SPW pins.
 Hopefully this minimises the overhang from the target board.
It's turning out to be a lot more effort than Arduino but the marginal cost is a lot smaller, given that there are free samples of the microcontroller itself. I'll have to cook up another board to program the 14-pin dual inline packaged versions though.