Getting started with a netduino mini

netduino mini

The netduino project that I’m working on is being developed on a regular netduino board for convenience but will be deployed on a netduino mini, which packs the same impressive amount of power in a package the size of a couple of dimes.

With such a different form factor and the fact that the netduino mini does not provide a USB interface, there’s more setup required before getting started with coding on Visual C#.

The specs schematics of the netduino mini give us all the details required to make the connections and the forums have a decent how-to but I wanted to make the process postcard-accessible and more visual.

Some parts will be required:

Part list

In my opinion, the ZIF socket is a must-have item because the pins on the netduino mini are fragile and are unlikely to survive being inserted and removed from a breadboard too many times.

Making the connections

  • Insert the ZIF socket into the breadboard, making sure that the first row of pins of the ZIF socket is aligned with the first row of pins, marked 1, on the breadboard.
  • Insert the netduino mini into the ZIF socket, making sure that the small notch in the board is pointing towards the lever of the ZIF socket.
  • Connect the red LED and the resistor to the breadboard’s power rails
  • Using the color-coding of the USB FTDI TTL-232 connector, connect the hookup wires to the breadboard according to this diagram:

FTDI pin out

netduino mini connections

  • The end result should somewhat look like this (don’t mind the blue LED):

netduino mini hooked up

At this point, you’re ready to communicate with the netduino mini.

Serial Communication Setup

  • Plug the USB FTDI TTL-232 cable into your computer. If you have never done it before, your OS will load the FTDI driver and will assign a COM port number to the device (the cable behaves as a USB device).
  • Make a note of the COM port number as you will need to reference it later.
  • The red LED should be lit up now. If not, make sure the LED / resistor are connected properly and that the GND and VCC leads coming from the FTDI cable are connected to the proper rails on the breadboard.
  • Open a serial connection to your board using a terminal software such as Putty, HyperTerminal, or Tera Term (my preference) with these protocol settings: 115200 bps, no parity, 8 data bits, 1 stop bit, no flow control.
  • Hit the ESC key.
  • You will see a prompt offering to let you select the deployment/debug port:

Netduino Mini

1. TTL UART (COM1)

2. RS232 UART (COM2)

Which transport (1 or 2)?

  • Hit 1 for TTL UART (COM1)
  • The netduino mini will reboot and will start sending debug data over the port at that point.

Update the firmware (optional)

Setting up Visual C# Studio 2010 for the netduino mini

  • When creating a new project, be sure to pick the netduino mini template option.
  • Be sure to configure your project properties for the Serial transport using the COM port number assigned to the FTDI cable.
  • That’s it! Everything else works the same as usual, including debugging.

Action shot

And of course, to make sure that everything works, one needs a blinking LED 🙂

Happy hacking!

Edit: fixed link to Netduino Mini Beta forum with firmware 4.1.1 Beta 1

Advertisements

Build a cheap, flexible AVR microcontroller programming target board

Programming AVR microcontrollers using ISP is a simple process when the target is on a board exposing a 6 or 10-pin ISP header.  But what if you have different types of AVR chips? Their SPI pins (VCC, GND, MOSI, MISO, SCK) aren’t always in the same locations.

Instead of buying different types of target boards or buying an expensive generic programmer, I built one using a small breadboard, a Universal 28 pin ZIF DIP socket and 6 male-male hookup wires that I connected to my USBtinyISP programmer.

The following steps detail the assembly process:

  • Align the first row of pins on the ZIF socket with the first row of pins on the breadboard: this will make it easier to match the SPI pins on the microcontroller with the ISP connector pins later
  • Make sure that you have room for hookup wires on both sides of the ZIF socket
  • Insert the ZIF socket into the breadboard
  • Ensure that your ISP programmer is disconnected from your computer
  • Insert one end of the hookup wires into the 6-pin cable connector like this:

  • Using the datasheet for the AVR chip you want to program, find the pin numbers of the VCC, GND, MOSI, MISO and SCK pins. For example, the ATtiny85 shown in the picture above has the following pin out:

  • Insert the other end of the hookup wires into the breadboard according to chip’s pin out.
  • Connect your AVR programmer to your computer.
  • Using avrdude, type the following command:  C:\avrdude -c usbtiny -p t85.
  • You should get this output if everything was connected properly:

avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e930b
avrdude: safemode: Fuses OK
avrdude done. Thank you.

I’ve successfully tested this target board with an ATtiny85, ATtiny84 and an ATmega368 / ATmega168:

ATtiny84

C:\avrdude -c usbtiny -p t84
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e930c
avrdude: safemode: Fuses OK
avrdude done.  Thank you.

ATmega328p

C:\avrdude -c usbtiny -p m328p
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.16s
avrdude: Device signature = 0x1e950f
avrdude: safemode: Fuses OK
avrdude done.  Thank you.

So, what happens if  the ISP connector is connected to the wrong pins on the microcontroller?

Not much really: the USB bus on your computer may shut itself down, requiring a computer reboot or avrdude will fail to communicate with the chip. In either case, make sure that the ISP programmer is always disconnected from your computer before switching chip types or changing the position of the hookup wires in the breadboard and triple-check your hook-up wire connections against the datasheet of the target chip!

Happy hacking!