Wiring Forum
All Forums => Programming Questions => Topic started by: yombo on December 10, 2011, 03:02:49 PM
-
Hi there!
I'm the guy that made the wiki article about bootloading a 1284.
Is it possible to upload a sketch to a micro directly with ISP? I mean to upload a sketch to a board using another board (Duemilanove) and the Wiring ISP sketch. For now I've been only able to upload bootloaders..
If not, what other ways are there to do it?
When my robot is started, it moves its wheels while the bootloader is running (about 2 seconds) before my sketch gets the control of the wheels. That's why I want to program with ISP and get rid of the bootloader.
Thanks
-
There is a way to program via avrdude through WiringISP, but it's not available in the IDE yet (other than uploading the bootloader). In the next version of the IDE, we hope to have a way to select the upload method.
You could modify the bootloader to stop moving the motors (whatever control you're using - e.g. if it's an H-Bridge enable control, just define those outputs in the bootloader such that they disable the H-Bridge).
-
I only have the .hex of the bootloader, where can I find the sources? And, can I compile them with Wiring?
Thanks
-
You can find the bootloader source under hardware/Wiring/bootloaders.
You can't compile it within the IDE (yet?). You'll need to compile it from the command line using "make".
-
I've executed 'make' in hardware/Wiring/bootloaders/build
It has generated some files, and a .hex named WiringBoot_arduino-328p-16MHz.hex
Okay, but I'm using a bare atmega 1284 on a breadboard :)
So i need to generate the WiringBoot_ATmega1284_16MHz.hex, how can I tell it to do that?
(I suppose that the file then needs to be copied to hardware/Atmel/bootloaders/, is that right?)
Thanks.
-
The make tool compiled the bootloader ok, but how can I tell it to build the atmega 1284 bootloader?
Thanks
-
Did you use this to make the bootloader?
make atmel-1284-16MHz
If so, then you should have a file in the build folder named WiringBoot_ATmega1284_16MHz.hex
-
It worked perfectly!
About the H-bridge, it has 2 PWM inputs and 2 'direction' inputs (it is made with 4 TC4422/21 MOSFET drivers, a 74LS04 and a 74LS08), so I put all the four signals to 0 with these lines in the main method:
*(PORT_TO_DDR(PORTB)) |= 0x1E;
PORTB &= 0xE1;
(the signals are tied to PORTB1..4, pins 2..5)
Thanks
-
Yep, sounds good. I did the same with our Rogue Robotics rEDI board with LCHB (H-Bridge board). The bootloader keeps the enable pins low to disable the H-Bridge during upload.
-
It has generated some files, and a .hex named WiringBoot_arduino-328p-16MHz.hex
Okay, but I'm using a bare atmega 1284 on a breadboard :)
So i need to generate the WiringBoot_ATmega1284_16MHz.hex, how can I tell it to do that?