Author Topic: Wrist watch project... Micronucleus bootloader question.  (Read 914 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris3DTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Wrist watch project... Micronucleus bootloader question.
« on: January 23, 2019, 12:09:24 am »
Hi all,

Just thought I'd share this project and see if anyone could answer a bit of a technical question.

I'm making a wrist watch for my son (he's 9 years old).  It displays the time in two rings of LEDs, 12 each for the hours and minutes.  It rounds the minutes to the nearest 5 minutes because who really needs to know the time any more accurately than that... not my son at least! 

Here's a video of it so far: 

I'm pretty much down to just finishing up the code and then designing and milling a housing from aluminum.   So, on to the question...

I wanted to keep the component count as low as possible so I could make the board as small as possible, so only one button, no external crystal on the Tiny841, no level shifting between components running at different voltages.  Everything is powered from the lipo cell, soldered directly to the board.  One everything is powered down/put in sleep mode between button presses, the board only draws .02 mAh, so it'll run for months between charges when not being used.  The 5v from the USB only goes to the lipo charger IC. 

In a bit of an oversight, I discovered that with the Tiny841 powered full time from the battery, it doesn't reset when I unplug/plug in a USB cable... obvious in hindsight  |O.  So, that means the Micronucleus bootloader doesn't do the initial wait to accept programming.  Not a huge deal, I've just been grounding the reset pin side of a pullup with some tweezers when I need to program it, and once the code is finalized, there won't be a need to reprogram it often, if at all.  But... if I could reset it in code, that would be nice.

I've tried to use the watchdog timer to initiate a reset, but it appears it's either not working at all, or a watchdog reset doesn't reset to a point early enough in the boot process for the Micronucleus boot loader to do it's programming wait.  I read about reset vectors, but that's where it starts going over my head.

So does anyone know if a watchdog reset is the equivalent of cutting/returning power, and if not, are there any other ways to force a full reset in software?  Again, not a huge deal if not.  I'd love to hear any feedback on the project as well. 

Thanks in advance.
 

Offline Chris3DTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Re: Wrist watch project... Micronucleus bootloader question.
« Reply #1 on: January 24, 2019, 05:04:00 pm »
In case anyone else comes across the bootloader "issue" (not really an issue), the solution is in the configuration file when compiling the bootloader. 

There's a define:  #define ENTRYMODE which can be set to always, watchdog, external reset or jumper.  Setting it to always or watchdog and recompiling will cause the bootloader to enter programming mode on watchdog resets.  I was kindly pointed to the solution by Gerben on Stack Exchange.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf