Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
minimatt
PostPosted: Jan 24, 2005 - 08:57 AM
Newbie


Joined: Dec 08, 2003
Posts: 16
Location: Hervey Bay

I have searched through a lot of projects here and other web pages looking for a place to start for this .... but I must confess, for the beginner it is very confusing as most projects of this nature are fo full blown clocks ..... What I want to do is create a simple stopwatch that would count up minutes on an LCD. It doesn't even have to do hours or seconds.... Just count up minutes to a max of 4 hours.

Am I right in thinking I need to use the internal timer in some sort of interrupt that would update a variable every minute and then print that to the LCD?

I want to work in BASCOM-AVR

Any help welcome Smile
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Jan 24, 2005 - 11:11 AM
10k+ Postman


Joined: Dec 30, 2004
Posts: 11862
Location: Melbourne,Australia

I'm not that familiar with BASCOM-AVR, but the general technique would be to use a timer and have it fire an interrupt at a regular interval. You then count these intervals to get your seconds/mins/hours etc. The timer probably can't be set to seconds so you would set it to say 100mS, so 10 ticks at 100mS = 1 second.

As for the specifics, I probably can't help you. You are on the right track, so do some reading and some experimentation and you'll find your solution.
 
 View user's profile Send private message  
Reply with quote Back to top
pykedgew
PostPosted: Jan 24, 2005 - 11:23 AM
Posting Freak


Joined: Jun 18, 2001
Posts: 1085
Location: Brisbane Queensland Australia

Hi

Am pretty sure if you look at the application section there is a clock or something similar.
Some how their web page have change & I can't get to it.

You know can use the Mcselec Forum & submit your question.
Join the BASCOM listserver : http://www.mcselec.bascom.htm

Regards
Ken
 
 View user's profile Send private message  
Reply with quote Back to top
pykedgew
PostPosted: Jan 24, 2005 - 11:33 AM
Posting Freak


Joined: Jun 18, 2001
Posts: 1085
Location: Brisbane Queensland Australia

Hi

They have chave their web page layout.
The applications section I was trying to refer to is
http://www.mcselec.com/applicat.htm
Just have a look at some of the applications there.
Maybe able to modify to your personal taste.

Regards
Ken

Regards
Ken
 
 View user's profile Send private message  
Reply with quote Back to top
Liam
PostPosted: Jan 25, 2005 - 08:04 AM
Rookie


Joined: Nov 20, 2002
Posts: 24


How accurate do you need it to be?

How about using the inbuilt Wait() function to count 60 seconds

Wait(60) or waitms(60000)
 
 View user's profile Send private message  
Reply with quote Back to top
minimatt
PostPosted: Jan 25, 2005 - 08:34 AM
Newbie


Joined: Dec 08, 2003
Posts: 16
Location: Hervey Bay

Well Liam, you hit the nail on the head .... Last night I decided screw it! .... I'll just use the wait function .... I left it on test for 10 hours after which it had lost about 10 seconds. The most I need to count is around 3 hours, which it does very well. All I did was define an integer and add to it each time through a loop... A loop that also checks a couple of inputs to see if it's time to exit the loop. All works well Smile
 
 View user's profile Send private message  
Reply with quote Back to top
Liam
PostPosted: Jan 28, 2005 - 11:40 AM
Rookie


Joined: Nov 20, 2002
Posts: 24


Good to hear
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits