Analog signal/digital signal
(1) An analog signal is a physical quantity that is continuous in time and value, and has an infinite number of values. Most physical quantities perceived from nature are analog in nature, such as speed, pressure, temperature, sound, etc.
(2) Digital signals are discrete in both time and value, and the values of discrete signals are only true or false, yes or no, so they can be represented by 0 and 1 in binary.
ADC driving process
ADC main driver
main.c
#define ADC_FREQ 2500000
void Main(void)
{
/*Clock initialization*/
Set_Clk();
/*ADC initialization*/
adc_init();
while(1)
{
/*Read the conversion value*/
adc_value=ReadAdc(0);
delay(1000);
}
}
void adc_init(void)
{undefined
//Select the input channel, AIN0, corresponding to the W1 adjustable resistor on the development board
int channel=0;
/*Set the divided clock*/
preScaler = ADC_FREQ;
preScaler = 50000000/ADC_FREQ - 1; //PCLK=50M
/*AD conversion frequency setting, maximum frequency is 2.5MHz*/
rADCCON = (1<<14)|(preScaler<<6)|(channel<<3); //setup channel
delay(1000);
}
******************************************************/
int ReadAdc(int channel)
{undefined
/*Start AD conversion*/
rADCCON |= 0x01; //start ADC
while(rADCCON & 0x1); //check if Enable_start is low
/* Check if the conversion is finished */
while(!(rADCCON & 0x8000)); //check if EC(End of Conversion) flag is high
return ( (int)rADCDAT0 & 0x3ff );
}
Previous article:ARM9(S3C2440) Touch Screen
Next article:ARM9(S3C2440) UART
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Newbie help, the light flashes five times, the buzzer sounds once, now it flashes and sounds
- An 80W power amplifier for LS band, equalizer adjustment
- Protel99 generates a network table where some components have no connections
- Common problems in debugging the TMS320C3x series?
- Regarding GaN devices, these issues should be paid attention to!
- 【GD32E231_DIY】-02: Development environment construction and creating a new project
- TI C64X DSP interrupt vector table configuration (hardware interrupt)
- How to create a hit product of 49 yuan NB-IOT locator?
- Taking a “family-first” approach to op amp design
- Who knows the name of the chip?