Tag: tutorial

MSP430 Launchpad: Random Software Delays

Posted by on December 13, 2010

The goal: to “randomly” flash the on-board LEDs at P1.0 and P1.6

The weapons: CCS, Launchpad, Cookies (you may choose your favourite ones)

The reason: To familiarize yourself with the coding environment, or just for the heck of it.

The library:

That’s our random library, it’s grand.h

The “g” prefix is one I often use privately, it’s simply the first letter of my name. However because there may be other routines in the future with a similar naming convention, having “g” prefixed is not a bad idea; without having to fall into namespace gibberish.

The PRNG is an old standard. No need to discuss it.

You may recognize those macros, yes! They’re from Quake3! — Although we aren’t using them I left them there for future reference on how to obtain usable value ranges from the PRNG. There’s a lot to be said about floating point values and whatnot, But I’m going to restrain myself in this case.

Now to the main code:

No external hardware is required, just make sure both P1.0 and P1.6 jumpers are set.

As you can see we’re simply toggling the LEDs with a random delay, the delay_ms(); function was taken from here.

Like I said there are quite a few topics to explain, however I decided to keep this one as simple as possible (Alright, I’m in a rush!)

So… Compile, run and enjoy!

Once I get the time I’ll put together some utilitarian code libraries and lengthier explanations, promise.

For those interested, you may download the entire project directory from here: Random Software Delays.

A simple Coil-Less FM Bug

Posted by on September 22, 2010

A simple FM Bug for beginners

For months I’ve been looking for a simple FM BUG project, the ones online require inductors which you either have to acquire or build, if you don’t have a LCR meter it becomes rather hard to get the circuit working, specially if you’re a beginner without an oscilloscope! – Sometimes they don’t even tell you which inductance is required and you have to calculate an estimate, which is the main reason why many high frequency RF projects fail in the first place.

From all the projects out there I’ve only seen one which didn’t require an external inductor since ¬†it simply used a pcb / trace inductor, however the board was big and the circuit itself had lots of stability issues, etc. I wasn’t going to waste my time with it.

My first FM BUG was based on one of the many schematics out there, it seldom worked. It was microphonic (due to the air core inductor) but the electret capsule itself did not modulate the output at all, needless to say it was very unstable and it never worked properly.

This circuit on the other hand performs pretty well, even if you’re manipulating the board or touching the coax it will stay within the tuned frequency (unless you touch the transistor or timing capacitor!). The power is very low, so don’t expect great distances, specially in populated areas! More…