Show Posts
Pages: 1 2 [3] 4 5 ... 25
31  Using Arduino / Microcontrollers / Leonardo and critical timing on: March 15, 2013, 02:29:57 am
Dear Group,
I'm designing a device which will use a USB port to upload firmware updates (the port won't be used for anything else).  To save space I'm planning on using a Sparkfun ProMicro, which is an ATmega32U4 board similar to an Arduino Leonardo.

As far as I can see I have two choices for firmware upload:
- An AVR109 bootloader, which requires hardware signals to enter programming mode
- The Leonardo environment, which includes USB code in the application to trigger the bootloader

The second option is simpler and more elegant, but may interfere with the application code.  The application contains certain routines which run with critical timing, which might be disturbed if interrupted by USB service routines.

Does anybody have any advice or pointers regarding the Leonardo application-space USB code?  Can it be disabled and re-enabled in software?  Thanks,
32  Using Arduino / Microcontrollers / Re: Trouble Burning a Bootloader to Arduino on: March 14, 2013, 01:20:50 am
Try connecting a LED to the 5V supply backwards. See if it damages it... (make sure it's a LED you didn't care about)
Most LEDs will easily withstand 5V reverse voltage with no ill effects.  In a multiplexed display reverse bias is unavoidable.
33  Using Arduino / Microcontrollers / Re: New Makefile structure in optiboot source repository. on: March 11, 2013, 03:59:20 pm
Very nice.  I just tested the new version (Arduino IDE compilation tools running under Win7), and it works with no hitches for me.
34  Using Arduino / Microcontrollers / Re: decideur electronique on: March 05, 2013, 05:57:45 pm
Eddy, it sounds like you're an absolute beginner in both electronics and programming.  I'd suggest looking for some suitable introductory books such as Massimo Banzi's, which is available in a French translation.  Look for "Démarrez avec Arduino: Principes de base et premiers montages".  If you're comfortable reading English there's also a lots of good info on the Adafruit website at
35  Using Arduino / Microcontrollers / Re: Arduino mini, pro mini power consumption on: March 02, 2013, 08:15:57 am
The power LED draws about 0.2mA; the remainder is drawn by the regulator.
36  Using Arduino / Microcontrollers / Re: Arduino mini, pro mini power consumption on: January 11, 2013, 06:49:42 pm
Applying 3.3V to the VCC pin of an 8MHz Pro-Mini, I measured a minimum current draw of approx 1mA.  That's with all MCU peripherals disabled, and the CPU in power-down (the deepest sleep mode available).

Then I cut a PCB trace to isolate the regulator and power LED, as shown below.  With this small modification, I could get the current draw down to <3uA (which is the error of my meter).

The cut can be undone by shorting the two VCC pins together.  NB the Pro-Mini PCB has been redesigned since then, so check that this mod is still possible before buying.

37  Using Arduino / Microcontrollers / Re: Just got a new Mega 2560 - full of hope, but fail :( on: January 04, 2013, 05:27:11 pm
Hi Melbfella,
As far as I can tell from the bootloader code, the Mega should flash its yellow "L" LED rapidly 3 times whenever it is reset (as the Uno does).  Does yours do this when you press the reset button?  Does it also do it when you attempt to upload a sketch?
38  Using Arduino / Microcontrollers / Re: Messed up some fuses on: January 04, 2013, 05:10:26 pm
You might not need to remove the on-board crystal.  I've previously been able to apply external clock signals to the 328p on an Uno without disconnecting the resonator.
39  Using Arduino / Microcontrollers / Re: Working with AtMega 16U2 [MIDI firmware] on: January 02, 2013, 12:58:00 pm
When I tried it I found that binaries compiled for the 8U2 and 16U2 were identical.
40  Using Arduino / Microcontrollers / Re: Poor clock accuracy of UNO on: December 18, 2012, 07:12:57 pm
the average error is 43ppm,

That surprised me a little bit. Most crystals are 1ppm/c, and 20ppm initial so unless yours was exposed to 20c+/- variations it is hard to produce that kind of drift.

Hi Dhenry,
I think you're mixing up frequency stability and average error.  I measured a variation of approximately 0.28ppm/C, which is well within spec.  Average tolerances of +/-50ppm are common, so an average error of 43ppm is reasonable.
41  Using Arduino / Microcontrollers / Re: wake up on interrupt? on: December 11, 2012, 12:24:39 pm
Sure.  See chapter 9 of the data sheet, and
A while ago I posted some example sleep code which uses the watch-dog timer to wake up (,92840.msg744375.html#msg744375).  But the watch-dog isn't terribly accurate, so you'd probably want the "power-save" mode rather than the "power-down" mode.  This mode leaves the timers running, and a Timer2 overflow or output-compare event can wake the CPU -- see the TIMSK2 register description in the datasheet.
42  Using Arduino / Microcontrollers / Re: 6 pins next to the reset button ? on: December 11, 2012, 06:50:31 am
on a UNO ,what are these for ? another icsp connection or what ?
and a four holes with J2 what are they for ?
just curious

It sounds like you have an Uno R3.  The reset button was moved between the R2 and the R3.  The 6-pin header near the USB port is for ICSProgramming the ATmega16u2.  This chip has a bootloader, so it can also be programmed via the USB port.  The 4 holes marked J2 connect to various port pins on the 16u2, which can be useful if you ever want to do more than USB-to-serial conversion with this chip.  Some time ago I wrote some code which allows the 16u2 to work as an ICSP programmer, meaning you could update the Arduino bootloader without needing a second Arduino.  I used one of the J2 pins to switch the software between USB-to-serial mode and ISCP mode.
43  Using Arduino / Microcontrollers / Re: Quick Q about ATMega's? on: December 11, 2012, 02:09:16 am
On second thoughts this is not healthy if the ATmega is unpowered, as you'd be driving the outputs above VCC.  If the ATmega is powered but in stand-by it's OK.
44  Using Arduino / Microcontrollers / Re: Quick Q about ATMega's? on: December 11, 2012, 02:04:27 am
Is this the logic you're aiming for?


In this case the simplest thing to do would be to program the ATmega so that the "Lo" output is high-impedance (do this by setting the pin as an input and setting the state as LOW).  Then connect the battery-chip's output to the ATmega's output via a resistor, and connect the ATmega's output to the MOSFET gate.
45  Using Arduino / Microcontrollers / Re: how to burn the bootloader of an arduino pro mini ? on: December 11, 2012, 12:57:26 am
I'd suggest testing ICSP communication to the ProMini first.  Nick Gammon has (again) a suitable sketch and detailed instructions:

I don't remember the details of changing the binary in Nick's Atmega_Board_Programmer sketch, except that the code was very clear.

By the way, if your only goal is to reduce power consumption then take a look at the ATmega power-saving modes.  The microcontroller can be put to sleep for a set period of time, during which the power draw is just a few uA.  I wrote some example code which you can find here:,92840.msg744375.html#msg744375, and I'm also going to reference Nick Gammon yet again:  It could save you messing around with modified bootloaders.

Note that the ProMini's voltage regulator and power LED draw about 1mA.  In my low-power projects I disconnect these components by cutting a trace on the PCB as shown below.  You can un-do the cut later if needed, by connecting the two VCC pins together.

Pages: 1 2 [3] 4 5 ... 25