Problem with power on an Attiny85 based test - Page 1
Forum section: electronics / general

author: FlevasGR
author_rank: Regular Contributor
timestamp: April 17, 2015, 02:45:59 pm
content: Hello, was was working on a test with an Attiny85 and an HC595N shift register just to see how a shift register works and how to use the arduino as ISP.The circuit is pretty simple and almost works.What is the problem then?When im powering the circuit through the arduino (Using the +5V and the GND) everything works absolutely perfect. However when im trying to power everything from an external power supply i've made using an L7805 voltage regulator the Attiny is running a loop and then stops working untill i reconnect it. I have no idea why is the happening.Things i've checked1) From the Atmel's datasheet the operating voltage of the Attiny85 is2.7 - 5.5Vand im giving4.94V2) The power supply is working perfectly3) The Arduino is giving4.74V4) Nothing is shortedHere are few images from the circuit:And in case you wanna see the code:Code:int DS_pin = 3;int STCP_pin = 4;int SHCP_pin = 1;void setup(){pinMode(DS_pin, OUTPUT);pinMode(STCP_pin, OUTPUT);pinMode(SHCP_pin, OUTPUT);writeReg();}/** Each register has 8 output pins. Add 8 for each register which is connected in series*/boolean registers;void writeReg(){/** Writing LOW on the STCP pin allows us to send data to the IC*/digitalWrite(STCP_pin, LOW);/** Loop through the array and send the value*/for (int i = 7; i >= 0; i--){digitalWrite(SHCP_pin, LOW);digitalWrite(DS_pin, registers);digitalWrite(SHCP_pin, HIGH);}digitalWrite(STCP_pin, HIGH);}void loop(){for (int i = 0; i < 8; i++){registers = HIGH;delay(100);writeReg();}for (int i = 7; i > 0; i--){registers = LOW;delay(100);writeReg();}}What is going wrong with my curcuit?EDIT: The curcuit just turns on the leds with a specific style. Its not anything fancy

author: matseng
author_rank: Frequent Contributor
timestamp: April 17, 2015, 03:03:18 pm
content: Are you sure that your homebuilt powersupply is giving out a clean 5 volt? It might oscillate and that would fsck up the Tiny.Do you have a like 10uF close the input pin and a 0.1uF close to the output pin? Also put a 0.1uF across vcc/gnd on your Tiny and see if that will help.

author: FlevasGR
author_rank: Regular Contributor
timestamp: April 17, 2015, 03:30:16 pm
content: Quote from: matseng on April 17, 2015, 03:03:18 pmThe power supply is having 3 caps. One 10uF, 1uF and 0.1uF. Do i need to change anything?

author: matseng
author_rank: Frequent Contributor
timestamp: April 17, 2015, 03:47:22 pm
content: How are they connected to the 7805?

author: firewalker
author_rank: Super Contributor
timestamp: April 17, 2015, 03:53:19 pm
content: And what powers the 7805?Alexander.

author: Brutte
author_rank: Frequent Contributor
timestamp: April 17, 2015, 04:05:40 pm
content: Cannot see MCUSR.

author: FlevasGR
author_rank: Regular Contributor
timestamp: April 17, 2015, 04:07:26 pm
content: I'm using a 12v 1A wall adaptor to power everything up

author: RoboTechEd
author_rank: Regular Contributor
timestamp: April 17, 2015, 04:33:29 pm
content: Quote from: matseng on April 17, 2015, 03:03:18 pmI would assume that a 78XX voltage reg wouldn't oscillate enough to cause the issues Flevas is having?Flevas, have you tried any additional power supplies, or do you have a scope handy to see the output?

author: FlevasGR
author_rank: Regular Contributor
timestamp: April 17, 2015, 08:31:02 pm
content: Quote from: RoboTechEd on April 17, 2015, 04:33:29 pmHmm i dont have a scope but i tried a TPLINK-branded 9v adaptor on the very popular ebay breadboard power supply and it works. I also tried to power my power supply with this adaptor and it worked! So basicaly the problem was the 12v adaptor.

author: matseng
author_rank: Frequent Contributor
timestamp: April 18, 2015, 01:12:58 am
content: Ok, so now try the eBay vreg-board together with the 12v supply? If that works your 7805 design is the culprit.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: April 18, 2015, 08:26:16 pm
content: Quote from: FlevasGR on April 17, 2015, 08:31:02 pmSo your 5V regulator is working with another adapter? What voltage is the regulator now putting out? If it is higher than 4.94V then that suggests the 12V adapter has inadequate filtering, causing the output voltage to dip below 5V at the end of each mains cycle (a scope would show this more clearly).You should also put a 0.1uF across the ATtiny's vcc/gnd, asmatsengsuggested. This suppresses voltages spikes caused by fast current changes in the power supply leads. Without a bypass capacitor close to the chip you could get intermittent malfunctions which are sensitive to the length and positioning of the power supply leads.