Go to Post I find it quite amazing that this thread has been continuously active for more than two years. - Stephanie [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 09-02-2003, 18:37
Ryan Meador Ryan Meador is offline
Registered User
#0190
Team Role: Electrical
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Worcester, NH
Posts: 68
Ryan Meador will become famous soon enough
Counter chips

I've seen numerous references here and other places to some chips that count pulses and output their count (serially, I hope). I'd love to have one of these, but I can't find them. I've hunted all through the digikey catalog, and I found counters, but they're just panel display things. I need an IC that counts on/off toggles and will give my PIC chip the current total. Can anyone supply a digikey part number(s)?
__________________
-Ryan

"You're not a real programmer until you end all your sentences with semicolons;"
  #2   Spotlight this post!  
Unread 09-02-2003, 20:58
ttedrow's Avatar
ttedrow ttedrow is offline
Herding electrons
AKA: Tim Tedrow
FRC #0281 (EnTech)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2000
Location: Greenville, SC
Posts: 165
ttedrow will become famous soon enoughttedrow will become famous soon enough
You should be able to program the PIC chip to count the pulses by using an interupt. The PICs are fast enough to detect the pulse rates that you should require on the robot.

What is your max frequency that you are trying to detect? I may be able to send you example code

Tim Tedrow
__________________
Sr. Design Engineer
Caterpillar Inc.
Greenville, SC

KD4EGM

FRC 281 Greenvillains
Infected with the FIRST virus in 2000

Yes, Chute Door!!!
  #3   Spotlight this post!  
Unread 09-02-2003, 23:00
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
here's the simplest idea in the world:

555 timer chip.

There are examples all over the net on how to wire one up, just hook it up to an input pin and you're set. the main advantage to this is:

a) very simple
b) all the counting can be controlled using software
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #4   Spotlight this post!  
Unread 09-02-2003, 23:26
Ryan Meador Ryan Meador is offline
Registered User
#0190
Team Role: Electrical
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Worcester, NH
Posts: 68
Ryan Meador will become famous soon enough
Ok... well, I think you're saying what I've already thought of and discarded, but perhaps not. I program my pic chips using PicBasic. There are two foreseeable problems with interrupts: 1) I don't know how to create them, and once created, I'd have to dust off my ASM skills in order to use them; 2) if there was an interrupt while the PIC was in the process of executing a SEROUT, it would likely screw up the serial stream, wouldn't it? Then I get a crashed RC.

As for a 555 timer, in my original post, I'd been intending on using that as the source of the pulses. I've used them before. I just need a dedicated pulse counter with serial output. If parallel is the only option, I suppose I could be persuaded to dedicate a PIC to translating the parallel to serial
__________________
-Ryan

"You're not a real programmer until you end all your sentences with semicolons;"
  #5   Spotlight this post!  
Unread 09-02-2003, 23:31
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Ohhhh... you already thought of that.. lol. yeah,im great at interpreting this stuff..

What we did was hook the 555 into one of the digital inputs and just stuck this into the main program loop..

timer_in VAR rc_sw1
timer VAR byte
last_time VAR misc_varible.bit0


if timer_in <> last_time then
timer = timer + 1
last_time = timer_in
endif

Hmm.. im sure you can do that in a PIC too somehow..
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #6   Spotlight this post!  
Unread 10-02-2003, 10:33
Ryan Meador Ryan Meador is offline
Registered User
#0190
Team Role: Electrical
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Worcester, NH
Posts: 68
Ryan Meador will become famous soon enough
Hmm... I hadn't considered that solution. I've been trying to jump through hoops so I can read frequincies in kHz or MHz, when I could make it 10s of Hz... Horrible precision, but perhaps good enough. Any thoughts on a higher-precision counter chip? Some teams have talked of using them to count wheel revolutions, which would be too fast for the stamp.
__________________
-Ryan

"You're not a real programmer until you end all your sentences with semicolons;"
  #7   Spotlight this post!  
Unread 10-02-2003, 23:55
nwagers nwagers is offline
Registered User
#0240 (Mach Vee)
 
Join Date: Oct 2001
Location: Monroe, MI
Posts: 88
nwagers is an unknown quantity at this point
Send a message via AIM to nwagers Send a message via Yahoo to nwagers
how do you plan on using the serial output of the chip? to input into one of the digital inputs on the rc? I suggest using two / 16 counters (74191) cascaded to give you 255 combinations input those into a seperate stamp then use resistors to weight the outputs of that stamp 1-2-4-5-16-32-64-128 and input that to an analog input. Toggle a relay (make sure you regulate it (7805)) so you can reset the counter (load all 0's). Use the stamp to create a pulse for a reset. The seperate stamp needs to output the total counts since the last reset because there will be a difference in time between the rc input and the toggle on the relay (your reset pulse). It's possible to do this in a similar fashion using serial inputs but I think it would be far too slow based on the rc timing.
  #8   Spotlight this post!  
Unread 11-02-2003, 00:00
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
dude.. people are reading my mind! im so scared..

yeah, thats kinda what we were planning for our wheel revolution counters... , but using a D-A chip instead.. and I haven't had time to play with it yet so it probably wont end up on the robot this year.. oh well. Probably we'll just end up using our wheel revolution thingies to see if the robot is moving or not..
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net

Last edited by randomperson : 11-02-2003 at 00:03.
  #9   Spotlight this post!  
Unread 11-02-2003, 01:54
EugeneBrooks852 EugeneBrooks852 is offline
Registered User
#0852
 
Join Date: Feb 2003
Location: Danville California
Posts: 1
EugeneBrooks852 is an unknown quantity at this point
4 bit counter

You can track wheel rotation directly with an optical sensor, as long as your speed does not overrun the roughly 40 HZ poll rate of the PBASIC stamp. We have done this, putting reflective tape on the shaft that drives a chain to the wheels, making it half reflective and half black, and tracking the on/off and off/on transitions. You can track moderate speeds with no counters at all, counting into a variable in the program.

Wanting to track with high precision at high speed, we are trying 4 bit counters using the "7394" chip, a 4 bit binary counter. A viable digikey part is the low power shottky version, SN73LS94N on page 348 of the pdf catalog. The part is easy to use, and you could quickly put it together with a "solder breadboard." Students on our team did artwork for a PC card, and exposed and etched printed circuit boards for the counter. Your program, in this case, must invert the bits, and detect and handle overflow. You should be able to measure inches, or less, at full speed, using this part.
  #10   Spotlight this post!  
Unread 15-02-2003, 00:07
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
ok theres 3 simple soulutions i just wanted to throw out; ill crack open the bible (digikey cataloge) tomorow but just consider this:

1) use a freq --> volt converter, either a RC circut or a chip. If your using the 16f/c84a then youll need an external AD.

2) get a divider (basicly a bunch of flipflops) that goes by, say /100, and then take it from there. that might make it more managable.

3) err and if im not mistaken, picbasic has the COUNT command, and if you have it counting for a specified amount of time then you can figure it out... if you have 2 drive motors, you do one and then the other, output and repeat. the count command, if you are running a 16f84a at 4mhz (NEED CRYSTAL FOR ACCURACY), should let you go up to about 500,000 hz. theres no motor first gives us that goes anywhere near that speed...

feel free to email me, and if i remember (hey ive got a robot to build) ill look up parts and play with code for ya. -jacob
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
drills and chips Ben.V.293 Technical Discussion 1 07-11-2003 13:11
2003 Drills and Chips Chris Motors 3 12-10-2003 19:02
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
Voodoo Gyro Chips... Ghetto_Child Technical Discussion 3 01-02-2002 16:39


All times are GMT -5. The time now is 15:10.

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