AD acquisition system based on STM8S

Publisher:温暖心情Latest update time:2015-12-14 Source: eefocusKeywords:STM8S Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The STM8S series has up to 16 AD channels, depending on the package size. Many pins have multiplexing functions, which are similar to ordinary 51, and for IO ports with multiplexing functions, they can be used directly without any multiplexing settings. In addition, the multiplexing function can also remap the pins, which requires mapping configuration in the option bytes. For the pins to be configured as AD acquisition ports, they must be set to floating input mode, not any other output mode, which will seriously interfere with the measurement of input voltage. Due to the use of small packages, there is no special reference voltage, and the internal is directly connected to the power supply end. Therefore, the instability of the power supply end is the instability of the reference voltage, which will directly lead to the instability and jump of the conversion value. There is a flashing light in the design at the beginning, which causes a small fluctuation in the power supply and affects the conversion value. After the flashing light is cancelled, the conversion value stabilizes. Since the large voltage is measured by the voltage divider resistor, it is inevitable that the conversion value is inaccurate due to the error of the voltage divider resistor. The error can be eliminated by collecting the reference voltage to determine the actual voltage divider ratio of the voltage divider resistor, but the error caused by the acquisition error will become larger after amplification. The instability of the input signal can be corrected by adding an RC filter circuit, or by filtering in the software. By removing the extreme value and averaging after multiple sampling, the collected value tends to be stable. In this design, there is a 1-unit jump when the final value is displayed. In order to make the value look stable, the value is updated only when the difference between the current data and the previous data is greater than 1 unit, so that the currently collected data remains unchanged.

In the programming of the host computer, since the program is triggered by events, the relationship between each object and the event must be properly handled. The transmission of information must be well organized, otherwise it will affect the entire system.

Keywords:STM8S Reference address:AD acquisition system based on STM8S

Previous article:Why is the input voltage of the microcontroller pin limited to VDD+0.3?
Next article:STM8 study notes - PWM module

Recommended ReadingLatest update time:2024-11-15 15:07

dsPIC30F6015 controls AD7715 program source code for personal testing and use
This is the program I wrote for controlling AD7715 with dsPIC30F6015. The source program of the microcontroller is as follows: #include p30f6015.h _FOSC(CSW_FSCM_OFF & XT_PLL4); _FWDT(WDT_OFF); #define uchar unsigned char #define uint unsigned int   #define CS_A LATCbits.LATC13 //RC13 output #define DRDY PORTDbits.
[Microcontroller]
Industry technology sharing: Error research based on AD598 displacement sensor
introduction In the information acquisition system, the sensor is usually at the front end of the system, that is, the first of the detection and control system. It provides the system with the original information necessary for processing and decision-making. Therefore, the accuracy of the sensor is crucial to the e
[Power Management]
Industry technology sharing: Error research based on AD598 displacement sensor
51 MCU AD conversion
In the digital logic course, we have learned the concept of AD conversion: converting analog signals into digital signals after sampling, quantization, and encoding. However, we have not learned how to display the results through microcontroller programming. There are two types of coding: rounding up and down, and onl
[Microcontroller]
Diagnostic Features of the AD7770 and AD7779
By : Lluis Beltran Gil and Miguel Usach, Analog Devices The AD7770 and AD7779 are 8-channel simultaneous sampling Σ-Δ analog-to-digital converters (ADCs). Each channel includes a dedicated programmable gain amplifier (PGA) stage (providing gains of 1, 2, 4, and 8), a complete Σ-Δ ADC, and a low-latency sinc3 digita
[Analog Electronics]
Diagnostic Features of the AD7770 and AD7779
STM8S main clock switching (using HSE clock source)
The clock switching method used is manual switching. The clock switching is performed in the interrupt, and then the switched main clock is output to the CLK_CCO port. Clock switching flow chart (manual switching flow chart): Clock Tree: Register version: unsigned char i=255;  PD_DDR_DDR0=1; //Configure PD0 to o
[Microcontroller]
STM8S main clock switching (using HSE clock source)
PIC microcontroller ad sampling and display on LCD
/* Main.c file generated by New Project wizard * * Created: Tuesday April 10, 2018 * Processor: PIC18F452 * Compiler: MPLAB C18 */ #include p18f452.h #define RW PORTBbits.RB5 #define RS PORTBbits.RB6 #define EN PORTBbits.RB7 #define P0 PORTD #define ADGO ADCON0bits.GO void tmr(void); void KeyInterrupt1 (void); //Int
[Microcontroller]
STM8S awu and watchdog IWDG WWDG application
Application of AWU (completed using library functions) //Remember to enable interrupts and clear interrupts in the interrupt function AWU_GetFlagStatus(); void AWU_SET(void) {     CLK_PeripheralClockConfig(CLK_PERIPHERAL_AWU, ENABLE);     AWU_Init(AWU_TIMEBASE_12S); } #ifdef _COSMIC_ @far @interrupt void AWU_IRQH
[Microcontroller]
Memory Oscilloscope Based on STC12C5408AD
1 Introduction        The oscilloscope is a basic instrument for electronic measurement. Due to its real-time, intuitive and vivid graphic display, it is also one of the commonly used instruments in general physics laboratories. As we all know, the oscilloscope is made based on the principles of electron beam scanni
[Microcontroller]
Memory Oscilloscope Based on STC12C5408AD
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号