PIC16F877 ADC Volt Meter Circuit MicroC Example

| August 28, 2023 Updated
PIC16F877 ADC Volt Meter Circuit MicroC Example

In this work, using a PIC16F877 Hello friends and I created a volt meter with single-channel ADCs have. Similar programs for use with the volt meter microcar able to find the opportunity to examine what I thought. At a later time, I will publish the project again in a state of functional

adc-microc-pic17f877

/*
VOLT METER APPLICATION WITH ADC
JANUARY 2010
KOCAELİ UNIVERSITY TEF ELECTRICITY
PIC877A microprocessor
4mhz crystal
*/

unsigned char volt;
unsigned int volt_read;
unsigned int i;
char *text;
long tlong;

void main() {
   INTCON = 0; // All interrupts canceled
   Lcd_Init(&PORTB); // Lcd_Init prepared for PORTB LCD
   LCD_Cmd(LCD_CURSOR_OFF); // LCD cursor closed
   LCD_Cmd(LCD_CLEAR); // Deleted to avoid random characters on the LCD


Lcd_Out(1,6,"KOU TEF");
                               // 1st line6. information has been written to the character

   ADCON1 = 0x82; // ADC settings
   TRISA = 0xFF; // PORT A is logged
   delay_ms(500);
   text = "VOLT: "; // DISCLOSURE TEXTS
   while (1) {
     volt_read = ADC_read(2); // ADC 2 channels read
     LCD_Out(2,1,text); // print TEXT to the screen

     tlong = (long)volt_oku * 5000; // read volts converted to millivolts
     tlong = tlong / 1022; // Converting milli volts to volts

     volts = tlong / 1000; // Assigning the value X.,..
     LCD_Chr(2,8,48+volts); // X value line 2 is printed from 8th character

     volt = (tlong / 100)10%; // Assigning .X,..
     LCD_Chr_CP(48+volts); // X value is printed from the cursor position in line 2
     LCD_Chr_CP('.');


     volt = (tlong / 10) 10%; // 0.1 volts d
     LCD_Chr_CP(48+volts); // is printed from the cursor position in line 2

     volts = tlong 10%; // 0.01 volts
     LCD_Chr_CP(48+volts); // is printed from the cursor position in line 2

     LCD_Chr_CP('V'); // V unit is added to the result obtained.

     delay_ms(1); // waiting for 1ms for loop instabilities
   }
}//~!

MicroC ADC Example code and pic16f877 circuit proteus isis schematic files:

PIC16F877 ADC Volt Meter Circuit MicroC Example

Password: 320volt.com

Published: 2010/01/30 Tags: , ,



1 Comment “PIC16F877 ADC Volt Meter Circuit MicroC Example

  1. Electronics CircuitsElectronics Circuits

    6V 4AH Fake Battery

    Previously, “Fastening Capacitor” I reported the issue through 6800uF 2200uF electrolytic capacitor was coming 🙂 is now a more advanced level three papers: Dr. Ramming tamirci_erh battery in the incident at the beginning of the history of a friend of my brother.

    REPLY

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Comment moderation is enabled. Your comment may take some time to appear.