I am using ATTiny 85 for my project and it has only 5 pins. I need one more input pin and was thinking of using the latch pin connected to shift registor as input.
If there is no activity on data pin and clock pin, changing latch pin shouldn't do anything. Will changing the latch pin to input interrupt pin work. This way I can sense if a button has been pressed and do the required action. Will applying positive voltage to the output of the shift registors do any damage. I tried reading the data sheet but I am relatively new to electronics and don't know what will happen.
Will applying positive voltage to the output of the shift registors do any damage. I tried reading the data sheet but I am relatively new to electronics and don't know what will happen.
Bang!
Well maybe fizz.
I can't see what you mean you need a schematic of what you propose but I must say it does not sound very promising.
If the shift register is a 2-stage, then additional wiggling of latch (RCLK on 74HC595) after data has been shifted in via SerIn and SRCLK will not show any output change after the initial rising edge.
If the pin is used as a simple input with pullup resistor, then the Attiny85 can toggle the pin high/low for the latch signal, then go back to input mode to catch the button pulling the input low. As long as the button is not pressed during the brief time when the Attiny85 goes to output mode for the latch signal, nothing will be hurt.
You can always change the fuse settings to use the reset pin as another I/O but understand you will loose the ability to use the chips ICSP and will need a high voltage programmer like this to reset the fuses to allow program changes to be uploaded.
Here is a schematic of what I am doing. There is a internal pull up register in the ATTiny. I would use the latch pin for a breif amount of time to set the state of shift registor then change it to interrupt pin for rest of the time. My idea is to trigger the interrupt function for when the button is pressed and if it is pressed for more than 4 seconds, the ATTiny should go to sleep.
This is my first project using ATTiny and interrupts so i might need to do a lot of reprogramming. So I dont want to use the reset button. That would be my last option.
@CrossRoads
I will try to do this and see what happens. Or I might need to get ATTiny 84. This will be a great learning experience.
There is a internal pull up register in the ATTiny.
I think you mean resistor not register.
That circuit is a bad idea. I think you are assuming that if there is nothing connected to an input it looks like there is a logic zero on it. This is not the case you have a floating input that just reads anything based on interference pick up.
Therefore your switch to +5V will not work like you think.
Also if the switch is made and pin 6 is set to an output and has 0 on that output you will blow the pin.
Much better to put a switch to ground through a 510R resistor, at least that will pull it down and be protected against pin 6 being an output.
Half a schematic! We can't see what pins 2 & 3 of the attiny and pin q0 of the '595 are connected to. Maybe if we could see it all we could suggest another way to achieve it.
I seems you have given over 3 pins of the attiny to drive the '595, but only used 4 of its outputs, so you only gained one output overall.
Your 3 leds: would only one of the 3 be on at once? Also you don't seem to have any series resistors.
Can't even see the image properly for a number of reasons. You seem to have lodged it on some utter garbage "image hosting" site which obfuscates it - my security system prevents it being displayed.
You need to re-size it to 1025 by 768 at maximum, and use the "additional options" when you "modify" your post to load the actual image here.
Paul__B:
Can't even see the image properly for a number of reasons. You seem to have lodged it on some utter garbage "image hosting" site which obfuscates it - my security system prevents it being displayed.
I though the OP had forgotten to post the schematic as nothing show up for me either.
Riva:
I though the OP had forgotten to post the schematic as nothing show up for me either.
The oversize graphic shows up under some conditions, but is obfuscated by some dreadful "If you won't look at my advertising and accept my spyware then I am not going to show you, nyaa, nyaa!" scripting.
The plague of the Internet - "free" hosting. You know what they say about free lunches.