![]() |
Timers and MPLab
So, this is my first year using MPLab instead of EasyC and I was wondering if there was a way to access a hardware timer at all. I know it can be done, cuz EasyC has a function to do it, but I couldn't find anything on the forums.
|
Re: Timers and MPLab
Quote:
The basics are in http://www.ifirobotics.com/docs/time...004-jan-14.pdf But basically you setup the timer, create an ISR that updates some timer variables, and a set of functions that let you read the timer values. |
Re: Timers and MPLab
Thanks a lot... I'll read through that stuff tonight and see what happens. We're using the default code.
|
Re: Timers and MPLab
Are all the timers on the PIC18F8520/8722 (TIMER0-4) available for our use, or are some reserved for use by the IFI code?
|
Re: Timers and MPLab
I'd stay away from TMR0. Its referenced from some routines in ifi_library.c (within the high priority interrupt).
|
Re: Timers and MPLab
I'm going to answer my own question here. In the IFI 2004 Programming Reference Guide, on page 28, it says that all timers are available to the user for programming, so hopefully that still applies to the 18F8722. I'll post again after some more testing (notably, when I have a chance to get the values of the TxCON registers during initialisation and runtime). Thanks for your input.
|
Re: Timers and MPLab
Be sure to use the ifi library FRC_alltimers.lib, rather than FRC_library.lib.
FRC_library.lib in the default code does use Timer 0, but not for any reason you'd probably care about. |
Re: Timers and MPLab
Huh... so that's what that's for. Thanks for the tip, that definitely removes all doubt about which timers to use.
|
| All times are GMT -5. The time now is 09:37. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi