bygasra.blogg.se

Analog to digital converter project
Analog to digital converter project








analog to digital converter project
  1. #ANALOG TO DIGITAL CONVERTER PROJECT HOW TO#
  2. #ANALOG TO DIGITAL CONVERTER PROJECT CODE#
analog to digital converter project

Unsigned int iDelay OSCCON=0x70 // Select 8 Mhz internal clock TRISC = 0x00 // Set All on PORTC as OutputĪNSEL = 0b00000001 // Set PORT AN0 to analog input AN1 to AN7 digital I/OĪNSELH = 0 // Set PORT AN8 to AN11 as Digital I/O /* Init ADC */ĪDCON0=0b10000000 // select right justify result.

analog to digital converter project

#define _delay_us(x) void _delay_ms(unsigned int ms) & BORDIS & IESODIS & FCMDIS) // Using Internal Clock of 8 Mhz _CONFIG(INTIO & WDTDIS & PWRTEN & MCLREN & UNPROTECT & UNPROTECT \ ** FCMDIS - Monitor Clock Fail Safe Disable ** IESODIS - Internal External Switch Over Mode Disable ** UNPROTECT - Data EEPROM Read Un-Protect Compiler : HITECT PICC-Lite Version 9.60PL1 Description : Analog to Digital Converter

#ANALOG TO DIGITAL CONVERTER PROJECT CODE#

We will use the PICJazz 16F690 learning board (PICJazz 16F690 schema) from ermicro as our learning platform and let’s start the fun by pasting this following code to your Microchip MPLAB IDE:

#ANALOG TO DIGITAL CONVERTER PROJECT HOW TO#

On this tutorial we will learn how to program the Microchip PIC microcontroller for reading the analog signal using HITECT PICC-Lite C compiler. Therefore before we can use all of these cool sensors we have to learn the basic of how to use ADC peripheral inside the PIC 16F690 microcontroller. Today many manufactures produce sophisticated sensors for specific task such as sharp GP2D120X is use for distance measurement, National Semiconductor LM35 for precision centigrade temperature sensor, HS12 humidity sensor from GE, TGS2442 carbon monoxide gas sensor from Figaro and many more. Some of the basic sensor such as LDR (Light Dependent Resistor) is used for measuring the light intensity or NTC (Negative Temperature Coefficient) a special resistor for measuring the temperature. Usually we use the electronic sensor to convert the analog value to the voltage level value. The ADC is one of the important features that enable us to digitize our analog world. The PIC16F690 microcontroller is one of Microchip midrange 8-bit microcontroller that has a build in 10-bit resolution of Analog to Digital Converter (ADC) peripheral.










Analog to digital converter project