Compiling and Running code using Propeller Tool

A few people have asked me to explain how to go about building the POV code and getting it running on their badge. I decided to make a quick walk through explaining the steps.

What you need:

You’ll first need to go and download the Propeller Tool from the link above. Install it and run it, you will see a screen similar to this.

You will see that it automatically opens up a new file and names it ‘Untitled’ this is an empty .spin file where you actually write your code. There are several simple tutorials online that show you how to do the ‘hello world’ style first program, and other things to get you going. Many can be found here. http://www.gadgetgangster.com/tutorials/293

For now we will just load the POV app and load it onto the badge. Go grab the source code from http://pastebin.com/Ubv7qRii. The best way is to just copy and paste the raw code from the bottom of the page directly into the Propeller Tool. It should look like this.

Once you have the code in the tool feel free to save the file (File->Save). This will allow you to name it something.spin so you can load it up easily next time.

You now have to decide if you want the code to be temporarily on the badge, or permanent. Those are the only two options.

  1. RAM only: This will compile the code and load it into the device ram, once the device is reset, the ram will be cleared, and the code will be gone. If you decide to do it this way you will probably want to remove the ‘600’ from the ‘repeat 600’ line in the ‘PUB main’ function. Other wise it will only seem to work for a couple minutes and then stop.
  2. EEPROM only: This will compile the code and load it into the device EEPROM. This will allow you to reset, remove the batteries, and do just about anything without erasing the code. If you do this, you will erase the original Defcon 20 game that was on the badge. There are ways of recovering it, so don’t worry that you broke your badge.

Once you decide which one you want to do, go to Run->Compile Current->Load RAM (F10) or Run->Compile Current->Load EEPROM (F11). This will compile and load the software on your badge.

Your badge should now be running the new code. In the ‘PUB main’ section I included a couple different patterns for drawing. You can comment out the DEFCONXX line by putting a ‘ in front of it, and uncomment one of the other lines.

I’m currently working on making it more stable when drawing using an accelerometer, but I’m still waiting for it to arrive in the mail. If you modify the code, I’d love to see what else people get it to do.

Hope this helps.

Defcon 20 Mystery Challenge and Badge Pinout

Defcon 20 Mystery Challenge

Yesterday Lost posted a very detailed wiki page outlining the solution to the Defcon 20 Badge challenge. I read through it and the only thing I can say is bravo to the team that solved it. There are a lot of parts, and each one requires thinking outside the box more than the last.

http://1o57.wikispaces.com/DC20+Badge+Contest

I think next year I’m going to try to find a team to work with and focus some time on the badge challenge. I love thinking outside the box and trying to find solution to strange problems. The challenge is very interesting to me

Defcon 20 Badge Pinout

Ken Gracey over at the Parallax forums posted a schematic of the badge which labels all the pins along the top. This is much better than my hacked together version of just the left side pins from a couple days ago. I’m just happy the pins that I labeled match the actual values on the schematic. I guess I’m not totally stupid. 🙂

http://forums.parallax.com/showthread.php?141494-Article-Parallax-Propeller-on-DEF-CON-20-Badge-Start-Here!&p=1115400&viewfull=1#post1115400

Accelerometer

Yesterday my ADXL335 arrived from Amazon.com and I got it all wired up how I thought it should work. It turns out I have no idea what I’m doing, and didn’t get a single useful signal from the device. I was hoping it would be easy to interface with, but it looks like the MMA7455 will be much better. I did get some pretty cool pictures of the device though.

Adding an accelerometer

I ordered two accelerometers today to try to improve the timing of the POV. Amazon had pretty decent prices so I ordered from them.

SainSmart ADXL335 Triple Axis Accelerometer Breakout Module
http://www.amazon.com/gp/product/B006J4G4FQ/ref=oh_details_o01_s00_i00

MMA7455 Accelerometer Sensor Module for SPI IIC
http://www.amazon.com/gp/product/B008BR9IIY/ref=oh_details_o00_s00_i00

I’ve never used one of these before so I didn’t know what to order. I ordered the ADXL335 first, but then after talking to a friend who knows much more than I do, he suggested the MMA7455. So I’ll end up getting both and figuring out which one is easiest to interface with. I believe the propeller can handle both without too much effort based on the examples I’ve been able to find online.

I need to figure out how to hook it up to the badge since I don’t have a real schematic, (the one on the DVD doesn’t show which IO pin is which. I hooked up a simple LED and just ran through some of the pins to see which ones I could label. I came up with this little mapping. Looks like I have 11 pins to work with, and I’ll probably only need 3 or 4.

The first accelerometer is scheduled to arrive tomorrow so I who knows maybe I’ll have it reading data by the end of the day tomorrow.

Where is the Media Center Button???

About a year ago I moved to use Windows Media Center for my TV viewing at home. I planned on using the Xbox 360 as an extender, and was just stuck waiting for my backordered Ceton tuner to arrive. After months of waiting it showed up at my door, and the rest is history.

Xbox 360 Media Remote

Xbox 360 Media Remote

Fast forward to last month… I got my hands on the new Xbox 360 Media Remote, and loved the new look, the feel of the buttons, and the size. Something was missing though, I had become used to the Big Green Button on my other remote jumping right into Media Center. This remote had no Big Green Button, it had a live tv button, but that didn’t do anything useful. After being frustrated for a month with this design, I decided I’m going to try to make it better.

I don’t know a lot about hardware hacking, but I’ve replicated some hacks in the past done by other smart people. This device is small, cheap, and probably fairly simple in design. The price tag and complexity make this an ideal learning experience for me. So I got my screwdrivers and camera out, and began tearing it apart.

Media Remote Guts

Media Remote Guts

Six screws on the back of the remote, and the thing popped right open. Wow, pretty empty inside, a single board, no wires, nothing fancy at all. I tried to get some pictures to reference so that it would be a bit easier to inspect rather than trying to read the tiny print, and follow traces on the actual device. To my surprise they didn’t come out too bad, and I was able to clearly see several areas of interest. RX/TX pins, and what appears to be a clearly labeled JTAG interface. (Click image for GIANT size)

I immediately went to work with a razor blade scraping off the black covering to expose all the pads on the board. It appears Microsoft has pulled every pin that might be interesting out to an easily accessible location. The black covering scrapes off fairly easily as well. It is pretty clear that these boards were made as cheap as possible though, they are paper thin. That doesn’t matter, it just means they hopefully were cheap on the security of the chip as well.