View previous topic :: View next topic |
Author |
Message |
fredelek59
Joined: 09 Jun 2010 Posts: 3 Location: dunkerque, france
|
rc toys project |
Posted: Sun Jun 20, 2010 10:19 am |
|
|
hye everebody,
since few weeks I've read this helpfull forums, very good and I've still a lot of things to learn.
ok right now it's time for me to ask a few questions. I'm not used to write in english so please could you be kind and patient with me.
I intend to build this following project for a static rc glow engine.
I'd like to monitor several things: motor temperature, external temperature, 1 battery voltage, motor rpm (from 0 to 25 000 rpm) and the number of revolutions (very important), knowing one servo pwm duty cycle.
And I need to manage another servo.
All of them connected to a rs232 interface for my old laptop.
I've have worked on temperature and voltage monitoring ( ctn is a ninear kty ctn and voltage will be read through the middle of two will be enough 0.1v is enough )
For reading rpm I use a hall sensor with an aop and a transistor in order to get a square wave from 0v to 5v.
Oops forget to tell you I must use the following µC in stock 16f88, 16f628, 16f877 and 18f2550.
So now that I've read plenty of this ccs discussions about a precise rpm(frequency) meter. And now I'm a little bit lost.
Many of frequency meter or pulse capture use all the µC time, remember I've so many analog conversion to do, or they use too many ccp input(I've to manage one servo using ccp1, and capture an another ccp2)
Can you help me in order to find the right freqency meter ?
regards. fred
Last edited by fredelek59 on Sun Jun 20, 2010 11:29 am; edited 1 time in total |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sun Jun 20, 2010 10:43 am |
|
|
25K RPM is an interrupt every 40us. With interrupt overhead that doesn't
leave you with a whole lot of time for everything else.
Using the 2550 at 48MHZ you might be able to handle the RPM and the
analog but to add two PWM plus RS232 is asking a bit much for the lowly
PIC, even using the hardware UART.
If you use more than one processor or some other external counting
hardware it can be done. One option is to add a couple of decade counters
in series for the RPM and divide it by 100 to reduce the load on the
processor. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
fredelek59
Joined: 09 Jun 2010 Posts: 3 Location: dunkerque, france
|
|
Posted: Sun Jun 20, 2010 11:36 am |
|
|
hye, very happy you understand me for my first message.
how did you calculate 40µS ?
I've surely made a wrong calcul....
25k rpm / 60s =416.66 hz
1/416.66 hz = 0.0024s soit 2400 µS : |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 20, 2010 11:45 am |
|
|
The CCP on the 18F2550 has optional /4 and /16 prescalers on the
input signal. This will reduce the interrupt rate to a reasonable level. |
|
|
|