9600 Baudrate Bootloader

Hi All,

I have a pair of APC200 Transceivers (433 MHz version of APC220) that i would like to use to Upload Sketches.

I have searched around for Older Versions of the Bootloader but cant seem to find any!

Can anybody point me in the right direction?

Thanks

The older bootloaders are all 19200 baud. You will have to custom-compile a bootloader to get a 9600 baud one.

You might be able to fake it by running a 19200 baud 16 MHz bootloader on an 8 MHz Arduino. That would drop the baud rate by half.

for the bootloaders that come with arduino software the baud rate its hard codded in a file something like

#ifndef BAUD_RATE
#define BAUD_RATE   19200
#endif

so if you edit the value to 9600 recompile the bootloader and burn it youll be able to use that baud rate you want

putyn:
for the bootloaders that come with arduino software the baud rate its hard codded in a file something like

#ifndef BAUD_RATE

#define BAUD_RATE  19200
#endif



so if you edit the value to 9600 recompile the bootloader and burn it youll be able to use that baud rate you want

Thanks for the pointer.

Where is this file Located? I'm doing a search now.

usually in source file of the bootloader - for the bootloader prior to uno file its located in arduino/hardware/arduino/bootloaders/atmega and the file name is ATmegaBOOT_168.c

That ifndef only sets the baud rate define if it is not already set to something.
The Makefile sets the value BAUD_RATE for several of the targets so the
safest thing to do is to set it in the Makefile.

--- bill

Hi I have tried to compile the bootloader but get this error:

F:\arduino-0022\hardware\arduino\bootloaders\atmega>make pro16

avr-gcc -g -Wall -O2 -mmcu=atmega168 -DF_CPU=16000000L '-DMAX_TIME_COUNT=F_CPU>

4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' -c -o ATmegaBOOT_168.o ATmegaBOOT_
168.c
ATmegaBOOT_168.c: In function 'main':
ATmegaBOOT_168.c:586: error: 'EEWE' undeclared (first use in this function)
ATmegaBOOT_168.c:586: error: (Each undeclared identifier is reported only once
ATmegaBOOT_168.c:586: error: for each function it appears in.)
make: *** [ATmegaBOOT_168.o] Error 1

Here Is what i am trying to do:

I have a Mini Pro 16MHz 5v mounted on a custom PCB to control a Robot (Rover 5).

The Control Command are sent from a PC using a pair of APC200, I want the Control Software to be able to program the Rover controller via the APC200 allowing me to change the function of the Rover on the fly.

This means the only changes that are needed are the upload speed! I think?

yeah kinda odd tried to compile the bootloader and it gave me the same error and ive tried also with the source file that comes with arduino 1.0 beta
a quick search showed this thread http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1260104386 but i haven't had time to apply the changes suggested

anyway you can try to download optiboot bootloader (https://github.com/WestfW/Arduino/tree/master/hardware/arduino/bootloaders/optiboot) ,which its smaller in size, and compile it you may need to change some fuse setting to reflect the new size of the bootloader but if your using the makefile that comes with the bootloader the values for fuses are already set so all you need to is do open the makefile and edit the isp setting ( programmer,port,speed) also add somewhere in the file BAUD_RATE = 9600 then open a terminal and type

make clean
make atmega168
make atmega168_isp

hope this helps and i didn't forgot anything

Yep, you are suffering from the problem that the bootloader no longer compiles with the latest AVR toolset.
I've written about this a few times and even tried to get the code updated to fix this, but with no luck.

I have attached my version of the bootloader which is updated for the newer tools,
includes mega2560 support, and also fixes the watchdog timer issue so you
can recover from a watchdog timeout if you should use those in your code.

It also has an updated Makefile with an update for a an issue in avrdude
to allow using the AVR dragon and to build the 2560 hex image.
(haven't been able to get that update into the official Makefiles either)

Enjoy.

Although, I would recommend moving to optiboot instead,
as it is much smaller and has a much better method of handling the
timeout to jump to application code. This allows swapping out crystals
from say between 8mz and 16mz and the only change will be the baud rate.
It also supportsbootloader revision that can be extracted by special sketch.

--- bill

billsATmega.zip (10.1 KB)

Hi All.

It been a while since i tried to get the APC200 to work as an up-loader for my rover project.

I am using Optiboot Bootloader and made the relevant changes to the Makefile:

atmega328: TARGET = atmega328
atmega328: MCU_TARGET = atmega328p
atmega328: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=9600'
atmega328: AVR_FREQ = 16000000L
atmega328: LDSECTION  = --section-start=.text=0x7e00
atmega328: $(PROGRAM)_atmega328.hex
atmega328: $(PROGRAM)_atmega328.lst

atmega328_isp: atmega328
atmega328_isp: TARGET = atmega328
atmega328_isp: MCU_TARGET = atmega328p
atmega328_isp: HFUSE = DE # 512 byte boot
atmega328_isp: LFUSE = FF # Low power xtal (16MHz) 16KCK/14CK+65ms
atmega328_isp: EFUSE = 05 # 2.7V brownout
atmega328_isp: isp

The Boot-loader works @ 9600 Baud Rate using ftdi Only.

following changes were made to the Boards.txt:

atmega328APC200.name=APC200 328
atmega328APC200.upload.protocol=stk500
atmega328APC200.upload.maximum_size=30720
atmega328APC200.upload.speed=9600
atmega328APC200.bootloader.low_fuses=0xFF
atmega328APC200.bootloader.high_fuses=0xDA
atmega328APC200.bootloader.extended_fuses=0x05
atmega328APC200.bootloader.path=atmega
atmega328APC200.bootloader.file=optiboot_atmega328.hex
atmega328APC200.bootloader.unlock_bits=0x3F
atmega328APC200.bootloader.lock_bits=0x0F
atmega328APC200.build.mcu=atmega328p
atmega328APC200.build.f_cpu=16000000L
atmega328APC200.build.core=arduino

The only problem is when I try to use the APC Modules the upload process hangs. I assume it has something to do with the bootloader not going into upload mode! I have tried to reset the Arduino as the upload process begins with little success (managed to get it to upload a few times), but its not reliable!

Can anyone Help me get the bootloader to go into Upload Mode(If possible)?

Thanks In advance

Darrell

optiboot_atmega328_APC200.hex (1.39 KB)

probably the problem is that your apc200 does not provide the DTR signal used from the ftdi to provide the auto reset since the bootloader will only start to listen for new code if an reset its triggered

It looks like the APC200 does not support DTR or RTS, so that means that it
will not be possible to use auto reset for uploading.

So you will always have to press the reset button to kick the chip into the bootloader.
There is a delay between the time you hit reset and the time the application
starts. So you have to get avrdude up and going before that delay expires.

This kind of sucks given the way the Arduino IDE works since there is no way to do just
an upload. The IDE is really really stupid and rebuilds everything even when it doesn't need
to which might take longer than the bootloader delay.

The pre 1.0 optiboot was using 500MS (half second) and this is probably
not long enough. 1.0 uses 1 second which may or may not be long enough.

About your only choice is to increase the timeout in the bootloader.
This will not affect the startup from a power on, but
it will affect how long it takes to start the application/sketch code after pushing the reset button.
To modify this, look for:

  // Set up watchdog to trigger after 500ms
  watchdogConfig(WATCHDOG_1S);

The pre 1.0 has this set to 500ms the 1.0 release has this set to 1S

If yours was 500MS, than that was probably not long enough.
You can change the value to say WATCHDOG_2S or WATCHDOG_4S
to give it more time to see the download start after pressing the reset button.

--- bill