|
Re: RC and TAOS Color Sensor
So there are two intelligent ways to interface this to the RC, in my not entirely humble opinion. The control of it should probably follow Don's recommendations, but taking a reading from this might end up being more of a pain than you think.
First, directly mesuring a frequency of potentially atleast 12 kHz with the RC is generally difficult or problematic. If we had full access to the PIC's pins, you'd just use a CCP pin or two and mesaure the period of the signal, but that's sadly not possible on the IFI RC. So I think you have two options.
A. Use a frequency-to-voltage converter. This chip takes a frequency input, and outputs a voltage based on it. So you'd set it up so it puts out 5V at 10 or 12 kHz, and you'd take this output to one of the analog inputs on the RC.
Advantage: Much easier to code for. Mostly instantaneous value changes. Disadvantages: Yet another chip to wire up. Voltage range is going to depend on resistor and capacitor values, so the scaling will change between devices depending on the precision of your components. Also, it can be non-linear at the extremes of the range.
B. Use a very particular digital IO pin on the RC as a Timer1/3 clock input on the RC. 57 did this to measure the speed of our shooter wheel. Exactly one of the digital IO pins can be programmed so you can use Timer1 or Timer3 as a counter. I can provide more details if you're interested in this solution.
Advantages: No additional circuitry required. Potentially better resolution than the 10-bit analog input. Disadvantages: Harder to code. Resolution will depend on sampling time. (Faster sampling == less resolution) The value you're measuring will perforce be the average value of the frequency over your sampling period, not the instantaneous value. This may or may not be desirable.
The third option is to put the output on an interrupt pin and basically treat it like an encoder, but then your RC will be dealing with potentially a lot of interrupts. And as long as you're just using one of these, I don't think there's a reason not to go with option B for direct wiring to the controller.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|