5

Novice mode, please.

I programmed my ATTiny84 using Arduino Ethernet (Arduino IDE 1.6.7) using https://github.com/damellis/attiny branch - 1 MHz internal oscillator mode. I uploaded ISP sketch to Arduino with all cables disconnected (first I did it with all of them connected but Arduino didn't seem to mind), connected the whole setup using 10 uF capacitor and the sketch got sent into ATTiny84 without problems.

Blink sketch is using atttiny84's digital pin 7 (that is physical leg No. 6) set to 1 s blink rate.

But, when I connect an yellow LED, it won't blink. I'm not yet good enough with my oscilloscope (don't know how to hook it up) but my multimeter is showing something weird - voltage is slowly rising on DP7 (I measured against ground) - over approx. 5-6 seconds to 400 mV, then immediately jumps to 1V (not sure about this, could be measurement bug) and then right to 0V.

Blink sketch:

int led = 7;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

I'm clueless. Please confer. Thank you.

Images of my setup: enter image description here

  • From the picture it appears the LED is connected with its cathode to VCC. It won't conduct in that way... – Dejvid_no1 Feb 7 '16 at 17:47
  • Test the LED without using the pin. That is, move the wire from the LED straight to Gnd or Vcc. Make sure the LED turns on and off. Then put a multimeter on the pin. Make sure that turns on and off. – Nick Gammon Feb 8 '16 at 4:21
  • Nick, I have connected the diode directly to chip's VCC to test out whether LED's circuit is ok. It glows immediately. When I connect it back to DP7, it does nothing, but there are these rises to 400 mV on that pin against ground. – summer.breeze Feb 8 '16 at 8:02
1

I solved my own problem. Wiring was completely OK, so was flashing.

The problem was RESET pin (4th physical pin). As soon as I disconnected it after flashing, LED started blinking. If someone knows why, I'd appreciate some info.

|improve this answer|||||
  • Did you measure the RESET signal before you removed it? Was it low, high or floating? This could help answer your question. My guess is that it was low and therefore the ATtiny did not start. – Mikael Patel Feb 8 '16 at 15:11
  • Just tried to measure it with my oscilloscope. It's 13.44 mV Mikael, so I guess that can be considered low? Can you briefly describe why this prevented the chip from starting it's program? Thank you. – summer.breeze Feb 8 '16 at 17:16
  • The MCU is reset by a low pulse on RESET. Holding it low will generate an internal reset but the MCU is not started until RESET goes high again. Please see atmel.com/images/doc8006.pdf, chap. 8.2.2, pp. 41. – Mikael Patel Feb 8 '16 at 19:00
  • Thanks Mikael. Good information, surely will help many people. – summer.breeze Feb 8 '16 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.