Author Topic: LED stops flashing after removing programmer  (Read 7366 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
LED stops flashing after removing programmer
« on: December 04, 2012, 01:45:15 pm »
I am venturing into the AVR world, after much effort I got a led to flash, so long as the AVRISP2 remains connected (just powered, does not need any PC program running)

What the blinking hell happened ?
 

Offline dr_p

  • Frequent Contributor
  • **
  • Posts: 309
  • Country: ro
Re: LED stops flashing after removing programmer
« Reply #1 on: December 04, 2012, 01:53:45 pm »
I don't know AVRs but look into the reset pin and how it works. My PIC used to do that.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #2 on: December 04, 2012, 01:57:47 pm »
The reset is pulled high with a 10K resistor
 

Offline dr_p

  • Frequent Contributor
  • **
  • Posts: 309
  • Country: ro
Re: LED stops flashing after removing programmer
« Reply #3 on: December 04, 2012, 02:23:46 pm »
You do have external power, right? :D
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #4 on: December 04, 2012, 02:36:59 pm »
yes,

Could it be fuse settings ? maybe the programmer is providing the clock or something ? or I'm in some sort of debug mode ?
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
Re: LED stops flashing after removing programmer
« Reply #5 on: December 04, 2012, 04:19:05 pm »
It could be the clock that is not running. Check fuse settings
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #6 on: December 04, 2012, 04:32:11 pm »
So the programmer is providing the clock ? this is an atmega48
 

Offline madworm

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: LED stops flashing after removing programmer
« Reply #7 on: December 04, 2012, 04:45:32 pm »
There is _no_ system clock provided via the ISP header.

Make sure the FUSE settings are right (brown-out-reset, clock-source etc.), don't forget decoupling caps.

http://www.engbedded.com/fusecalc
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #8 on: December 04, 2012, 06:07:33 pm »
But oddly the led flashed as directed with the programmer powered as soon as it is unplugged or powered off the led stops, could it be that the watchdog does not work when the programmer is plugged in allowing the program to keep running, but then dose,'t the chip reset on the whatch dog timeout meaning that it would hardly affect a "flasher"
 

Offline hlavac

  • Frequent Contributor
  • **
  • Posts: 536
  • Country: cz
Re: LED stops flashing after removing programmer
« Reply #9 on: December 04, 2012, 06:32:44 pm »
Common causes of simple led flashers not working:

- power supply pins not connected (duh! will still run with at least one input high and one low: other circuitry powering it thru protection diodes)
- floating reset pin
- watchdog enabled but not cleared periodically (some bootloaders like the USB DFU in atmega32u4 use watchdog to reset the device, it needs to be disabled in init code even that it is disabled in fuses )
- too low supply voltage & brownout reset enabled
- led pin not set for output properly
- some peripheral overriding the gpio functionality od the pin (like comparator output on some pics)
- floating input pin for button & software loop waiting for it to be released (internal pullup not enabled)

Good enough is the enemy of the best.
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 796
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: LED stops flashing after removing programmer
« Reply #10 on: December 04, 2012, 06:43:30 pm »
I suggest you do a 'sanity check' by probing round all the pins with your scope. That will answer a lot of guesses like reset line level, power and ground, oscillator running etc.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #11 on: December 04, 2012, 07:41:43 pm »
good idea, but to clarify, this DOES flash the led with the programmer connected, it stops when the programmer is removed, so it's not something like loss of power etc. The circuit is powered.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #12 on: December 04, 2012, 07:46:21 pm »
just removed the programmer wires one by one and now it keeps flashing ! removed power, shorted power leads on chip (discharging the by pass cap) put power back and now it DOES work, what was that all about ? why does the chip need "weaning" off the programmer ?
 

Offline madworm

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: de
Re: LED stops flashing after removing programmer
« Reply #13 on: December 04, 2012, 08:26:16 pm »
Normally it doesn't.

Is this on a breadboard?

The only occurrence of erratic hardware-based (resets) AVR behaviour I've observed so far was caused by a broken brown-out module - a bad chip. Under normal conditions a floating reset pin shouldn't be an issue (internal pull-up), but who knows what environment you're in.
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: LED stops flashing after removing programmer
« Reply #14 on: December 04, 2012, 09:17:09 pm »
Is there a voltage regulator on the board?  I had similar troubles once when the DC input voltage to the regulator was marginal.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #15 on: December 04, 2012, 10:22:33 pm »
nope running it off a 5 Volt mains adapter
 

Offline TriodeTiger

  • Regular Contributor
  • *
  • Posts: 199
  • Country: ca
Re: LED stops flashing after removing programmer
« Reply #16 on: December 04, 2012, 11:04:11 pm »
nope running it off a 5 Volt mains adapter

Erm, you sure it's 5V regulated and won't jump around? Maybe the programmer provides a cleaner source from the USB, jumping to wallwart takes a sec to regulate and cuts out...schematic would help...
« Last Edit: December 05, 2012, 12:27:46 am by TriodeTiger »
"Yes, I have deliberately traded off robustness for the sake of having knobs." - Dave Jones.
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 10227
  • Country: nz
Re: LED stops flashing after removing programmer
« Reply #17 on: December 04, 2012, 11:08:50 pm »
This thread needs a pic of the circuit
« Last Edit: December 04, 2012, 11:13:20 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #18 on: December 05, 2012, 07:03:05 am »
well it is still working, turned it off last night and back on this morning and it works fine. Maybe the problem was diconecting the programmer from usb while it remained connected to the AVR ?
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: gb
    • Circuitology - Electronics Assembly
Re: LED stops flashing after removing programmer
« Reply #19 on: December 05, 2012, 09:37:37 am »
well it is still working, turned it off last night and back on this morning and it works fine. Maybe the problem was diconecting the programmer from usb while it remained connected to the AVR ?

Could very possibly be. You can't really rely on those sort of things that are 'off' to be in any state you expect them to be in.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #20 on: December 05, 2012, 12:34:39 pm »
Of course, maybe the programmer was holding the chip in reset
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: LED stops flashing after removing programmer
« Reply #21 on: December 05, 2012, 01:05:23 pm »
I didn't see a mention of what processor specifically you are using. Anyway, The AVRISP uses the 6 pin ISP interface and specifically the reset signal to connect to several types of AVR processor. For some more modern chips the reset pin is the actual data line for single wire debugging. If you power the AVRISP down but keep it connected it is very possible that the reset line is pulled low, preventing the processor from starting at all.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 796
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: LED stops flashing after removing programmer
« Reply #22 on: December 05, 2012, 01:28:58 pm »
As I mentioned earlier, a quick scope probe round all the pins would remove some of the mystery.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: LED stops flashing after removing programmer
« Reply #23 on: December 05, 2012, 01:56:29 pm »
Yes sure, but if we think specifically why disconnecting the programmer allows the chip to function, this is the likely reason as far as i understand.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18034
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: LED stops flashing after removing programmer
« Reply #24 on: December 05, 2012, 02:11:06 pm »
ATmega48
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf