| công cụ tìm kiếm bảng dữ liệu linh kiện điện tử |
|
AN1812 bảng dữ liệu(PDF) 31 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1812 bảng dữ liệu(HTML) 31 Page - STMicroelectronics |
|
31 / 34 page ![]() AN1812 13 References and bibliography 31/34 Appendix D Software flow The fCPU chosen is 8 MHz. Koffset and Kgain are calculated by taking the reading for two known inputs. The flow of the software, use to implement the algorithm, is as follows: 1. First the I/O pins, Timer, SCI (Tx @ 9600 baud rate) and some global variables used in the ADC are initialized. 2. Then a string is transmitted to check that SCI is working fine. 3. The settling time is kept fixed at 1 second for fCPU = 8 MHz. 4. Some initial readings are taken and ignored while the ADC stabilizes. 5. The control enters an infinite loop. 6. Inside the infinite loop, there is a loop in which ADC captures the timer values 17 times. But the first reading is ignored. 7. The remaining 16 captured values are converted into the corresponding voltages (up to 10 µV precision) and then transmitted a PC for display by the Hyperterminal after being converted into a buffer of ASCII characters. 8. The average of 16 timer readings is taken and sent to the Hyperterminal as a time value and a corresponding voltage in the same manner as described above. 9. The difference between the maximum and minimum captured value is also sent to the Hyperterminal in the same way as in step 8. 10. After this step, the software enters an ‘IF’ loop “if (mCount == 18)”, where the ADC is reset in order to measure the next input value. Again a few readings are ignored while the ADC stabilizes. The counter and other global variables are also initialized. 11. After this, the software re-enters the loop of 17 conversions and executes step 6 to step 9. This process continues until you reset the system manually. D.1 Code size The software given is for guidance only. Here the display is done for up to 10 uV precision. You can modify and use your own code for the display of the data. The following table summarizes the code size. Depending on the compiler and memory placement, these values can change. The RAM requirements are not provided and you have the choice to place the variables as global or local. Table 4. .Code size No. Function Name Code size ( Bytes) ADCSys 1 Acquisition 128 2 Start_Capturing 7 3 Reset_ADC 5 4 ADC_InitializeVar 29 5 IsCaptured 13 6 Delay_Second 44 |
|
Link URL |
| Cho đến nay ALLDATASHEET có giúp ích cho doanh nghiệp của bạn hay không? [ DONATE ] |
Alldatasheet là | Quảng cáo | Liên lạc với chúng tôi | Chính sách bảo mật | Liên kết đến bảng dữ liệu | Trao đổi link | Tìm kiếm theo nhà sản xuất All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |