Yeah but you also need to define LED as output. By default all I/o are configured as input... so TRISIO=%11111111.
what if you're using the following
Code:
TRISIO=%11111110 ' Set GP0 as output, other to input
This will set all I/Os in one shot, and configure GPIO.0 as an output
You could still leave your current TRISIO setting as is but use HIGH LED and LOW LED instead. HIGH/LOW set the according pin to Output for you.
Depending the frequency you want to measure, COUNT may work well or not. I would use a internal timer instead for that... but it's me.
First make sure there's no real big DC offset which could trick the TTL threshold level.. hence produce weird/erratic results.
What happen if you comment the DEFINE OSCCAL... line?
Last edited by mister_e; - 1st October 2007 at 23:18.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks