What is ADCON1 register?
What is ADCON1 register?
ADCON1 is the register that defines which PORTA pins are used for digital input/output and which are used by the A/D module. As you are only using the port in digital IO mode, set ADCON1 to a value of either 0x06 or 0x07 which makes all the pins digital.
What is the use of ADCON1 register in PIC 4550?
ADCON1 (A/D control register 1) ADCON2 uses to select voltage reference and selection of port pins for analog inputs. PCFG0: PCFG3 bits in ADCON1 determines which pins of the controller should be configured as analog inputs. We have seen that the ADC module has 13 channels which are multiplexed with the I/O pins.
How to read ADC in PIC microcontroller?
To read an ADC value the following steps has to be followed.
- Initialize the ADC Module.
- Select the analog channel.
- Start ADC by making Go/Done bit high.
- Wait for the Go/DONE bit to get low.
- Get the ADC result from ADRESH and ADRESL register.
How many bit ADC is available in pic18f?
So now let’s see ADC in PIC18F4550. PIC18f4550 has inbuilt 10-bit 13 channel ADC. 13-channels of ADC are named as AN0-AN12. It means we can connect 13 different sensors at the same time.
What is significance of ADCON0 and ADCON1 register?
The ADCON0 register, shown in Figure 23-1, controls the operation of the A/D module. The ADCON1 register, shown in Figure 23-2, configures the functions of the port pins. The port pins can be configured as analog inputs (AN3 and AN2 can also be the voltage references) or as dig- ital I/O.
What is use of ADCON0 register?
ADCON0 – A/D Control Register 0; determines the behavior of the A/D. ADCON1 – A/D Control Register 1; determines the configuration of the PORTA and PORTE and how the result of conversion of A/D will be store. ADRESH – A/D Result High Register. ADRESL – A/D Result Low Register.
What is ADC in PIC microcontroller?
Analog to Digital Converter (ADC) is a device that converts an analog quantity (continuous voltage) to discrete digital values. This is very useful when we want to do some processing on physical quantities, which are normally analog in nature. Most of the PIC Microcontrollers have built in ADC Module.
Which register is used to setup the ADC CLock in PIC microcontroller?
ADCON2 is last a register used to configure ADC of pic microcontroller. This register selects A/D module conversion clock input. In other words, it selects conversion frequency. Furthermore, this register defines the format of 10-bit digital value either as a left-justified or right-justified.
What is the status of GO done bit of ADCON0 register?
ADCON0 Register CH2, CH1 and CH0 are used to select one of the analog input channel out of eight channels. GO/DONE is the A/D Conversion Status bit. Setting this bit initializes A/D Conversion and will be automatically cleared when the conversion is complete. ADON is used to switch on/off the ADC Module.
How does ADC work in microcontroller?
An ADC is used to convert an analogue signal such as voltage to a digital form so that it can be read and processed by a microcontroller. ADC converters are very useful in control and monitoring applications since most sensors (e.g., temperature sensor, pressure sensor, force sensor) produce analogue output voltages.
What is the function of the adcon1 Register?
ADCON1 is the register that defines which PORTA pins are used for digital input/output and which are used by the A/D module. As you are only using the port in digital IO mode, set ADCON1 to a value of either 0x06 or 0x07 which makes all the pins digital.
Why do I need to set adcon1 to bit 7?
Regarding the second register, ADCON1, it must be set for two reasons: to select the format of the result value (bit 7), to select (bit0…bit3) the reference voltage and to set the port configuration control bits according to the following table (from the 16F87x datasheet):
Which is the ADC Register in PIC microcontroller?
ADCON2 is last a register used to configure ADC of pic microcontroller. This register selects A/D module conversion clock input. In other words, it selects conversion frequency. Furthermore, this register defines the format of 10-bit digital value either as a left-justified or right-justified.
Where is the result of an adcon conversion stored?
The result value of the conversion will be stored in a double register: ADRESH and ADRESL (or will be returned to a variable if high-level languages are used) with the result right or left justified according to the register adcon1:bit7. A TRISA = 0xFF (or 0b11111111) will complete the set up of the port setting the port as input.
https://www.youtube.com/watch?v=0SzGPxmaEeo