I am new to programing micro-controllers.
I want to use the internal comparator of this PIC and compare a voltage say if greater than 2V, i want an output, say an LED to blink for simplicity.
By the way, i am using the program MicroC for programing.
void main()
{
TRISA=0b001111; //i understand im initializing the A ports. MSB as 0 and LSB as 1
CMCON=0b00000011 // I got this command off the datasheet to use the comparator
}
NOTE: Datasheet availabe --> https://www.electro-tech-online.com/custompdfs/2010/04/39582b-1.pdf
Well this doesnt work, could someone tell me whats wrong?
Or atleast guide me in the right direction...
Need help ASAP.... thanks....
I want to use the internal comparator of this PIC and compare a voltage say if greater than 2V, i want an output, say an LED to blink for simplicity.
By the way, i am using the program MicroC for programing.
void main()
{
TRISA=0b001111; //i understand im initializing the A ports. MSB as 0 and LSB as 1
CMCON=0b00000011 // I got this command off the datasheet to use the comparator
}
NOTE: Datasheet availabe --> https://www.electro-tech-online.com/custompdfs/2010/04/39582b-1.pdf
Well this doesnt work, could someone tell me whats wrong?
Or atleast guide me in the right direction...
Need help ASAP.... thanks....