m3pi preparation

Before you start using the mbed with your Pololu 3pi, you need to program the on board AVR with Pololu's "Serial Slave" example.

The easiest way is to use the binaries as described below. If you want to build your own then there are great instructions on at www.pololu.com with some handy links at m3pi-Development

The Easy Way

To do this the easy way you simply need to temporarily repurpose your mbed Microcontroller to be an AVR ISP programmer by using Aaron Berks mbedAVR programmer. This enables an AVR binary dragged onto mbed LocalFileSystem to be be programmed into the AVR over SPI - drag and drop programming for AVR :-)

You will need :

The mbed AVR programmer only takes .bin files currently. As the mbed microcontroller would try to load a .bin file into the mbed itself, I have opted for the .avr extension.

AVR Studio generates .hex files, but there are many HEX2BIN converters available.

Lastly, the programmer will delete the binary once it has been programmed. This behavior can be prevented by removed the following line from the main.cpp

#define DELETE_BINARY 1

Setting up your hardware

The hardware connections between the mbed and the 3pi are simple. On the 3pi side, there is just a standard 6 way AVR ISP header :

/media/uploads/chris/avr6wayisp.png

The connection to mbed is straight forward.

AVR ISPmbed
1 MISOp6
2 VCCVOUT
3 SCKp7
4 MOSIp5
5 nRSTp8
6 GNDGND

As I am doing quite a lot of 3pi reflashing at the moment, I made myself a little breakout board on strip board, with a mbed socket and a 6 way AVR socket.

/media/uploads/chris/_scaled_avrisp.jpg

The Hard Way

To start working with the 3pi, you'll need to complete the following steps (or similar). Download and install a toolchain? How quaint ;-)

Seriously though there is plenty of help at the Software resources area on the Pololu site.

To help get through all of this, there is this Getting Started document from Pololu.

Once you're up and running, the Resources area for the Pololu 3pi contains a wealth of great stuff.


All wikipages