Apparently I hit enter before I should have before, then I took too long to edit the post. So here is what it was meant to be.....
I apologise in advance for the stupid questions, but I'm pretty green and haven't been able to find an example of what I want to do in the search.
I am trying to read a speed signal coming from a gearbox on a car, this is a very simple reed switch in the gearbox that has a magnet on the output shaft. I have a 5V pullup on that line, and have tried a few methods for reading the pin.
I have tried COUNT but haven't been able to get a consistant result. Not one that increases with the speed of the car anyway.
I currently use PULSIN to read the tacho squarewave, which works well, but only as I don't have to wait very long. With the car going at slow road speeds, the speedo signal frequency is quite slow, and slows down the whole program. Not to mention, it doesn't seem to give consistant results.
I feel I should be trying to use the CCP capture command to count pulses in the background, but I have no real experience with the CCP side of things yet, and despite reading the datasheet, and some notes about the CCP, I haven't yet got a grasp on it.
Does anyone know of a sample of CCP being used in the type of situation I am chasing? I just need to see it working to grasp it I think.
Thanks in advance...
Dave
Bookmarks