Go to Post ... poets, novelists, songwriters, these people are word engineers. - MissInformation [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 30-03-2004, 11:57
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Offloading intterupts to a counter

10kHz is pushing it if each count causes an interrupt - if the internal counters are on an I/O pin then it can count at 10Mhz with a 40MHz clock on the uP

terminal count is when you preload the counter everytime it overflows - so with an 8 bit counter you can have it overflow everytime it counts to 1, or to 256 and everything in between, depending on what you set it up to preload with.
  #2   Spotlight this post!  
Unread 30-03-2004, 13:58
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: Offloading intterupts to a counter

I just spent some time looking at data sheet on the 18fxx20 chip that the RC uses. There are 5 counters that i think i can use (as long as their inputs are in fact one of the digital inputs, i think im gonna need to ask IFI about this) there are 3 that can be used as 16 bit and 2 that can only go up to 8 bit. Because i don't see anyway of counting down, the only option is two have two counter's per wheel and use an encoder enterpreter chip that can output two streams, one for up clicks and one for down clicks. This means that at best, i can have one encoder on two 16 bit counters, one on two 8 bit counters, and the other two on interrupts. I think this maybe pointless anyway because the interrupt digital I/O pins and the counter pins are most likely the same (again, i have to ask IFI).
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #3   Spotlight this post!  
Unread 30-03-2004, 15:17
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
specific chips...

I want to say right away that I am not a EE (though I sometimes play one on TV ;-).

If you want specific chips, I have found the following from Digi-key. I believe they will work, but it is possible you may need an inverter here or a NOR gate there to get things to work exactly as you want.

As to the 8 bit up/down counter:
SN74ALS867ADW


http://focus.ti.com/lit/ds/sdas115c/sdas115c.pdf

As to an 8 bit parallel load shift register:
74F676

http://www.fairchildsemi.com/ds/74/74F676.pdf

You can have the clock for the counter be driven by one channel of the encoder, the other channel of the encoder is tied to the up/dn pin of the counter.

The CPU drives the "parallel load" mode of the shift register and then shift in the bits to the its input pins.

You can daisy chain the 676's to have the data look like one long register.

You can also cascade the counters if you need to have more counts than an 8 bit number can hold.

Alternatively, you can also reset the counters after you read them so that you can just accumulate the total count inside your CPU. You run the risk potential of missing a count when you reset the counters if you are not careful, but depending on your application, this may or may not be a big deal. With some clever circuitry and/or software you can avoid this problem but this is more than I want to get into here.


I don't know if this helps, but it should be a good start.

Joe J.

P.S. I have used the 676 before so I can vouch for it with first hand knowledge. However, I have not used the 867 before -- I have always had some other 4 bit counters hanging around the office that I could cascaded into whatever size counter I needed. From what you are talking about, I suppose you will need more than 8 bits perhaps 16 bits. This gets tedious with 4 bit counters so I suggested an 8 bit version. Looking at the data sheets though I am pretty sure that it will work out for your application -- perhaps others have favorites they are used to using that they can vouch for from personal experience.

Last edited by Joe Johnson : 30-03-2004 at 15:42.
  #4   Spotlight this post!  
Unread 30-03-2004, 21:07
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: specific chips...

Quote:
Originally Posted by Joe Johnson
I want to say right away that I am not a EE (though I sometimes play one on TV ;-).

If you want specific chips, I have found the following from Digi-key. I believe they will work, but it is possible you may need an inverter here or a NOR gate there to get things to work exactly as you want.

As to the 8 bit up/down counter:
SN74ALS867ADW


http://focus.ti.com/lit/ds/sdas115c/sdas115c.pdf

As to an 8 bit parallel load shift register:
74F676

http://www.fairchildsemi.com/ds/74/74F676.pdf

You can have the clock for the counter be driven by one channel of the encoder, the other channel of the encoder is tied to the up/dn pin of the counter.

The CPU drives the "parallel load" mode of the shift register and then shift in the bits to the its input pins.

You can daisy chain the 676's to have the data look like one long register.

You can also cascade the counters if you need to have more counts than an 8 bit number can hold.

Alternatively, you can also reset the counters after you read them so that you can just accumulate the total count inside your CPU. You run the risk potential of missing a count when you reset the counters if you are not careful, but depending on your application, this may or may not be a big deal. With some clever circuitry and/or software you can avoid this problem but this is more than I want to get into here.


I don't know if this helps, but it should be a good start.

Joe J.

P.S. I have used the 676 before so I can vouch for it with first hand knowledge. However, I have not used the 867 before -- I have always had some other 4 bit counters hanging around the office that I could cascaded into whatever size counter I needed. From what you are talking about, I suppose you will need more than 8 bits perhaps 16 bits. This gets tedious with 4 bit counters so I suggested an 8 bit version. Looking at the data sheets though I am pretty sure that it will work out for your application -- perhaps others have favorites they are used to using that they can vouch for from personal experience.
So basically, the parrallel outputs of the counter are connected to the parrallel inputs of the shift register. The shift register is put permanantly into parallel load mode (Mode is high) Then, to read the shift register, the CPU has a digital IO pin connected to the CP (clock pulse) pin which it pulses, then checks serial output, and repeats to get all 8/16 bits of the counter? I'm not sure if the proper way to do this is to actually have a common clock or something like that, but this seems to be correct, too.

I wrote up some code to do what i think you're saying:
Code:
 
char encVel()
{ 
char encVel;
for(int i = 1; i<9; i++)
{
/*set clock to shift register high*/
shiftClkA = 1;
/*read the current bit of the shift register encVel*/
encVel |= serialInput<<i
 
/*set clock back*/
shiftClkA=0;
 
}
/*reset counter*/
counterResetA = 1;
counterResetA = 0;
return encVel;
}
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award

Last edited by Max Lobovsky : 31-03-2004 at 20:28.
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
Counter Strike Gadget470 Chit-Chat 20 11-07-2005 14:03
Odd counter problems Catastrophy Programming 30 16-02-2004 23:41
Counter chips Ryan Meador Programming 9 15-02-2003 00:07
Microsoft Launches Counter Switch Campaign, Then Takes It Away. Joe Matt Chit-Chat 11 17-10-2002 15:53
Counter loop archiver 2001 3 24-06-2002 00:44


All times are GMT -5. The time now is 05:59.

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