ADC0832 package diagram ADC0832 and microcontroller connection diagram ADC0832 timing diagram Program source code download: http://www.51hei.com/f/0832430.rar #include
{
P2OUT|=BIT2;// DI=1;
if(DO) // 检查DO;
{
temp |=0x01;
}
else
{
temp &=0xfe;
}
P2OUT&=~BIT1;//clk=0;
_NOP();
_NOP();
P2OUT|=BIT1;//clk=1;//rising edge, shift left by 1 bit
temp=temp<<1;
}
adval=temp;
}
/********Display data********************************/
void display(uint dat)
{
P2OUT &=~BIT3;//Turn off the ones digit display P2.3
P2OUT &=~BIT4;//Turn off the tens digit display P2.4
P2OUT |=BIT5;//Turn on the hundreds digit display P2.5
P1OUT=tab[dat/100];
delay(1);
P1OUT=0xff;
P2OUT &=~BIT3;//turn off the ones digit display P2.3
P2OUT |=BIT4;//turn on the tens digit display P2.4
P2OUT &=~BIT5;//turn off the hundreds digit display P2.5
P1OUT=tab[(dat%100)/10];
delay(1);
P1OUT=0xff;
P2OUT |=BIT3;//turn on the ones digit display P2.3
P2OUT &=~BIT4;//turn off the tens digit display P2.4
P2OUT &=~BIT5;//turn off the hundreds digit display P2.5
P1OUT=tab[dat/10];
delay(1);
P1OUT=0xff;
}
void main()
{
WDTCTL = WDTPW + WDTHOLD;
P2DIR =0x3f;
P1DIR|=0x7f;
while(1)
{
ADC_read(0);
delay(1);
display(adval);
}
}
Previous article:Msp430 microcontroller flashing light program
Next article:Stepper motor driver assembly program and debugging summary
Recommended ReadingLatest update time:2024-11-23 08:42
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- MCU Principles and Interface Technology C51 Programming (Edited by Zhang Yigang)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- DJI Drone Phantom 3 remote control transmits frequency hopping signal
- Starting from GPS receiver sensitivity
- Is there a standard for 4-20mA load?
- EEWORLD University Hall----Choosing the latest boost converter and Class D amplifier from Texas Instruments to significantly increase the battery life of the trolley speakers
- Tutorial on compiling makefile
- MSP430--Low Power Mode
- "Goodbye 2019, Hello 2020" + Life Watershed
- MSP430FR5739 enables applications to connect to the Internet of Things
- Introduction to DDS Principle (Chinese).pdf
- UCOS-II (Translated by Shao Beibei)