LED Flash Challenge – Semester 1, 2015/2016

We’re beginning the RoboSumo project with a little competitive puzzle called the LED Flash Challenge. We’re not attaching a formal assessment weighting to this challenge, but we’ll certainly be keeping a close eye on which teams finish in what order.

I’m aiming to set it up so that each successful completion will be tweeted to @robotresults so that we have a complete record of which team finished when. However, if you complete the challenge this week you may be too early to be recorded this way, so you should ask your tutor to make a note of the exact time you demonstrated your working system.

Yes, it’s a race.

Today and probably next week you’ll be working with your team to complete two tasks:

  1. Build a simple breadboard circuit for the MSP430 microcontroller and program it to blink an LED on and off.
  2. Add a second LED to the circuit and reprogram the MSP430 to transmit a specific binary sequence as flashes from the two LEDs.

The first task is very prescriptive, which means that we’ll basically tell you exactly what to do, but to complete the second task you’ll need to start thinking for yourselves.

You’ll need a team number to complete this challenge. Your tutor will assign your team a unique number within the range shown below:

  • 1-12: Ted’s teams
  • 13-18: Damon’s teams
  • 19-24: John’s teams
  • 25-30: David’s teams

Part 1: Blinking LED

This task is relatively straightforward and shouldn’t take you too long to get working. You’ll find complete instructions here:

Instructions for Blinking LED example

NOTE: In some places, those instructions may refer to the MSP430G2553 microcontroller, whereas you’re using the MSP430G2452 microcontroller. These two microcontrollers are extremely similar, so you should be able to follow the instructions without any difficulty. Just remember that anywhere it refers to MSP430G2553, replace that with MSP430G2452 and you should be fine.

Once your LED is blinking, there are four things you need to understand before moving on:

  1. How one of the pins (P1.0) was turned into a digital output.
  2. How the LED is turned on
  3. How the LED is turned off
  4. How to delay the program for a specified number of microseconds, so that the rate of the LED blinking can be controlled

Once you understand these four things, you have finished this part of the task (the easy part) and it’s time to move on to the LED Flash Challenge.

Part 2: LED Flash Challenge

In this part, you’re going to modify your circuit to create a simple optical transmitter, which transmits a digital message (a sequence of 1s and 0s) as a series of LED flashes. I’ll demonstrate this to you in the lecture.

The message that you’ll transmit will be 2 bytes long (a byte is 8 bits, or 8 ones and zeros) and it will contain your team number (byte 1) followed by the letter R (byte 2).

You and your team mates should take a few minutes to read about binary numbers and digital i/o on the MSP430 here.

Specifically, you need to do the following:

  1. Modify the code to create a second digital output pin.
  2. Extend the circuit by adding a second LED (with current limiting resistor) to that digital output pin.
  3. Convert your team number into 8-bit binary. This is byte 1 of your message.
  4. Find out the ASCII value of the letter ‘R’ (capital R) in 8-bit binary. This is byte 2 of your message.
  5. Each byte will be transmitted as a sequence of ones and zeros, preceded by a start bit (1) and followed by a stop bit (0). That means your complete transmission will be 20 bits long. You need to calculate this sequence on paper first.
  6. To transmit a 1, turn LED1 off and LED2 on for 100ms.
  7. To transmit a 0, turn LED2 off and LED1 on for 100ms.
  8. To ensure the sequence is read correctly, transmit a long sequence of zeros before you transmit your message.

The validator for checking your transmission is a web application which I will be posting at the following location:

Your tutor will be able to clarify anything you don’t understand about this.

This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to LED Flash Challenge – Semester 1, 2015/2016

  1. Gian Lorenzo says:

    Man, this sounds fun. How come we didn’t get to do this! Pleasant surprise to see I’m actually still subscribed to the robosumo cookbook blog!

    • batchloaf says:

      Thanks Gian. We only introduced the LED Flash Challenge in semester 2 last year. We thought it would be a good puzzle to help people get familiar with three things:

      1. Creating digital outputs on the MSP430 and then setting them high and low.
      2. Calculating time delays in multiples of one instruction cycle.
      3. Converting numbers from decimal to binary.

      So far so good – hopefully everyone will get it working tomomrrow!


      • Gian Lorenzo says:

        Yeah definitely sounds like a good exercise. I remember Damon telling me that there are two batches of Robosumo per year now, glad to see it’s still going strong. I’ll have to drop by the competition or some other time!

  2. Pingback: Light It Up | Eng.solankedavid

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s