Go to Post The more rookies the better, they always think of the things that we dont - pakrat [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 28-01-2008, 16:55
joshyboy9987 joshyboy9987 is offline
Registered User
FRC #0706
 
Join Date: Jan 2008
Location: Hartland, WI
Posts: 16
joshyboy9987 is an unknown quantity at this point
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.
  #2   Spotlight this post!  
Unread 28-01-2008, 18:15
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Timers and MPLab

Quote:
Originally Posted by joshyboy9987 View Post
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.
It's relatively easy. Which version of the code are you using (Kevin's new code, or the 2007 default code)?

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.
  #3   Spotlight this post!  
Unread 28-01-2008, 18:19
joshyboy9987 joshyboy9987 is offline
Registered User
FRC #0706
 
Join Date: Jan 2008
Location: Hartland, WI
Posts: 16
joshyboy9987 is an unknown quantity at this point
Re: Timers and MPLab

Thanks a lot... I'll read through that stuff tonight and see what happens. We're using the default code.
  #4   Spotlight this post!  
Unread 03-02-2008, 16:01
TechnocratiK TechnocratiK is offline
Registered User
AKA: Patrick Diez
None #0296 (Northern Knights)
Team Role: Programmer
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 22
TechnocratiK is an unknown quantity at this point
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?
__________________
TechnocratiK out.
  #5   Spotlight this post!  
Unread 03-02-2008, 16:53
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Timers and MPLab

I'd stay away from TMR0. Its referenced from some routines in ifi_library.c (within the high priority interrupt).
  #6   Spotlight this post!  
Unread 04-02-2008, 10:04
TechnocratiK TechnocratiK is offline
Registered User
AKA: Patrick Diez
None #0296 (Northern Knights)
Team Role: Programmer
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 22
TechnocratiK is an unknown quantity at this point
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.
__________________
TechnocratiK out.
  #7   Spotlight this post!  
Unread 04-02-2008, 10:10
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,711
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #8   Spotlight this post!  
Unread 04-02-2008, 10:12
TechnocratiK TechnocratiK is offline
Registered User
AKA: Patrick Diez
None #0296 (Northern Knights)
Team Role: Programmer
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 22
TechnocratiK is an unknown quantity at this point
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.
__________________
TechnocratiK out.
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
A warning regarding MPLAB and find/replace Tom Line Programming 0 24-01-2008 17:35
Timers and Such Inverted Programming 5 19-02-2007 16:08
MPLAB Help, programming and compiling RedOctober Programming 2 23-12-2005 17:46
IFI Loader and MPLAB HolyOne207 Programming 5 14-01-2005 14:19
using the MPLAB IDE MPLAB SIM simulator WizardOfAz Programming 1 03-11-2003 01:24


All times are GMT -5. The time now is 09:38.

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