| công cụ tìm kiếm bảng dữ liệu linh kiện điện tử |
|
PIC16F15213T-I/ST bảng dữ liệu(PDF) 324 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC16F15213T-I/ST bảng dữ liệu(HTML) 324 Page - Microchip Technology |
|
324 / 439 page ![]() Notes: 1. With global interrupts disabled (GIE = 0), the device will wake from Sleep but will not enter an Interrupt Service Routine. 2. Refer to 27.3. ADC Acquisition Requirements for more details. Example 27-1. ADC Conversion (assembly) ; This code block configures the ADC for polling, ; VDD and VSS references, ; ADCRC oscillator, and AN0 input. ; Conversion start & polling for completion are included. BANKSEL TRISA BSF TRISA,0 ; Set RA0 to input BANKSEL ANSEL BSF ANSEL,0 ; Set RA0 to analog BANKSEL ADCON0 CLRF ADCON0 CLRF ADCON1 CLRF ADACT ; Auto-conversion disabled BSF ADCON0,0 ; CHS = RA0, ADC ON MOVLW B’11110000’ ; FM = Right-justified, CS = ADCRC, PREF = VDD MOVWF ADCON1 CALL SampleTime ; Acquisition delay BANKSEL ADCON0 BSF ADCON0,GO ; Start conversion BTFSC ADCON0,GO ; Is conversion done? GOTO $-1 ; No, test again BANKSEL ADRESH MOVF ADRESH,W ; Read upper byte MOVWF RESULTHI ; Store in GPR space MOVF ADRESL,W ; Read lower byte MOVWF RESULTLO ; Store in GPR space Example 27-2. ADC Conversion (C) /*This code block configures the ADC for polling, VDD and VSS references, ADCRC oscillator and AN0 input. Conversion start & polling for completion are included. */ void main() { //System Initialize initializeSystem(); // Configure Port TRISAbits.TRISA0 = 1; // Set RA0 to input ANSELAbits.ANSELA0 = 1; // Set RA0 to analog // Configure ADC ADCON1bits.CS = 1; // ADCRC Clock ADCON1bits.PREF = ‘b11; // VDD ADCON0bits.CHS = ‘b000000; // RA0 ADCON1bits.FM = 1; // Right justify ADCON0bits.ON = 1; // Turn ADC On while (1) { ADCON0bits.GO = 1; // Start conversion while (ADCON0bits.GO); // Wait for conversion done resultHigh = ADRESH; // Read result resultLow = ADRESL; // Read result PIC16F15213/14/23/24/43/44 ADC - Analog-to-Digital Converter © 2020-2022 Microchip Technology Inc. and its subsidiaries Data Sheet DS40002195E-page 324 |
|
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 |