This shows you the differences between two versions of the page.
|
software:bootloaders [2010/07/29 13:33] edwin |
software:bootloaders [2010/07/29 15:39] (current) edwin |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== AVR bootloaders ====== | ||
| + | ===== Introduction ===== | ||
| + | Bootloaders are little pieces of program code residing somewhere on top of the memory page of a microcontroller. They can be used to -self-program the flash memory (taking care not to overwrite themselves). Instead of a hardware programmer you can use an available communication port (such as the serial port) to upload new programs into the controllers flash memory. | ||
| + | |||
| + | When you would like to use bootloaders you basically end up with these questions: which bootloader source, how to compile it and how to get it into the AVR in the first place (sort of chicken-egg problem). | ||
| + | |||
| + | {{:software:avrisp.jpg?200|}} {{:software:avr_isp.jpg?200|}} {{:software:avrdragon-big.jpg?200|}} | ||
| + | |||
| + | ===== Compiling Arduino bootloaders ===== | ||
| + | The AVR bootloader source that can be obtained from the [[http://svn.berlios.de/viewcvs/arduino/trunk/hardware/bootloaders/ | arduino svn]] is not yet suitable to work with all AVR microcontrollers since arduino boards mainly target mega88-mega168-mega328 and are currently abandoning support for old mega8 devices. So the available bootloaders for arduino live in basically two categories: ATmega8 compatible and ATmega 168 compatible. The Atmega88 is 168 compatible, the mega32 for example is mega8 compatible. With compatible, I mean congruent in register definitions, not memory size etc. In order to work with more controllers, the %%#if defined(__ATmega8__) has to be extended with an || defined (__ATmega32__)%%, for example. | ||
| + | |||
| + | Also in the wiring.c, and alike files in the hardware/arduino directory, all defines need to be adapted. The bootloader furthermore contains an error in defining the UART bits. The separate definition for m32 is incorrect, and should be like the one for the mega8. I will try to list everything sufficiently detailed below. | ||
| + | |||
| + | The hardware used consists of a number of custom AVR boards, mostly equipped with HIN202 RS232 level adapters. The boards run at 16MHz. A serial-2-usb cable with a PL2303 chip has been used to connect the boards and programmer hardware to a MacbookPro running OS10.5. Below the experiences using a serial programmer by Atmel (AVRISP) and an AVR-dragon series programmer. | ||
| + | |||
| + | |||
| + | ==== Arduino bootloader for ATmega88 ==== | ||
| + | This modified bootloader is used for the [[boards:ottantotto]] board. | ||
| + | === Compiling the bootloader === | ||
| + | In the makefile for the bootloader add the following section: | ||
| + | <code> | ||
| + | atmega88: TARGET = atmega88 | ||
| + | atmega88: MCU_TARGET = atmega88 | ||
| + | atmega88: CFLAGS += '-DMAX_TIME_COUNT=F_CPU»»4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=19200 | ||
| + | atmega88: AVR_FREQ = 16000000L | ||
| + | atmega88: LDSECTION = --section-start=.text=0x1800 | ||
| + | atmega88: $(PROGRAM)_atmega88.hex | ||
| + | </code> | ||
| + | |||
| + | |||
| + | * In the file ATmegaBOOT_168.c replace every instance of %%#if defined(__AVR_ATmega168__) with #if defined(__AVR_ATmega168__) || defined (__AVR_ATmega88__) || defined(__AVR_ATmega328P__)%% | ||
| + | * Change the BlinkLED to PORTB.0 instead of PORTB.5 (arduino pin 13) | ||
| + | |||
| + | {{:software:atmegaboot_168.c.zip|}} | ||
| + | |||
| + | Using any avr-ported C compiler (such as [[http://WinAVR.sourceforge.net|winavr]] or [[http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_GCC_Toolchain|AVR-GCC for mac]]) the bootloader can be compiled and uploaded as described in the sections below. | ||
| + | |||
| + | === Compiling programs for ATmega88 === | ||
| + | You need to change the arduino boards.txt file as well in order to talk to this board from arduino: | ||
| + | |||
| + | In the boards.txt add: | ||
| + | <code> | ||
| + | ############################################################## | ||
| + | |||
| + | atmega88.name=Ottantotto with Atmega88 | ||
| + | |||
| + | atmega88.upload.protocol=stk500 | ||
| + | atmega88.upload.maximum_size=7168 | ||
| + | atmega88.upload.speed=19200 | ||
| + | |||
| + | atmega88.bootloader.low_fuses=0xFF | ||
| + | atmega88.bootloader.high_fuses=0xDD | ||
| + | atmega88.bootloader.extended_fuses=0xF8 | ||
| + | atmega88.bootloader.path=atmega | ||
| + | atmega88.bootloader.file=ATmegaBOOT_168_atmega88.hex | ||
| + | atmega88.bootloader.unlock_bits=0x3F | ||
| + | atmega88.bootloader.lock_bits=0x0F | ||
| + | |||
| + | atmega88.build.mcu=atmega88 | ||
| + | atmega88.build.f_cpu=16000000L | ||
| + | atmega88.build.core=arduino | ||
| + | |||
| + | ############################################################## | ||
| + | </code> | ||
| + | |||
| + | ==== Arduino bootloader for ATmega32 ==== | ||
| + | ATmega32 controllers are not usually found in Arduino boards. However, since they have been used in a number of projects, it is usefull to adapt both bootloader and Arduino environment. | ||
| + | |||
| + | === Compiling (and programming) the bootloader === | ||
| + | remove / comment out the EFUSE definition. Since the ATmega32 does not have this fuse, don't try to program it, so remove | ||
| + | U efuse:w:0x$(EFUSE):m | ||
| + | in the ISPFUSES setting. | ||
| + | |||
| + | the makefile has been extended: | ||
| + | <code> | ||
| + | atmega32: TARGET = atmega32 | ||
| + | atmega32: MCU_TARGET = atmega32 | ||
| + | atmega32: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' | ||
| + | atmega32: AVR_FREQ = 16000000L | ||
| + | atmega32: LDSECTION = --section-start=.text=0x7800 | ||
| + | atmega32: $(PROGRAM)_atmega32.hex | ||
| + | |||
| + | atmega32_isp: atmega32 | ||
| + | atmega32_isp: TARGET = atmega32 | ||
| + | atmega32_isp: MCU_TARGET = atmega32 | ||
| + | atmega32_isp: HFUSE = DA | ||
| + | atmega32_isp: LFUSE = FF | ||
| + | atmega32_isp: isp | ||
| + | </code> | ||
| + | |||
| + | the --section start directive tells the compiler where the bootloader section starts. In the avr datasheet this address is given in words (0x3c00) For the compiler here, the address needs to be in bytes, so you have to multiply the number in datasheet hexadecimal by two (so 0x3c00 becomes 0x7800) | ||
| + | In the bootloader source itself, make sure the correct registers for UART are set: | ||
| + | <code> | ||
| + | #elif defined __AVR_ATmega8__ || defined __AVR_ATmega32__ | ||
| + | /* m8 , 32*/ | ||
| + | UBRRH = (((F_CPU/BAUD_RATE)/16)-1)>>8; // set baud rate | ||
| + | UBRRL = (((F_CPU/BAUD_RATE)/16)-1); | ||
| + | UCSRB = (1<<RXEN)|(1<<TXEN); // enable Rx & Tx | ||
| + | UCSRC = (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0); // config USART; 8N1 | ||
| + | </code> | ||
| + | |||
| + | Here are the used bootloader sources: {{:software:atmegaboot-32.zip|}} | ||
| + | |||
| + | === Compiling Software for mega32 using Arduino === | ||
| + | Adapt the boards.txt file in your arduino hardware directory: | ||
| + | |||
| + | <code> | ||
| + | ############################################################## | ||
| + | |||
| + | atmega32.name=Atmega32 board | ||
| + | |||
| + | atmega32.upload.protocol=stk500 | ||
| + | atmega32.upload.maximum_size=30720 | ||
| + | atmega32.upload.speed=19200 | ||
| + | |||
| + | atmega32.bootloader.low_fuses=0xFF | ||
| + | atmega32.bootloader.high_fuses=0xDA | ||
| + | atmega32.bootloader.path=atmega | ||
| + | atmega32.bootloader.file=ATmegaBOOT_168_atmega32.hex | ||
| + | atmega32.bootloader.unlock_bits=0x3F | ||
| + | atmega32.bootloader.lock_bits=0x0F | ||
| + | |||
| + | atmega32.build.mcu=atmega32 | ||
| + | atmega32.build.f_cpu=16000000L | ||
| + | atmega32.build.core=arduino | ||
| + | |||
| + | ############################################################## | ||
| + | </code> | ||
| + | |||
| + | Furthermore, change every instance of | ||
| + | #if defined(__ATmega8__) | ||
| + | in all the c-files in cores/arduino (such as wiring.c, hardwareserial.cpp, wiring_analog.c, wiring_digital.c, WInterrupts.c) into | ||
| + | #if defined(__ATmega8__)|| defined(__ATmega32__) | ||
| + | |||
| + | Also, you need to change the pin definitions. Some work has been done by [[http://www.robotcraft.ca/webshop/download/zip/arduino-mega32-644-mod.zip || robocraft]]. Download and unzip to the correct directory. | ||
| + | |||
| + | The following example makes a LED blink on PORTB.1. This has been tested on the Mega32 | ||
| + | <code> | ||
| + | int ledPin = 9; // LED connected to digital pin 13 | ||
| + | |||
| + | void setup() // run once, when the sketch starts | ||
| + | { | ||
| + | pinMode(ledPin, OUTPUT); // sets the digital pin as output | ||
| + | } | ||
| + | |||
| + | void loop() // run over and over again | ||
| + | { | ||
| + | digitalWrite(ledPin, HIGH); // sets the LED on | ||
| + | delay(100); // waits for a second | ||
| + | digitalWrite(ledPin, LOW); // sets the LED off | ||
| + | delay(100); // waits for a second | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ===== Programming Bootloaders using AVRdude ===== | ||
| + | AVRdude is the de-facto command line programmer for AVR. It supports most of the programmers currently in existence. It can be used both to talk to the Arduino bootloader and program the Arduino (basically the arduino bootloader makes the arduino 'act' as an STK500 compatible programmer, so AVRdude thinks it is working with an STK system. On the other hand, AVRdude can be used to flash bootloader software into the AVR in the first place. In that case another piece of programmer hardware such as an AVRISP or AVRdragon is necessary. A generic tutorial on AVRdude for Arduino can be found on [[http://www.ladyada.net/learn/avr/avrdude.html | ladyada's site]]. There are however a number of quirks that need attention. | ||
| + | |||
| + | ==== Talking to AVRISP ==== | ||
| + | Using the old serial AVRISP by atmel. It is connected to a serial-2-USB cable on MAC OS 10.5.. The serial device is a PL2303 clone-cable. | ||
| + | |||
| + | To use the AVR-ISP unit and avrdude to program for example the bootloader source (see below) in an ATmega32, set the following options (in the makefile) - or use the following options from command line (below) | ||
| + | <code> | ||
| + | ISPTOOL = avrisp2 | ||
| + | ISPPORT = /dev/tty.PL2303-00001004 | ||
| + | ISPSPEED = -b 115200 | ||
| + | </code> | ||
| + | type | ||
| + | make atmega32_isp | ||
| + | |||
| + | from the command line, and avr dude will be executed. For some nonobvious reason I had to use avrisp2 instead of avrisp. Don't know why. | ||
| + | |||
| + | This can also be called from the command line. For clean testing, use | ||
| + | avrdude -b 115200 -P /dev/tty.PL2303-00001004 -pm32 -c avrisp2 -n | ||
| + | |||
| + | which will respond with | ||
| + | <code> | ||
| + | avrdude: AVR device initialized and ready to accept instructions | ||
| + | |||
| + | Reading | ################################################## | 100% 0.05s | ||
| + | |||
| + | avrdude: Device signature = 0x1e9502 | ||
| + | |||
| + | avrdude: safemode: Fuses OK | ||
| + | |||
| + | avrdude done. Thank you. | ||
| + | </code> | ||
| + | |||
| + | ==== Talking with the arduino bootloader ==== | ||
| + | see also http://arduino.cc/en/Hacking/CommandLine/ | ||
| + | |||
| + | To check the arduino bootloader, the same trick as described above can be done: | ||
| + | |||
| + | type from the commandline | ||
| + | |||
| + | avrdude -b 19200 -P /dev/tty.PL2303-00001004 -pm32 -c stk500v1 -n | ||
| + | |||
| + | which will hopefully respond with | ||
| + | |||
| + | <code> | ||
| + | avrdude: AVR device initialized and ready to accept instructions | ||
| + | |||
| + | Reading | ################################################## | 100% 0.03s | ||
| + | |||
| + | avrdude: Device signature = 0x1e9502 | ||
| + | |||
| + | avrdude: safemode: Fuses OK | ||
| + | |||
| + | avrdude done. Thank you. | ||
| + | </code> | ||
| + | |||
| + | ==== Talking to the AVR dragon ==== | ||
| + | Dragon is a great system, good value for money. Downside is you have to 'convert' it to a programmer. Zif socket is step one, after that, you have to supply wires from the ISP -6 socket on the dragon to the corresponding ones for the atmega168 on the zif socket. Also connect power (5V) from the dragon to the chip. Take care, the power is NOT where you would expect it (like on pin 2 and 6 of the ISP). You have to take the 5V from somewhere else AND connect the VCC of the ISP (for power DETECTION). Make sure also to plug in (air-wire) an oscillator to the correct pins on the chip, because as soon as you change the fusebits for the atmega168 to run on oscillator (when there is none present) the programmer cannot talk to the atmega168 anymore. | ||
| + | |||
| + | From the avrdude manual: (see {{:software:avrdude-doc-5.5.pdf|}}) | ||
| + | |||
| + | //The AVR Dragon is supported in all modes (ISP, JTAG, HVSP, PP, debugWire). When used in JTAG and debugWire mode, the AVR Dragon behaves similar to a JTAG ICE mkII, so all device-specific comments for that device will apply as well. When used in ISP mode, the AVR Dragon behaves similar to an AVRISP mkII (or JTAG ICE mkII in ISP mode), so all device-specific comments will apply there. In particular, the Dragon starts out with a rather fast ISP clock frequency, so the **-B bitclock** option might be required to achieve a stable ISP communication. For ATxmega devices, the AVR Dragon is supported in PDI mode, provided it has a firmware version of at least 6.11 (decimal).// | ||
| + | |||
| + | Testing the connection (on Mac OSX): | ||
| + | <code> | ||
| + | edwin-dertiens-macbook-pro:dev dertien$ avrdude -p m88 -c dragon_isp -B 8 -n -P usb | ||
| + | |||
| + | avrdude: AVR device initialized and ready to accept instructions | ||
| + | |||
| + | Reading | ################################################## | 100% 0.15s | ||
| + | |||
| + | avrdude: Device signature = 0x1e930a | ||
| + | |||
| + | avrdude: safemode: Fuses OK | ||
| + | |||
| + | avrdude done. Thank you. | ||
| + | |||
| + | edwin-dertiens-macbook-pro:dev dertien$ | ||
| + | </code> | ||
| + | |||
| + | Now programming for example the [[boards:ottantotto]] bootloader and setting fuse bits using the dragon: | ||
| + | |||
| + | <code> | ||
| + | edwin-dertiens-macbook-pro:ArduinoMega168boot dertien$ avrdude -p m88 -c dragon_isp -B 8 -P usb -U flash:w:ATmegaBOOT_168_atmega88.hex -U hfuse:w:0xdd:m -U lfuse:w:0xff:m -U efuse:w:0xf8:m | ||
| + | |||
| + | avrdude: AVR device initialized and ready to accept instructions | ||
| + | |||
| + | Reading | ################################################## | 100% 0.15s | ||
| + | |||
| + | avrdude: Device signature = 0x1e930a | ||
| + | avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed | ||
| + | To disable this feature, specify the -D option. | ||
| + | avrdude: erasing chip | ||
| + | avrdude: reading input file "ATmegaBOOT_168_atmega88.hex" | ||
| + | avrdude: input file ATmegaBOOT_168_atmega88.hex auto detected as Intel Hex | ||
| + | avrdude: writing flash (7672 bytes): | ||
| + | |||
| + | Writing | ################################################## | 100% 1.80s | ||
| + | |||
| + | avrdude: 7672 bytes of flash written | ||
| + | avrdude: verifying flash memory against ATmegaBOOT_168_atmega88.hex: | ||
| + | avrdude: load data flash data from input file ATmegaBOOT_168_atmega88.hex: | ||
| + | avrdude: input file ATmegaBOOT_168_atmega88.hex auto detected as Intel Hex | ||
| + | avrdude: input file ATmegaBOOT_168_atmega88.hex contains 7672 bytes | ||
| + | avrdude: reading on-chip flash data: | ||
| + | |||
| + | Reading | ################################################## | 100% 3.91s | ||
| + | |||
| + | avrdude: verifying ... | ||
| + | avrdude: 7672 bytes of flash verified | ||
| + | avrdude: reading input file "0xdd" | ||
| + | avrdude: writing hfuse (1 bytes): | ||
| + | |||
| + | Writing | ################################################## | 100% 0.15s | ||
| + | |||
| + | avrdude: 1 bytes of hfuse written | ||
| + | avrdude: verifying hfuse memory against 0xdd: | ||
| + | avrdude: load data hfuse data from input file 0xdd: | ||
| + | avrdude: input file 0xdd contains 1 bytes | ||
| + | avrdude: reading on-chip hfuse data: | ||
| + | |||
| + | Reading | ################################################## | 100% 0.05s | ||
| + | |||
| + | avrdude: verifying ... | ||
| + | avrdude: 1 bytes of hfuse verified | ||
| + | avrdude: reading input file "0xff" | ||
| + | avrdude: writing lfuse (1 bytes): | ||
| + | |||
| + | Writing | ################################################## | 100% 0.15s | ||
| + | |||
| + | avrdude: 1 bytes of lfuse written | ||
| + | avrdude: verifying lfuse memory against 0xff: | ||
| + | avrdude: load data lfuse data from input file 0xff: | ||
| + | avrdude: input file 0xff contains 1 bytes | ||
| + | avrdude: reading on-chip lfuse data: | ||
| + | |||
| + | Reading | ################################################## | 100% 0.05s | ||
| + | |||
| + | avrdude: verifying ... | ||
| + | avrdude: 1 bytes of lfuse verified | ||
| + | avrdude: reading input file "0xf8" | ||
| + | avrdude: writing efuse (1 bytes): | ||
| + | |||
| + | Writing | | 0% 0.00s ***failed; | ||
| + | Writing | ################################################## | 100% 0.41s | ||
| + | |||
| + | avrdude: 1 bytes of efuse written | ||
| + | avrdude: verifying efuse memory against 0xf8: | ||
| + | avrdude: load data efuse data from input file 0xf8: | ||
| + | avrdude: input file 0xf8 contains 1 bytes | ||
| + | avrdude: reading on-chip efuse data: | ||
| + | |||
| + | Reading | ################################################## | 100% 0.05s | ||
| + | |||
| + | avrdude: verifying ... | ||
| + | avrdude: verification error, first mismatch at byte 0x0000 | ||
| + | 0xf8 != 0x00 | ||
| + | avrdude: verification error; content mismatch | ||
| + | |||
| + | avrdude: safemode: efuse changed! Was f8, and is now 0 | ||
| + | Would you like this fuse to be changed back? [y/n] n | ||
| + | avrdude: safemode: Fuses OK | ||
| + | |||
| + | avrdude done. Thank you. | ||
| + | |||
| + | edwin-dertiens-macbook-pro:ArduinoMega168boot dertien$ | ||
| + | </code> | ||
| + | |||
| + | === E-fuse troubles === | ||
| + | Only the e-fuse (with the bootloader enable bit) does not seem to work on verification. However, after checking with avrstudio, the e-fuse reads the correct value, so first thought is that avrdude's e-fuse verification function could be erroneous. Diving into this: only 3 bits from the E-fuse are used (bit 0 for enabling bootloader, bit 1 and 2 for bootloader size - see [[http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf|datasheet]] page 286). By default, these are programmed 0x07. Since the default efuse state is 0xFF, AVRstudio interprets setting the last three bits to zero (writing 0x00) as writing 0xF8. AVRdude throws a warning. Conclusion: last part of the command should read **-U efuse:w:0x00:m** (in avrStudio it should still turn up as 0xF8). So.. definitive command for programming avrbootloader from commandline using AVRdude should be: | ||
| + | avrdude -p m88 -c dragon_isp -B 8 -P usb -U flash:w:ATmegaBOOT_168_atmega88.hex -U hfuse:w:0xdd:m -U lfuse:w:0xff:m -U efuse:w:0x00:m | ||
| + | |||
| + | See [[http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=59209&start=0|AVRfreaks.net]] for a forum post on this topic | ||
| + | |||
| + | ==== Connecting the dragon ==== | ||
| + | To use the dragon as quick programming device is easy if you add a ZIF (zero insertion force) socket. The dragon has a 'prototyping' area which allows you to solder your own connectors of choice. Here's a configuration for batch-bootloader-programming-work: | ||
| + | |||
| + | {{:software:dragon1.jpg?200|}} | ||
| + | |||
| + | The dragon has been mounted on a piece of wood (weight, no shorts on the bottom-pcb-side by stray pieces of wire). A 40pin ZIF socket has been added. Note the piece of tape to help you to put in 28pin dip chips. The 6-pin ISP socket is completely wired: | ||
| + | |||
| + | {{:software:dragon2.jpg?200|}} | ||
| + | |||
| + | ^ISP^^dip28^^ | ||
| + | |1 |MISO| 18 |PB4| | ||
| + | |2 |Vdetect | - | to power socket| | ||
| + | |3 |SCK | 19 | PB5| | ||
| + | |4 |MOSI| 17 | PB3| | ||
| + | |5 |RESET| 1 | RESET | | ||
| + | |6 |GND | 8 | GND | | ||
| + | |||
| + | The Vdetect is normally used to power the programmer hardware, but is also used as methode for detection of power supply on the AVR is present. Pin 2 (Vdetect) needs to go to the power supply in this case and not directly to pin 7 (VCC) of the AVR. Furthermore the following connections are made using the power socket (6pin on dragon containing 3x GND and 3x VCC) | ||
| + | |||
| + | {{:software:dragon3.jpg?200|}} | ||
| + | |||
| + | ^ dragon power ^^ dip28 ^^ | ||
| + | | 1 | VCC | 7 | VCC | | ||
| + | |||
| + | and an oscillator has been connected: | ||
| + | |||
| + | {{:software:dragon4.jpg?200|}} | ||
| + | |||
| + | ^ Oscillator ^^ dip28 ^^ | ||
| + | |1| xtal1 | 9 | XTAL1 | | ||
| + | |2| GND | - | to power socket | | ||
| + | |3| xtal2 | 10| XTAL2 | | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ====== Other bootloaders for atmel ====== | ||
| + | //Source from a page written for the Solar Robot project 'Spiral Solar Sunrise'// | ||
| + | ===== Arduino bootloaders ===== | ||
| + | The arduino software from arduino.cc comes with pre-compiled bootloaders. It is however possible to re-compile these sources for different frequencies (8MHz instead of 16MHz) and different controllers. I used WinAVR togeterher with Atmel's AVR-studio for compiling these sources. There is however one problem, the makefiles that are being delivered with the arduino environment cannot be used with a standard AVR-studio - WinAVR system (at least not on mine) so I used a different makefile. Other data on Arduino Bootloader modifications can be found on ladyada.net | ||
| + | |||
| + | The projects and used makefiles can be found in the directory next to this page. Different to conventional makefiles when compiling bootloaders, is to set a linker option (LDFLAGS) to the memory range where the bootloader will be residing, which is dependant of the bootloader's size. For the Arduino NG bootloader this means typing LDFLAGS = -Wl,-Map=$(TARGET).map,--section-start=.text=0x3800. The bootloaders were programmed using the ISP connection and a standard Atmel programmer from AVR-Studio. | ||
| + | |||
| + | ===== Underclocking Arduino's for less power consumption ===== | ||
| + | At the FuseBits section of the programmer tool, the frequency of the controller was changed from 16MHz external to 8MHz internal RC oscillator. The freshly compiled bootloaders can be loaded after that. For the Arduino programming software itself the file board.txt (in the dir 'hardware') needs to be altered for use of a different CPU frequency. -> atmega168.build.f_cpu=8000000L . The effect of this under-clocking operation is a reduction in current of 1/3. (so 27mA at 12V instead of 37mA at 12V) | ||
| + | |||
| + | {{:software:mega8-8mhz.zip|}} | ||
| + | {{:software:mega168-8mhz.zip|}} | ||
| + | |||
| + | |||