An Achieveing Weekend

Last year was the first time I really got some experience in embedded programming. I’ve subscribed to Hack a Day‘s RSS feeds for the past few years, so a source of ideas and motivation is never lacking. I bought an Arduino to play with a few years ago, but obviously I wanted to get to a point where I didn’t need an Arduino for each project I work on.

Last year I took an Electronic Design course (most frustrating and enjoyable subject I’ve ever taken) in which we were introduced to the Renesas family of microcontrollers. Specifically we used an R8C mounted on a breakout board for ease of use. Through the course we got to play with LCD screens, Serial and I2C communication, communicating with motor drivers and some other useful bits and pieces. We were also taught about registers, interrupts and some other important aspects of design.

The Renesas would then have been the obvious place to start on my own projects, but the chips need a Renesas specific programmer that costs upwards of R1000, so I never took it any further. However, back in 2010 of Hack a Day did a great 4 part tutorial in getting up and running with the Atmel AVR range of microprocessors which I had bookmarked with the intention of one day delving into. The benefit of these is that an ordinary Arduino can be used to program them.

Over the past year or two I’ve also ended up picking up a couple odds and ends which have just been lying around since their acquisition, one of which was a Sure Electronics 24×16 LCD grid. So end of last year I finally get round to ordering some proto board, a few sockets and microcontrollers.

Now several months later I’ve finally got round to putting some stuff together. Conway’s Game of Life has always interested me, with it’s simple rules, it’s fairly straightforward to program. A grid of LEDs seemed like the perfect place to give it a run.

I visited quite a few websites in my search to get some code for this display. The display runs on an HT1632C driver, and somewhere along the line I came across a library to make it work, and some accompanying Arduino code. The library has the comment

Updated for the HT1632C by Nick H

in it, and the Arduino code

By Joel Simon, Based off LED Pong Clock by Nick Hall

I’ll update with links as soon as I figure out where exactly I sourced them. After getting it running nicely on the Arduino I set about adapting the code to run from one of my Atmega168PA microcontrollers that I’d required.

This first required a bunch of work getting avrdude and winavr up and running, all thanks to scszy’s tutorial and references. But after that it was fairly straightforward. I started off by programming my Conway’s game of life, which after a while I got running quite nicely. At the moment there is an option to manually specify a starting grid in code, but I just let it run by randomly generating a field and running from there.

After that was going I hooked up a MCP9701T-E/LT thermistor to an analogue input. The specs aren’t great, and nor is the performance, but I was at least slightly chuffed with my soldering of this SMD component onto my proto-board. I was quite surprised to see how quickly and how varied the readings from this unit are. I still need to get a proper thermometer to do some type of calibrating, but readings change several times a second one and half degrees up and down. This might be due more to voltage supply, but I haven’t investigated much.

I then proceeded with a push button so I can have a bit of input. My intention is to eventually have this with four different screens to choose from. The first one with the time and temperature. I want to see how accurately I can work off one of the built in clocks, as the microcontroller doesn’t have an RTC. I’ve also got a GPS unit lying around which I want to try to connect so as to be able to update the time every now and then.

The second menu will display the day and date. I have a stationary bike and a Polar heart rate monitor unit that I want to give a try as well. I’ll grab a reed switch and a magnet to put on the back wheel of my bike as a second speedometer and try get my RMCM01 Polar OEM which is a SparkFun product (Sparkfun apparently no longer sell the RMCM01 individually, but it can be bought ready to go) I sourced from Netram. These will displayed when active on the third menu. And the fourth menu is my Conway’s Game of Life. And I want to build some kind of housing for it, even if it’s just a nice perspex front.

I’ve done a mockup so far which can be seen in the video below:

I’ll do a new post with source and schematics at a later stage once I have the rest of the thing setup and working nicely. I just posted this now because I haven’t written anything in a while and I felt like it.

I’ve also reaffirmed my knowledge that I get far more work done at night, as most of this was accomplished between 23:00 and 04:00 on Friday and Saturday. I think there’re just less distractions.

13 thoughts on “An Achieveing Weekend

  1. Hello,
    I have been looking around to find Arduino code to run Conway’s Game of Life. I have a Sure Electronics green LED Matrix 16X24. I have both an Arduino 168 and 328. Do you know where you got the code and the libraries to run the game. The ones I have do not work. One uses the de_dp11xxx.h library and another I found on Adafruit’s Forum but they don’t work. Any thing would help me in my search to get it working on the Matrix.
    Thanks

    • The link is great I am learning about the library and the examples. One problem is there are 3 examples HT1632c_Demo, HT1632c_Pong, and HT1632c_ test but no Game of Life Sketch. Do you still have the sketch that you can send to me?

      Thanks

  2. One would think a Master’s student would know to use official S.I. units. There is no such thing as kph – it’s km/h

    • Haha. This may be true, but km/h takes up a lot more space on a display like this than kph ;)
      You might also note that neither kilometres nor hours are SI units, but they’re of far more relevance to me than metres or seconds.

    • All of them :)
      How do you want to define best? Adds the most value to civilisation? Has the best social responsibility? Creates the least waste? Gets the best salary?

      But I wouldn’t be able to say one is the best, regardless of definition. Everyone must choose for themselves what they want.

Leave a Reply to Kukie Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.