View Single Post
  #1   Spotlight this post!  
Unread 29-12-2007, 22:23
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by sumadin View Post
Kevin,

I noticed this file does not include any encoder-related files. Are you planning to add support to encoders to this code?

Thanks.
It should be pretty easy to write your own encoder code with this architecture's method of handling interrupts. It would only take a few if statements and a couple of very short functions to read from a quadrature encoder. Much of the trouble with writing encoder code is configuring interrupts, and Kevin has already done that here.

You could basically copy and paste the code from the encoder driver's ISRs into the ISRs in this version (or put them in another file and call them from the ISRs, which would probably be more readable) and add the Get_Encoder_x_Count() function. Actually, if you just didn't call the initialization functions, you could probably use the current encoder code verbatim (well, for encoders one and two anyway, for 3-6 you'd probably just want to reuse the code from encoder 1-2 instead of the encoder driver's functions for encoders 3-6). I would say that it would probably be less than 20mins to code.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain

Last edited by lukevanoort : 29-12-2007 at 22:33. Reason: elaboration