|
Re: reading hobby PWM
Well, I still haven't figured out the timer problem, but I figured out why the inputs don't work. When some of the pins are set to inputs, there's still a choice between analog and digital input. By default, they're analog. When they are analog, you can't read them as digital inputs.
I should have learned my lesson from last time something like this happened to me... I was working with a comparator a few years ago and couldn't figure out why the output never went high. After looking at the schematic, I noticed that it was open collector. This was never mentioned in the text, however. After getting extraorinarily frustrated with this PIC, I decided to do the same. I looked at the schematic of the pins. After backtracking and trying to figure out what needs to be done in order to read the pin, I noticed "Analog Input Mode" on one of the gates. I checked the A/D converter info and discovered that analog is the default mode...
Learn from my mistakes: when in doubt, check the schematic.
__________________
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GE/S/P a-- e y-- r-- s:++ d+ h! X+++
t++ C+ P+ L++ E W++ w M-- V? PS+ PE+
5- R-- tv+ b+ DI+++ D- G
------END GEEK CODE BLOCK------
|