Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help to make a programmable timer... 1

Status
Not open for further replies.

Marton79

Electrical
Oct 30, 2006
6
Basically, I'm bothering because I want to make a programmable timer...
Here is the figure:

The timer must have three buttons: Two of them add a different, programmable number of minutes to the count on each press. The third one resets the counter to 0. As long as the count is not 0, the output is 1.
It should have a 3 digit display to see the remaining minutes.
The number of minutes to add can be programmed with jumpers.

Do I need to use a pic to make this? I saw the 4510 is a nice candidate to do it, the problem is that the counter is not cumulative, it just resets to preset value...

Any ideas?

Thanks!!
 
Replies continue below

Recommended for you

To make the timing loops easy, in the mplab simulator,
use the stopwatch. It gives the time and instruction cycles.Its under the debug menu. The logic analyser
is cool too.

 
Hi Keith-

Yep. Well, I had a couple of extra pins on the pic that I didn't use, the crystal inputs. I didn't have a 4MHz rock sitting around. I think I even put traces on the board for the rock. I had it taped to the edge of my bookcase at a client's for awhile. It (and it's wall wart power supply is sitting in a box somewhere).

I just picked a little project to try out the cc5x without the pressure of having it perform.

It was/is kinda cute. You've seen them before I'm sure with each digit represented by 4 leds.

I just wanted to play with the compiler and see how it performs. And for free, it does quite well!

Anyway, the little geek clock uses the PIC, a 5V linear supply and 4 resistors, and two pushbuttons.

That's half the fun with the PICs. To see how little else in support hardware that you need to get the job done!

Oven controlled microcontroller. Hummmmmmm, I see a lot of melted plastic DIP packages in that future...... ;-)

I'm glad that Madcow mentioned the simulator and stopwatch. For "determining" the time value, I often times get lazy and just load up a value, fire it off and change the value until the time on the stopwatch says the time period that I want.

In fact most of the design could be simulated. At least the fussy stuff like the timer operations.

As to mailing it to Marton79. No, where's the fun in that? How can he learn to use microcontrollers without rolling up his shirt sleeves and getting his hands dirty! The timer is a great "starter" project.

And gee, guess what? I just finished a little low cost design that takes the serial "rs232" input and outputs it to one of the 4 digit 7 segment leds I was talking about earlier! It too only uses a small number of parts. With 5VDC input, it needs only 7 resistors, one transistor, and a bypass cap. AND the hardware will work with either common anode OR common cathode displays! I'm whomping up an article that I'd like to present to N&Vs.

Yep, it's fun to see how little extra stuff you need to get things done with a PIC.

Enjoy!

Cheers,

Rich S.
 
Wow!

From the app note:
"The Darlington is connected across the supply and initially draws 140 mA...
At about 90°C the current through Q4 appreciably increases and less drive is applied to Q1 and Q2. Power dissipation decreases to whatever is necessary to hold the chip at the stabilization temperature. In this manner, the chip temperature is regulated to better than 2°C for a 100°C temperature range."

"Temperature Stabilizer Power Dissipation(25°C) 300 mW."

Some serious heat being generated there.

As an aside, on the piclist today, a new (student?) engineer was wondering if his "oscillator block" should be running a "little warm".

Now, I've got some oven controlled crystal oscillators that draw 12W warm up and the spec sheet says that they say the continuous power is right around 2.7W...

So, I guess it's all relative.

Cheers,

Rich S.
 
Hey Rich,

Thanks again for the tips! Those about the displays are really useful because in fact it saves from doing a lot of wiring.
And that of partitioning the project in sections, program them one by one and then put them together is definitely the way to go.
I will see what I come up with...
I think I saw the first "issue to think about":
Instead of a "Start" button, I want there to be two buttons: X adds X minutes and Y adds Y minutes to the count whenever you press them so, will I be able to add minutes when the countdown is in progress? Because the PortB is used as inputs only when the counter is stopped... Or it is possible to do everything at the same time?

Regards,
Marton
 
You will be astonished at the complex behaviors you can get from a PIC with trivial changes in programming.

... some of them will be intentional. ;-)



Mike Halloran
Pembroke Pines, FL, USA
 
Hiya-

You can switch between "outputting digits" to reading the switches while the counter is running. There is nothing to prevent you from doing this. It's just a matter of programming. And as MikeHalloran states:

"... some of them will be intentional."

Just do little bits at a time and you will get there.

Cheers,

Rich S.
 
What you could do is to put a button commuting between two resistors in the RC network of the 555. One resistor would time 1 second or the interval you use as a base, and the other would time a shorter time in order for the clock to go forward faster.
 
The last time I used a 555 was to infer the position of a pot, for a uC (8741) that didn't have an analog input.





Mike Halloran
Pembroke Pines, FL, USA
 
Sorry, never caught the "ms" mistake... should have been "us", obviously.



Mike, programming beyond page boundaries without making the code aware is a great way to make small changes have big effects ;)

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Screwing up the PCLATH is one of my favourite ways to introduce a bug in PIC programs... what a wonderful machine it is... :eek:)
 
s'ok, I started a new position this week and my first project is with a high end ARM from Atmel. Talk about an odd architecture... one register to set bits, one to clear bits, and a third to read the status of those bits. EVERYTHING is set up like that! Never used an ARM before, not sure I would want to again if this is what they're like.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Dan,

I have been using the ARM architecture for years. The Philips LPC 2106. And I love it.

I had exactly the same reaction as you have. It takes a lot of "debriefing" and some serious studying to get a feeling for the architecture. But when you have that feeling, it is just as efficient (more so, I would say) as other architectures where you toggle or mask bits.





Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
You know those cool in-car video shots at NASCAR races, waterline shots at The America's Cup, or most of the on-the-green golf shots? We make the camera and RF transmission systems. I was hired on to help with the upgrade to high-def broadcasts. Cool projects, but I get most easily frustrated when trying to get a new architecture up and running. Once I have the basics up and running I'm golden and work typically progresses quickly, but I'm still in the "get it running" stage. Hopefully it won't last too much longer, I don't want to get too frustrated and go postal on the dev board ;) It seems I have the OS up and running (I see the idle task popping away), but can't get the USART to talk yet.


Dan - Owner
Footwell%20Animation%20Tiny.gif
 
BTDT, not with an ARM. I wonder if it has Intel-style USARTs, that like to be initialized _real_ _real_ _slow_, because the baud clock is used to carry the initialization codes in to the registers...



Mike Halloran
Pembroke Pines, FL, USA
 
Oh yuck!! I didn't know THAT was why they were so slow.. Actually makes sense though now that you've explained it.

OS? So you're running an RTOS huh.. Why isn't it covering the UART initialization?

Do you have the baud clock running or piped into the UART?

Do you have to clear some flag to start things moving?

BTW sounds like a fun project you're into.

Keith Cress
Flamin Systems, Inc.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor