Electronics for programmers: Humble beginnings

A strange and terrifying world. Unhelpful websites, introductions that tell me nothing. When I try to figure out where to start, the internet tells me all about the cool extensions I can add. What I what to know is:

How do I turn this damn thing on?

Okay, backing up a bit. This semester I’m taking a university course on Hardware and OSes (Rechnerstrukturen und Betriebssysteme). It instantly fascinates me, we get to play with breadboards and implement logical circuits, later moving on to microcontrollers and writing an OS for them. When I tell my girlfriends father, an electrical engineer, about it, he hands me a little cardboard box with an AVR-NET-IO.

Awesome.

Step One: POWER

At home, I open it and excitedly inspect the board.

What I started with

When I check the remaining contents, my excitement falls of a little. Theres no power cable? Strange, I didn’t see any kind of USB (regular, mini, micro) either. I double-check, and there isn’t. Hu. A quick e-mail to girlfriends father tells me to power it by USB. I triple check. Nope, nothing.

Not awesome.

I read the manual. I read an online wiki. Read the manual again. Google some more. Wiki again and the manual.

I am incredibly frustrated at this point. It’s like learning programming all over again: The answers aren’t there because my questions are too basic. I had the same kind of problem when trying to figure out how to run a .cpp file or why my locally saved .php-file won’t send me an email.

After giving up on google, I turn to Reddit – /r/avr – instead. I ask a few questions, and a whole 8 days later, someone responds. What I learn is that I basically have to mutilate a power cable with the proper voltage and power, cutting the cord and directly inserting the copper ends and screwing them in (kind of like you do with light bulb mounts to the cables in your ceiling).

I order one from amazon,  have a go at it with my knife, screw the ends tight to the board, then plug it in and – the yellow LED turns on. Everything seems to work!

Awesome.

Step Two: NETWORK

Step two is significantly simpler. I hook the board up to my router, the plug the power in. The yellow LED still turns, the network port shines green. The blinkenlights reassure me: It’s going to be fine.

I install the NetServer Software that goes with the board, click “Connect” and – it connects! More green lights, this time on my screen.

Awesome.

The NetServer Software that come with the board.

I click a few things and… I break it. I’m not sure, but apparently it doesn’t like me trying to send text to an LCD that isn’t there. The server crashes. When I restart it, it can’t connect. When I restart the AVR, it still can’t connect. When I power cycle my PC, just in case, it can’t connect. When I push the firmware to the board again (by now I have a USB-Serial-Adapter, so that’s possible), it finally connects again. Once more I see a connection to programming: Very small things can wreck you work and push you to desperation.

Not awesome. But, to be fair, also not entirely unexpected.

And that’s part 1.

What did I learn? A lot, and nothing. Realistically, I haven’t gotten anywhere. I turned some lights on, really. I can read and set inputs and outputs but, lacking extensions, this doesn’t do anything yet.

And yet, I set some foundations: I realized that in this realm, plugging male-female-cables wouldn’t get me far. I’ve set up some infrastructure:

  1. Power
  2. USB-Serial-Adapter to push new software
  3. A network hub right next to my pc, saving me from commuting between my PC and the router on a different floor.
  4. Snatching up a Humble Book Bundle with many Book from O’Reilly’s Make:-series, most importantly “AVR Programming” and “Raspberry Pi and AVR Projects”.

In total, I’m about 40€ short without anything to show for it, but hopefully, this will change very soon.

The next post will detail my attempts to reach a state of “Hello, World!” and possibly beyond (Say, a web server that will allow any device in the network to read and push just a short string? Seems like a nice start, but I have no idea how feasible this is for me.)

While I don’t know anything for sure, I’m sure it will be a dreadful fight with compilers, hexfiles and new hardware problems I won’t foresee in the slightest.

Leave a 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.