a timer that goes logic high or low every 15mins (hardware version)

Status
Not open for further replies.

panic mode

Joined Oct 10, 2011
5,007
on attiny85 anything but power pins can be used as I/O. but i have no idea what are you thinking of. your posts are rather incoherent. i have no idea what hardware you plan on using or what you meant in post 160 just to name some.
for example you mention attiny85... but... are you using ATTINY85 as an IC? or as module (DigiSpark etc.)? because you also mentioned you got some Arduino from eBay. that seem to be an ArduinoUno R3 - which is a great value and an excellent choice to start... but while R3 does use AT chip, it does not use ATTINY85.
 
Last edited:

Thread Starter

timtim1234

Joined Nov 30, 2023
246
on attiny85 anything but power pins can be used as I/O. but i have no idea what are you thinking of. your posts are rather incoherent. i have no ide what hardware you plan on using or what you meant in post 160 just to name some.
for example are you using ATTINY85 as an IC? or as DigiSpark? because you also mentioned you got some Arduino from eBay. that seem to be ArduinoUno R3 - which is an excellent choice to start... but while R3 does use AT chip, it does not use ATTINY85.
ohhh lol the one guy said it will program a ttiny85 ic that is why I bought it. i think i said in one of my posts i want to use a raw ic which is the ttiny85
 

panic mode

Joined Oct 10, 2011
5,007
you went back and forth on your choices several times. not really sure what is that you want or plan to do.

suggestion:
1. use that arduino to develop and test your code. make it work. for test, reduce initial time from 15min to 15 sec or so. play with it and make sure to know it....

2. once the above is done, prepare copy of that code for ATTINY and adapt the pin numbers as needed. note that pin numbers of the IC and GPIO as used in program written in arduino do not match. for example if you look at the code example in post 25, it is using Port pins (PB0 and PB1 are represented as "pins 0 and 1"). but on AT tiny those are actually pins 5 and 6. See this:
1722214344247.png
3. setup Arduino as a programmer for ATTINY. there are many tutorials. they usually go something like this: https://www.instructables.com/Program-an-ATtiny-with-Arduino/
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
you went back and forth on your choices several times. not really sure what is that you want or plan to do.

suggestion:
1. use that arduino to develop and test your code. make it work. for test, reduce initial time from 15min to 15 sec or so. play with it and make sure to know it....

2. once the above is done, prepare copy of that code for ATTINY and adapt the pin numbers as needed. note that pin numbers of the IC and GPIO as used in program written in arduino do not match. for example if you look at the code example in post 25, it is using Port pins (PB0 and PB1 are represented as "pins 0 and 1"). but on AT tiny those are actually pins 5 and 6. See this:
View attachment 328067
3. setup Arduino as a programmer for ATTINY. there are many tutorials. they usually go something like this: https://www.instructables.com/Program-an-ATtiny-with-Arduino/

yes i did but as i said in a post going to try to program ttiny85. if i can't get it to work then plan b is hardware version..lol

thanks for the links i was wondering how to hook that up to beable to program it!
 

BobTPH

Joined Jun 5, 2013
11,543
You started with rejecting the use of anything programable because you did not want to invest in necessary learning. OK that is valid. For such a simple task, a simple hardware solution would surely have been the quickest way to complete it.

Then, seeng the hardware required, you changed your mind. You now want a custom board with a microcontroller.

in order to learn to do this, you need to learn 3 different things:

1. Writing the code for it, and building the application.

2. Getting the code onto the chip.

3. Building the board and debugging the hardware and firmware.

Note that you cannot actually test anything until you have all three things in place. Then you are faced with debugging all of them at the same time. This is not ideal. Prepare for lots if frustration.

When I started with micros, I took a much more incremental approach. I bought a board (the PICKIT 1) which could program a socketed chip while also being capable of running the program and testing it with on board LEDs, a pushbutton and a potentiometer. I played with this alone for a month or two learning to program it.

Only then did I make my own board and start on my application. I programmed the chip on the PICKIT board, then moved it to my board for testing and final deployment. You will get tired if this pretty quickly. You would not believe how many times you will pull and install that chip. I broke pins off a couple of chips before I finished.

After that, I learned how to make a board that allowed you to program the chio in place. This is where you want to be if you learn micros. No more bent pins, and you can use SMT chips, which are quickly becoming the only reasonable option.

This is why people have proposed Arduino. It takes the place of the PICKIT, but also can take you all the way to the final board without having to build anything. It is, by far, the fastest and easiest path to the result you want.

Also, you seem to be relying on the forum to write your program for you. I think that is a very bad idea. You lose a big part of the advantage of micros if you cannot tweak or extend the program yourself.

So I say, build a 4060 + extra divider hardware (post #149) to do what you originally proposed. Then, if you want the additional functions you have added, think about how to program an Arduino at your leisure. Then use a small Arduino compatible board (nano?) to implement it. This allows you to complete the project by doing only step 1 above. Step 2 is done for you already and 3 is unnecessary.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
You started with rejecting the use of anything programable because you did not want to invest in necessary learning. OK that is valid. For such a simple task, a simple hardware solution would surely have been the quickest way to complete it.

Then, seeng the hardware required, you changed your mind. You now want a custom board with a microcontroller.

in order to learn to do this, you need to learn 3 different things:

1. Writing the code for it, and building the application.

2. Getting the code onto the chip.

3. Building the board and debugging the hardware and firmware.

Note that you cannot actually test anything until you have all three things in place. Then you are faced with debugging all of them at the same time. This is not ideal. Prepare for lots if frustration.

When I started with micros, I took a much more incremental approach. I bought a board (the PICKIT 1) which could program a socketed chip while also being capable of running the program and testing it with on board LEDs, a pushbutton and a potentiometer. I played with this alone for a month or two learning to program it.

Only then did I make my own board and start on my application. I programmed the chip on the PICKIT board, then moved it to my board for testing and final deployment. You will get tired if this pretty quickly. You would not believe how many times you will pull and install that chip. I broke pins off a couple of chips before I finished.

After that, I learned how to make a board that allowed you to program the chio in place. This is where you want to be if you learn micros. No more bent pins, and you can use SMT chips, which are quickly becoming the only reasonable option.

This is why people have proposed Arduino. It takes the place of the PICKIT, but also can take you all the way to the final board without having to build anything. It is, by far, the fastest and easiest path to the result you want.

Also, you seem to be relying on the forum to write your program for you. I think that is a very bad idea. You lose a big part of the advantage of micros if you cannot tweak or extend the program yourself.

So I say, build a 4060 + extra divider hardware (post #149) to do what you originally proposed. Then, if you want the additional functions you have added, think about how to program an Arduino at your leisure. Then use a small Arduino compatible board (nano?) to implement it. This allows you to complete the project by doing only step 1 above. Step 2 is done for you already, and 3 is unnecessary.
Yes, I was just looking for a hardware circuit at first. But with other bring up programming and posting code, I thought I would give that a try. I thought if I have to go through all this buying a programmer, etc I might as well add more function to the code most likely I will end up building hardware because I don't really want to wait 6 months or so for a working circuit hence why I want the code. I can learn to play with the code while I have a working circuit. If someone wants to post the code with the other function in it then great, if not, no big deal. I am old, and I don't really want to spend the remainder of my time learning code. But hey, it is what it is. And yes of course can't test anything without parts as I wait for my parts to get off the boat from China i will enjoy this cup of coffee, but thanks for pointing that out :)
 
Last edited:

panic mode

Joined Oct 10, 2011
5,007
...I can learn to play with the code...
...and I don't really want to spend the remainder of my time learning ....
for someone running out of time you ought to be better in making decisions.
i have never seen or heard of a bride having as hard time choosing a dress as you are trying to decide which type of circuit to use. if you were general, everyone in your command would die without ever firing a shot.

1722264160650.png
 
Last edited:

Thread Starter

timtim1234

Joined Nov 30, 2023
246
for someone running out of time you ought to be better in making decisions.
i have never seen or heard of a bride having as hard time choosing a dress as you are trying to decide which type of circuit to use. if you were general, everyone in your command would die without ever firing a shot.

View attachment 328091
LOL i think you missed my point but that ok :) as i said in another post my " decision " (as you call it) is plan b which is the schematic you posted. did you make a change to it? that why you are posting it?
 
Last edited:

Thread Starter

timtim1234

Joined Nov 30, 2023
246
After nearly 200 posts and dozens of ideas and proposals, I just hope to see the light at the end of tunnel ...

lol, you and me both! But look at the bright side we are having fun :) and people who read this thread are learning and getting ideas about circuits, programming, etc :)

But I do want to say a big thank you and to everyone for helping :)
 
I’ve tried to follow this thread since the beginning. I always try to say something nice or say nothing at all, so I’d like to credit the TS with responding to pretty much every post. There have been some interesting contributions and polarized opinions but all in all it is probably time to wait until the TS comes back to tell us all how things are going with the Attiny85 ?
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
I’ve tried to follow this thread since the beginning. I always try to say something nice or say nothing at all, so I’d like to credit the TS with responding to pretty much every post. There have been some interesting contributions and polarized opinions but all in all it is probably time to wait until the TS comes back to tell us all how things are going with the Attiny85 ?
yes i try to answer all of them but sometimes i miss them..lol ohh iam sure i will be back i doubt i will get the Attiny85 working right away..lol BUT i will start a new thread for that :)
 

atferrari

Joined Jan 6, 2004
5,012
All I learnt (by myself) about digital techniques was most of the time based on time diagrams.

1722285884889.png

When I started designing the most basic and later more complex things I created them for my own guidance. If the OP says that he cannot create one, nothing better as the way to learn and to get a solid solution. Words, just words, is not the way.
 

MisterBill2

Joined Jan 23, 2018
27,607
for someone running out of time you ought to be better in making decisions.
i have never seen or heard of a bride having as hard time choosing a dress as you are trying to decide which type of circuit to use. if you were general, everyone in your command would die without ever firing a shot.

View attachment 328091
With one more CD4040 IC it could use a much higher frequency crystal, It would connect between Ic1 and IC2. bit of binary selection might be required.
 

MisterBill2

Joined Jan 23, 2018
27,607
would there be any benefit? i mean 32k crystal is cheap, small and easy to find. one less IC means less space and things that can go wrong.
The only benefit would be availability. For me, higher frequency crystals are available from all sorts of electronic scrap. Your situation may be different.
 

LesJones

Joined Jan 8, 2017
4,511
I was thinking of modifying some code that I have written for another application that runs on an ATtiny13 but I don't remember a good answer to the question of the requited accuracy of the 15 minutes and the 1 second time periods. It could easily be modified to run on an ATtiny85. I was thinking that it was required to start at the same time each day quite a small error in the 15 minute period would cause a drift in the starting time over a period of several years. (I am only guessing that this is the sort of application the device will be used for as it has not been fully specified. )

Les.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Sorry I've not responded sooner, been a little busy with other things. Anyway, here is the circuit I came up with. Nothing revolutionary, flip flop U3A produces the 1 second output pulse, once every 15 minutes, positive or negative going depending on whether Q or /Q is used. Timing was using an electrolytic capacitor, so R5 could need adjusting to get it spot on! U3B produces the 15 minute high/low cycle.
To test, just fitting the diode to Q4 gives a complete cycle every 8 seconds.
The reset switch is High to reset, could be a momentary or toggle, or a fairly high current logic pulse (due to R4 needing to pull up against possibly up to 4 low outputs of the CD4020.

View attachment 327951

EDIT: Image edited for incorrect wire.
is it possible to have it be adjustable 1-15mins? thanks
 
Last edited:

sarahMCML

Joined May 11, 2019
698
is it possible to have it be adjustable 1-15mins? thanks
It is, all you have to do is work out the binary code for the minute you need, and put in the relevant diodes at the Q outputs. So you need a count of 60 for every minute that you wish to time. Unfortunately, some times aren't available with the current circuit because the CD4020 doesn't have the Q2 & Q3 outputs. However, by substituting the CD4040 this can be remedied. I would have used this, but didn't have one in stock!
For example, for a 1 minute timer, you would need Q6, Q5, Q4 & Q3 (32+16+8+4=60)

It gets complex very quickly though because you need a different set of diodes for each minute, although it could be decoded with a ROM or something similar. I only designed this for the original request of a 15 minute time with a 1 second output pulse. For something such as this a micro would be the simplest answer!
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
It is, all you have to do is work out the binary code for the minute you need, and put in the relevant diodes at the Q outputs. So you need a count of 60 for every minute that you wish to time. Unfortunately, some times aren't available with the current circuit because the CD4020 doesn't have the Q2 & Q3 outputs. However, by substituting the CD4040 this can be remedied. I would have used this, but didn't have one in stock!
For example, for a 1 minute timer, you would need Q6, Q5, Q4 & Q3 (32+16+8+4=60)

It gets complex very quickly though because you need a different set of diodes for each minute, although it could be decoded with a ROM or something similar. I only designed this for the original request of a 15 minute time with a 1 second output pulse. For something such as this a micro would be the simplest answer!
Ahh, ok I think I see what you are saying, so with that being said when doing the removal of diodes what times would be available?

thanks
 
Status
Not open for further replies.
Top