Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   EDU Demo Code: Real-Time Clock Using a Timer (http://www.chiefdelphi.com/forums/showthread.php?t=23102)

Kevin Watson 14-12-2003 16:55

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 17-12-2003 15:14

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


All times are GMT -5. The time now is 00:31.

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