Show Posts
Pages: [1]
1  Using Arduino / Microcontrollers / Re: When does UNO bootloader run? on: October 16, 2012, 09:21:22 pm
Interesting discovery....

I've just built my own DAPA programming cable and used it successfully with avrdude.

During that process (before running avrdude) I noticed that with the UNO board powered by battery (no USB connection) with the ISP connected via the DAPA cable to my computer's parallel port, the bootloader does NOT run on power up.  To double check I unplugged the ISP connector and cycled battery power.  The bootloader runs.  Plug the ISP cable back in and cycle battery power, the bootloader does not run.

avrdude functions properly with my ISP DAPA connection and when it's done, the sketch starts (again without bootloader running).

Please note, when I say bootloader not running I mean that it does not fall into the flash LED 3 times and into the loop waiting for serial data.  Instead it appears to jump into the sketch as the "quickboot" feature should.

My conclusion is that having the ISP connected via DAPA cable to my computer puts some different capacitance/load on the RESET line and somehow makes the "external RESET" assertion not occur.

Maybe an EE can confirm that possibility?

All-in-all, a curiosity..  Nothing troubling.

TheGipp
2  Using Arduino / Microcontrollers / Re: When does UNO bootloader run? on: October 10, 2012, 07:34:21 pm

Bill, my curiousity is mainly without any USB attached (no host computer).
I think Jim' experiment has confirmed my impression that the UNO (R3) cirucuitry is causing the "no-wait" to actually "wait". 
Thanks, Jim for the experimentation.
I think that was a clever trial and quite helpful.  Again, it's just a curiousity.  Not a problem.

I wonder if the Optiboot gurus are curious too.

Cheers to all who contributed to this discussion!

TheGipp
3  Using Arduino / Microcontrollers / Re: When does UNO bootloader run? on: October 10, 2012, 12:27:38 pm
I'm mostly curious about what everyone's experience and knowledge is on a non-USB power-up  -  using the DC jack.   In my case the bootloader runs and waits until watchdog time out.  However the optiboot source code looks like it is intended to quick start and bypass the waiting in the case of a power-on reset.  I understand the circuitry to signal an external reset from the USB port (for the purposes of programming) - that's very slick.

But, I don't see how the power-up via the DC jack is causing an EXTRF (external reset) which triggers the bootloader to wait.
4  Using Arduino / Microcontrollers / Re: When does UNO bootloader run? on: October 10, 2012, 08:39:33 am
Does it behave the same if you power it up by connecting via USB?

(In theory, the bootloader only runs when the reset status register identifies the reset cause as "external reset."  "Power-on reset" is supposed to be a separate cause, which should not cause the bootloader to run.)


Yes, either way (via external reset button or power-up via DC plug or power-up via USB) the boot loader runs.  And by "runs" I mean it flashes the LED 3 times and continues into the optiboot loop.  Not just hit the check for EXTRF and jump to appStart().   So, it's not performing as the optiboot source code implies.  It's not doing the "no-wait" on power-up.

Not that it's a big deal.  Just trying to understand what I have.  And I don't understand it yet.  Unless, there is some sort of UNO board circuitry that asserts an external reset on power-up.

Does anyone else see this behavior with a new UNO (R3)?

TheGipp
5  Using Arduino / Microcontrollers / Re: When does UNO bootloader run? on: October 09, 2012, 03:14:07 pm
It's an R3 board.  Just purchased from Jameco last week.
I've checked the bootloader by using avrdude to read the flash and verified the .hex against the current optiboot .hex file - all match.

My mystery is why it's "waiting" on power-up and going into boot mode rather than proceeding straight to the sketch.

I'm wondering if anyone else sees this behavior.  Powerup with DC plug and watch the UNO (R3) led and see if it flashes 3 times before your sketch runs.

Thanks for any help

TheGipp

6  Using Arduino / Microcontrollers / When does UNO bootloader run? on: October 09, 2012, 01:04:58 pm
Apologies for the cross-post.  This is probably a better place for my question.

When I have a sketch loaded in the UNO, the bootloader still appears to run when I powerup the UNO using the battery/external power connector (no USB).
I get the three flashes and then the sketch starts after about another half-second.
Is that supposed to happen?  Or better yet, how is that supposed to happen?
The optiboot source code indicates that the appStart() function is called directly in any reset case except for an external reset (EXTRF).   I understand that after the watchdog timeout, the watchdog reset will result in the bootloader being called again. But, this time the WDRF flag would be set rather than the EXTRF and optiboot would call appStart() right away.  That all makes sense.

But, why is it that on power up, optiboot still flashes the LED as if the bootloader has run, then sketch starts as expected?
I would expect (based on the optiboot source code) that on power-on reset, the bootloader would call appStart() right away and not flash the LED 3 times.

Is there something special about the UNO board that when the board powers up it causes an "external reset" instead of a power-on reset?
or
Is perhaps my reading of the source code incorrect?
TheGipp
7  Using Arduino / Interfacing w/ Software on the Computer / Re: Indication for bootloaded ATMEGA328PU on: October 08, 2012, 10:20:56 pm
I have a follow up question regarding the bootloader (optiboot) on the UNO.

When I have a sketch loaded, the bootloader still appears to run when I powerup the UNO using the b attery/external power connector (no USB).

Is that supposed to happen?  Or better yet, how is that supposed to happen?
The optiboot source code indicates that the appStart() function is called directly in any reset case except for an external reset (EXTRF).   I understand that after the watchdog timeout, the watchdog reset will result in the bootloader being called again. But, this time the WDRF flag would be set rather than the EXTRF and optiboot would call appStart() right away.

Why is it that on power up, optiboot still flashes the LED as if the bootloader has run, then sketch starts as expected?

I would expect (based on the optiboot source code) that on power-on reset, the bootloader would call appStart() right away and not flash the LED 3 times.

Is there something special about the UNO board that when the board powers up it causes an "external reset" instead of a power-on reset?

TheGipp
8  Using Arduino / Microcontrollers / Re: stock Arduino UNO configuration on: October 08, 2012, 07:03:28 pm
Many Thanks!
This confirms another thing :  "programmed" in the case of BOOTRST means the bit is 0 (as the datasheet is very clear) and it means the BOOTRST functionality is active when the bit is 0 - as opposed to 1 which is what I had casually thought was the active state.

Now it all makes sense to me how the stock UNO (R3) boots up and gets running.

Do you have any general advice on when to read an address as a WORD address as opposed to a byte address?  I find myself doubling addresses sometimes to see if things make sense.

TheGipp
9  Using Arduino / Microcontrollers / stock Arduino UNO configuration on: October 08, 2012, 01:45:45 pm
Hello,
I am very new to Arduino boards, IDE, and the AVR chips.
I've just recently acquired a UNO board (R3) and I am diving into the details of how it works.
I haven't seen the following written anywhere but I have preliminarily deduced the following about the R3 UNO board as it comes new:
- it has the optiboot bootloader
- the optiboot bootloader does not support all of the avrdude functions - in particular the fuse queries
- the BOOTRST option must be set to direct the RESET to 0x7E00 (3F00) location.  I deduce this because the 0x0000 RESET vector location in flash gets re-written every time a use the IDE to store a new program.

I don't think I can definitively know the above without having a separate programmer to read the MCU flash, etc with avrdude (e.g) since the stock bootloader does not support the query of the fuses.

Do I have all this correct?
Sorry if this is all answered somewhere else.   I'm overwhelmed with search results at the moment.


TheGipp
Pages: [1]