What not to do...

215 views
Skip to first unread message

Dave Boulton

unread,
Jan 12, 2013, 3:54:22 PM1/12/13
to minio...@googlegroups.com
Don't try this at home folks!

I wanted to read temperature and humidity from a basic DHT11 sensor. No big deal then.

I also want a battery version of this to sleep for a while ("while" to be defined) to maximise battery life.

Stupidly, I added code to loop() to put the processor to sleep. I'm used to the 328, not the 32u4. Going to sleep causes the USB to drop out which means if there's a problem in your code then you can't really get back from this with the Arduino IDE.

No big deal, I've already wiped flash using one of Nick Gammon's programs and just need to re-load the bootloader. After doing this, I realised if I'd just read a pin to make the experimental sleepstuff conditional and used a pull up/down resistor then a simple reset and changing the resistor config could have prevented all of this grief. It's probably obvious to most of you but I wish I'd thought of it earlier.

Looking on the bright side, this is stuff I obviously need to learn...

Dave

Baruch Even

unread,
Jan 12, 2013, 4:28:22 PM1/12/13
to minio...@googlegroups.com
Good to know!

Isn't there a wait already at startup to allow reprogramming? I seem to have seen something like that in the bootloader code.

Baruch



Dave

--
You received this message because you are subscribed to the Google Groups "MinionCity" group.
To unsubscribe from this group, send email to minioncity+...@googlegroups.com.
Visit this group at http://groups.google.com/group/minioncity?hl=en.
 
 

gpcra...@volksdata.com

unread,
Jan 12, 2013, 7:11:57 PM1/12/13
to minio...@googlegroups.com
Dave,

I'd be very interested to hear what the steps are for wiping the flash and then re-loading the bootloader...  I have a Minion which is an unhappy state.  I'm reasonably certain that it's electrically sound (i.e. I didn't fry any of the components...) and it'd be interesting to see if wiping if clean and re-loading the bootloader could get it back to square one.

-gpc

Tamsyn Michael

unread,
Jan 13, 2013, 12:23:47 AM1/13/13
to minio...@googlegroups.com

Yeah, got the same issue.  A step by step for that'd be great!

--

Dave Boulton

unread,
Jan 13, 2013, 5:30:29 PM1/13/13
to minio...@googlegroups.com
I've written up what I did here: http://www.electrickery.org.uk/?p=89

Not sure if I could have achieved this using "Arduino as ISP", or not. This method requires an Arduino and SD card breakout. I happened to have those "lying around" so...

Still got one issue to solve - the "problem" minion is fine, up until I start the Arduino IDE, at which point it has some weird USB issue and the OS shuts the port down. Got something definite to check on that (a fuse got changed, I think) so will check now and report back.

Dave

Dave Boulton

unread,
Jan 13, 2013, 5:54:15 PM1/13/13
to minio...@googlegroups.com
Well, tried that. No joy. It runs the sketch that was programmed into the hex file that I uploaded to it, all is fine until I try to upload a new sketch. Then the USB drops out with the "connect-debounce" message. Need to look into fuses some more I think. Getting late here and got to work tomorrow so it might be a while before I get back to this.

Dave

Dave Boulton

unread,
Jan 14, 2013, 4:48:36 PM1/14/13
to minio...@googlegroups.com
Had another go at this tonight with an "Arduino as ISP". Nothing useful, results very intermittent. Tried the Nick Gammon stuff also with very intermittent results. I'm sure all that stuff works, must be something wrong with what I'm doing. Will try to repeat with different cables and maybe on a breadboard when I get the time.

Dave

Dave Boulton

unread,
Jan 20, 2013, 6:47:41 AM1/20/13
to minio...@googlegroups.com
And finally...

Bought an Adafruit USBtiny programmer and was able to set the hfuse value back to 0xD8. This has completely cured the issue of the USB port dropping out when the Arduino IDE started and the chip is fully functioning again.

To summarise, after ineptly locking up the chip I:
  1. Erased flash
  2. Copied a bootloader from a working minion and saved to SD card
  3. Flashed the bootloader onto the "broken" card (which changed hfuse from 0xD8 to 0xD9)
  4. Reset hfuse to 0xD8 using a USBtiny and avrdude from the command line
Dave

Dave Boulton

unread,
Feb 26, 2013, 4:12:46 PM2/26/13
to minio...@googlegroups.com
Ignore all of this. The problem is back with a vengeance. Not really sure what's going on but all 4 minions are, more or less, unusable. I can appear to program them with a tinyUSB and they seem happy. As soon as I fire up the Arduino IDE they get reset and hit the "debounce" issue again. If anybody has any ideas I would love to hear them. 

If I try to program them from the IDE they immediately hit the "debounce" problem and the green LED flashes like crazy. That's the "stable" IDE and the new 1.5.something one as well. 

If someone could post their fuse settings that would at least let me rule that out, or whatever...

Dave

Dave Boulton

unread,
Feb 27, 2013, 4:12:36 PM2/27/13
to minio...@googlegroups.com
Ok, the Google hive-mind led me to a post which suggested I could just modify my BIOS settings to not have "legacy" USB support. Seems to be a linux issue - in terms of linux not being bothered to fix somebody else's problem. All working again now. Hmmm... 

Glory Vandesteene

unread,
Jun 23, 2014, 2:25:27 PM6/23/14
to minio...@googlegroups.com
sleep causes


bebivono.pdf
riryraky.pdf
talywawi.pdf
tewupaxe.pdf
vugafuhi.pdf
wonysity.pdf
xusopebo.pdf
cocowyda.pdf
fogesesu.pdf
holutulo.pdf
kykukyce.pdf
memubase.pdf
negetiri.pdf
pucadiko.pdf
pyfaluru.pdf
Reply all
Reply to author
Forward
0 new messages