|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 Last edited by Kevin Watson : 14-12-2003 at 17:00. Reason: Provide link to earlier message |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |