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
}
yes tht program (the 2nd one) did work.
Im using the program MicroC for writing the code.
You specify the device and its architecture in the beginning of the project and then when it compiles the hex file, it automatically configures...
I just need to know which command will enable me to use the internal comparator and i also need to know what command can i use when i want to address a single pin and not the entire port. Say I need to specify IF portA pin 3 == 2... how can i translate that into code?