Welcome! Log In Create A New Profile

Advanced

Programming Bootloader

Posted by marnargulus 
Programming Bootloader
August 23, 2011 12:20PM
OK, so I've got two boards fully assembled, they are detected as USB devices. Now I'm ready to load them with a bootloader, but I don't have an arduino just laying around. I could buy one from adafruit, but that makes my electronics costs literally more than doubled. Could I just use USBtinyISP, or is there a walkthrough that doesn't depend on buying what I'm essentially building?
Re: Programming Bootloader
August 23, 2011 02:57PM
You can use a USB Tiny ISP.


Charles Gantt.
Build blog [themakersworkbench.com] <---- my personal site
Build worklong [www.thebestcasescenario.com]
Re: Programming Bootloader
August 24, 2011 06:31AM
The cheapest programmer is still the parallel port programmer: [www.arduino.cc]


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Programming Bootloader
August 26, 2011 11:49AM
I've just finished building my first sanguiniololu, but I don't have an ISP - is there a way to program the bootloader without one, or is it compulsory?
Re: Programming Bootloader
August 26, 2011 11:59AM
This weekend I'll get a step by step instructions set up for using the parallel port (printer) to serial (or direct pin) method described by Traumflug's link to Arduino.cc's hacking blog. My understanding is that after you've done your first board you can use that as an ISP, but if you have a serial cord hanging around, all you need are: wiring (doesn't need to be a specific cable, just ~ 22-24 awg.), 2 470 ohm resistors (1/8 watt is fine), and 1 220 ohm resistor.

Resistors can be bought at radio shack (5 pack is a dollar), serial cable can be found at pawn shop for a buck (or ~8 bucks at a retail store), loose wiring can be found everywhere (telephone wire is perfect gauge)

Making the Parallel Port Programmer
[www.arduino.cc]

Using the bootloader
[arduino.cc]

Don't worry too much about wire gauges, just don't use a coathanger for each line (although that might work fine too).
Re: Programming Bootloader
August 26, 2011 12:01PM
And it is best to cut the serial cord and hard wire it, as if you just stick the resistor leads into the female end you risk bricking the chip if they lose contact.
Re: Programming Bootloader
August 27, 2011 10:29AM
Or if you have an Arduino laying around you can use this method. [reprap.org]


Charles Gantt.
Build blog [themakersworkbench.com] <---- my personal site
Build worklong [www.thebestcasescenario.com]
Re: Programming Bootloader
August 31, 2011 05:19PM
So I made my parallel port programmer today and will be attempting to burn the bootloader later in the week.

I made it from a whole parallel cable - I didn't cut it down. If anyone else wants to take this approach (note - currently untested!) the pins are as follows:


              PC end        Printer end
Pin #             1                  1
                  2                  2 
                  11                11
                  16                31
                  18                19
More details and some photos on my blog: foraysinto3d
Re: Programming Bootloader
September 03, 2011 12:35PM
I tried programming the bootloader today, and was met by failure.

I tried both with and without the 12v side of my sanguniololu powered, and got the same message each time:

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA644P is 1E 96 0A
avrdude: AVR device not responding
 ***failed;  
avrdude: verification error, first mismatch at byte 0x0000
         0xfd != 0xff
avrdude: verification error; content mismatch

This is with the parallel port programmer as linked above. I have installed giveio, and disabled windows polling the parallel port.

Does anyone have any insight into where I'm going wrong?
Re: Programming Bootloader
September 03, 2011 12:47PM
You still need to use an external oscillator to program the chip. A 16mhz Resonator will work perfect. Follow the schematic in the link I posted for wiring up the resonator.


Charles Gantt.
Build blog [themakersworkbench.com] <---- my personal site
Build worklong [www.thebestcasescenario.com]
Re: Programming Bootloader
September 03, 2011 01:26PM
I have been attempting to program with the chip mounted in the board. In this config there is already a resonator connected across these pins - do I still need to add another?
Re: Programming Bootloader
September 03, 2011 02:46PM
No you should not need another as long as the chip is powered up by the USB cable I think.


Charles Gantt.
Build blog [themakersworkbench.com] <---- my personal site
Build worklong [www.thebestcasescenario.com]
Re: Programming Bootloader
September 03, 2011 05:24PM
The USB is plugged in, and the power LED is on.

Interestingly, the avrdude error is the same as when I try to program the board without the programmer connected, so it sounds like something is not talking/connected correctly. I'm sure the parallel programmer I made is correct, and I buzzed it several times while building to check the connections.
Re: Programming Bootloader
September 03, 2011 05:44PM
are any of the capacitors backwards? and you do not have an arduino or access to one, correct? post a photo of the board


Charles Gantt.
Build blog [themakersworkbench.com] <---- my personal site
Build worklong [www.thebestcasescenario.com]
Re: Programming Bootloader
September 03, 2011 06:32PM
I don't believe any of the caps are in backwards. Correct, I don't have access to one. I ought to have access to an AVRISPMKII next week though, if I can't get things working with the parallel cable.

Photo of board without IC fitted.

Other information: the board is rev 1.1, I'm using Aruduino 18 and sanguinio 18 on XP SP2.
Re: Programming Bootloader
September 03, 2011 09:52PM
If that is a resonator, those caps are not needed. Resonators have built in .22pf caps


Charles Gantt.
Build blog [themakersworkbench.com] <---- my personal site
Build worklong [www.thebestcasescenario.com]
Re: Programming Bootloader
September 04, 2011 12:26PM
The caps next to the resonator are not for the load capacitance - they are caps C13 and 14, and are between pins 30 & 10 and ground. They're next to the processor on the schematic, and are 0.1uF.
Sorry, only registered users may post in this forum.

Click here to login