The cap never charges and results count of 1. With the first snippet it works and I get the count of 350 with the rc connected per the book. I can just use the first method but wondered if anyone else had the happen and what made the code do that.
When I was first saw this I was trying to see if I could use a single cap and different pins to connect multiple resistors and measure them that way. I was getting a count of 1 no matter the resistor. Then I reorder the code and it seemed to work. I got different values then a direct connection to VDD though. I am guessing the pins output must not go quite to vdd or something else in the pic does something to the rc circuit. (I was using opposite logic HIGHportb.6) not low but either way it didnt' seem to make any diffence. still got count of 1
I still want to try and do this, maybe use outputs setting reed relays to connect the resistors between the rctime pin and vdd, or just do some math to adjust the results for the offsets if they stay consistant.
Bookmarks