Don't do anything yet! Read the page twice at least! You have been warned!
Ok, lets presume that we bought this board (EvB 4.3 v.4) and, because we are beginners and the lack of documentation and proper tools examples, we bricked our ATmega which come with the board. What to do then? We buy an ATmega644P (it's worth the effort) because this great board have included an ISP programmer. It remains the problem of the programming tools and examples on which we are preparing to solve: We will "mutate" the EvB board into a Sanguino board which can be fully programmed on Arduino IDE!
NOTE: Use a generous cooling radiator on LM7805 regulator.
Yes, we must do a lot of downloads, part of them in this tutorial, and other parts on following examples. But don't be scared, we take only the necessary tools.
Go to Polish site and download the schematic of the board and the .pdf manual:
User manual - for EvB 4.3 v.4.
The schematic - this time we have the right schematic (it was released after they sold a lot of boards).
How to burn the bootloader manual
EvB ISP - the ISP programmer software. It is an old version of Avrdude but specially configured for the ISP programmer on the board. We'll need it for burning the bootloader.
Arduino 0019 - the Arduino IDE needed for writing our own applications (and of course, learning from existing examples)
Sanguino firmware - we need this archive to make Arduino IDE to recognize our board as being Sanguino and because here we have the required bootloader.
FTDI drivers - USB drivers for the board
Enough for the moment. Of course, on their site you will find also an old version of WinAVR with their own library, required for accessing the peripherals on the board, which in the hands of an experienced user is all he need but remember, we are beginners so, we don't use it. Well, I have to confess that at first step I downloaded their WinAVR and tried to use it on my ATmega32 but because they had only ATmega16 examples at the time I tried, I failed. But lets expand the archives:
- Extract the archive of Arduino IDE in C:\ so, you will have the following path (for these operations, extracting, moving, navigating between folders I use TotalCommander file manager):
C:\arduino-0019\
- Extract Sanguino firmware archive and move Sanguino/ folder on Arduino IDE folder so you will have the following path:
C:\arduino-0019\hardware\Sanguino\
- Create a folder evb-isp on C:\ and extract the content of the EvB ISP archive so you will have the following path:
C:\evb-isp\
Everything is ok on this step, we have everything to go to the next step:
Take care, I'm not responsible if you brick your microcontroller!
First of all, insert the ATmega644P microcontroller in the socket of the board if you didn't do that yet. Then, take 4 wires and do the connections as in following image:
Click to enlarge
After that, connect the board to USB port of your PC - hope you installed already the drivers for FTDI USB-to-serial chipset. If not, install them now - see the FTDI site or let Windows to search for them on Internet (or extract and install the archive downloaded from Polish site).
Go to C:\evb-isp\ folder and launch avrdude-GUI.exe . And you have to do the same as on the following image (not yet, read entire chapter first):
Ok, lets talk about every dialog field and operation:
- [avrdude.exe File] field - this one must point on avrdude.exe on your current folder which is c:\evb-isp. Don't use a different avrdude! At first launch of avrdude-GUI all fields are empty - in a normal case, this field will be automatically completed.
- [Programmer] combobox - here you have only two options. Choose the one from the image above (FT232R Syn...).
- [Port] combobox - in my case, the board is connected to COM5 virtual port. Select the one allocated to your board.
- [Device] combobox - select your device from the list, which must be ATmega644P (m644p).
- [Command line Option] field - in the original documentation, differs but it works for our board and microcontroller so, it must be: -P ft0 -B 38400 (I think it also depends on the fuses).
- [Fuse] group of fields and buttons - [hFuse] = DC, [lFuse] = FF, [eFuse] = FD . Press [Write] button (from the same [Fuse] group) after you completed correctly the fuse fields - check twice! Wait the operation to be finished and go to the next step.
- [Flash] group of fields and buttons - the field is empty at first use of avrdude-GUI so, you must point to the ATmegaBOOT_644P.hex file from the location illustrated in the following image:
After that, you have two cases:
In case you have an empty microcontroller, you must press [Write] button from the [Flash] group (prepare to wait for a while - have patience).
In case you have the original microcontroller, you must press [Erase - Write - Verify] button from the [Flash] group (also, prepare to wait even longer - have patience until operation is done).
After that, you have a Sanguino bootloader in your microcontroller, ignore other fields and buttons, and close the program. You did the most important operation. Now, remove first the USB cable then all the 4 wires used to connect your microcontroller to your programmer. From now on, you need only the USB cable to transfer your programs into the microcontroller.
Regarding to internal programmer, another option (and better) is to buy and use the ISP Programmer sold by the same manufacturer (Romanian shop, Polish site):
Note: The bootloader use Digital 0 (PB0) as LED uploader indicator.
Simply start arduino.exe from C:\arduino-0019\ folder, and from Tools\Board submenu, select Sanguino as in image:
click to enlarge
Then you must set the serial port on Tools/Serial port submenu:
OK, your IDE is ready to upload sketches on your board. So, we have a Sanguino board and we must know which the pinout is...
A good reference is the Sanguino site.
This is Sanguino board by Zach Hoeken
So, this is Sanguino pinout - we will see how to fit that on our EvB board
This is Sanguino pinout for our EvB 4.3 v4 board! Click to zoom!
And a complete ATmega644P pinout - useful later, when you gain experience
6.1 Setup the board.
Connect a wire between Port D5 pin and one of the eight LED's on the board - Port D5 is our Digital 13 pin, according to the Sanguino pinout. By the way, Port B0 (alias Digital 0) is used by the bootloader as LED indicator so you can connect it too, to see the LED blinking when a program is uploaded on the board.
6.2 Write and load the sketch on the board.
Lanunch Arduino IDE, load/write (original example works without modifications) the sketch bellow and press upload button - you must have the board connected to USB port. Be careful, Arduino language is case sensitive.
/* Created 1 June 2005 By David Cuartielles based on an orginal by H. Barragan for the Wiring i/o board */ int ledPin = 13; // LED connected to digital pin 13 // The setup() method runs once, when the sketch starts void setup() {
// initialize the digital pin as an output: pinMode(ledPin, OUTPUT);
}
// the loop() method runs over and over again, // as long as the Arduino has power void loop()
{
digitalWrite(ledPin, LOW); // set the LED on delay(250); // wait for a second digitalWrite(ledPin, HIGH); // set the LED off delay(250); // wait for a second }
6.3 Running sketch
Go to the examples/tutorials/applications page.