Hey, i am student and doing my project on pic 16f877. I am comparing one ADC input to one reference voltage. Based on condition i.e (ADC pin>reference voltage)or(ADC pin<reference voltage) LCD should display low or high only. I don’t know its programming part. and voltage coming to ADC pine is (0-5v).
i am using mikro c for its programming . Please provide me program for it, or any other help.
Thanks
Hey, i am student and doing my project on pic 16f877. I am comparing one ADC input to one reference voltage. Based on condition i.e (ADC pin>reference voltage)or(ADC pin<reference voltage) LCD should display low or high only. I don’t know its programming part. and voltage coming to ADC pine is (0-5v).
i am using mikro c for its programming . Please provide me program for it, or any other help.
Thanks
Just see the circuits and the example programs below.
**broken link removed**
**broken link removed**
But you won't be able to compile the example program there because it has two registers ANSEL and ANSELH that are not used in 16F877.
For 16F877 the registers used to control the analog inputs are adcon1, adcon0, adresh and adresl. So delete ANSEL, ANSELH in example programs and then set the adcon1, adcon0, adresh and adresl according to your requirements.
Also there's an example in your pc somewhere like here.
C:\Program Files (x86)\Mikroelektronika\mikroC\Examples\EasyPic5\P16F877A\ADC_on_LCD
And asking you whether the microcontroller is 16f877 or 16f877a was a mistake. It doesn't matter for ADC I think.
These are examples only. Use them in your program.
You can get the reference voltage from a adc pin and then check the new value against the reference voltage using if conditions. When the condition is met display high or low.