Go to Post You can learn a lot from making mistakes - even more from fixing them. - DarrinMunter [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-12-2003, 16:55
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
EDU Demo Code: Real-Time Clock Using a Timer

Using the template code I wrote earlier, I've written a demo application that displays the elapsed time to the console window. From the description in the code:

This demonstrates the use of a timer and associated interrupt. In this example we'll setup a timer to generate an interrupt every millisecond (= 1000Hz rate). In response to this interrupt, the microcontroller will execute a specific piece of code called an interrupt handler (see user_routines_fast.c). This interrupt handler will simply increment the global variables "msClock" and "Clock". High-level user code can then access these variables to create sophisticated state machines and highly accurate sequencers. We'll just keep the time.

The code can be found here.

Because I found MPLAB 6.3 so buggy, I updated to 6.4 (found here) which isn't compatible with the 6.3 project file format. Consequently, you'll need to update to 6.4 or create a new project with the project wizard if you want to re-build the code. Include all files in the .zip except ifi_library.lib. If that's too much hassle, I've also included the .hex file which IFI_Loader can use.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org

Last edited by Kevin Watson : 14-12-2003 at 17:00. Reason: Provide link to earlier message
  #2   Spotlight this post!  
Unread 17-12-2003, 15:14
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: EDU Demo Code: Real-Time Clock Using a Timer

I've updated the clock code to fix a minor timing accuracy bug. By request, I've created a version that includes tenths of seconds too. I've also converted the project files to version 6.30, making it compatible with the version of MPLAB that IFI distributes on the S/W tools CD. Enjoy. The files can be found here: http://kevin.org/frc.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Unnoficial Constitution - A Real Inspiration sanddrag Team Organization 6 19-09-2003 15:40
Actual execution time measurement Dan Technical Discussion 5 24-03-2003 11:36
Solution to Timing Loops Steven Carmain Programming 39 10-02-2003 13:33
How long should production time be??? archiver 1999 4 23-06-2002 23:16
real time chat SharkBite CD Forum Support 4 07-02-2002 21:22


All times are GMT -5. The time now is 19:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi