PIC 24FJ64GA002 problem a AD prevodnikom

IE → interrupt enable

ADC ma zdroj hodin z taktu procesoru , jestly jsem to dobre pochopil takze T3 je k nicemu

pokud zadas hodnotu rucne blika ledka na RA0 ? stabilne podle zadanych ms ? void __attribute__((interrupt,auto_psv)) _ADC1Interrupt(void) { IFS0bits.AD1IF = 0; // ADCValue = ADC1BUF0; ADCValue = 500; }

Example 17-1: A/D Initialization Code Example AD1PCFG = 0; // Configure A/D port // all input pins are analog AD1CON1 = 0x2208; // Configure sample clock source // and conversion trigger mode. // Unsigned Fraction format (FORM<1:0>=10), // Manual conversion trigger (SSRC<3:0>=000), // Manual start of sampling (ASAM=0), // No operation in Idle mode (ADSIDL=1). AD1CON2 = 0; // Configure A/D voltage reference // and buffer fill modes. // Vr+ and Vr- from AVdd and AVss (VCFG<2:0>=000), // Inputs are not scanned, // Interrupt after every sample AD1CON3 = 0; // Configure A/D conversion clock as Tcy/2 AD1CHS = 0; // Configure input channels, // CH0+ input is AN0, // CH0- input is Vr- (AVss). AD1CSSL = 0; // No inputs are scanned. IFS0bits.AD1IF = 0; // Clear A/D conversion interrupt. // Configure A/D interrupt priority bits (AD1IP<2:0>) here, if // required. Default priority level is 4. IEC0bits.AD1IE = 1; // Enable A/D conversion interrupt AD1CON1bits.ADON = 1; // Turn on A/D AD1CON1bits.SAMP = 1; // Start sampling the input Delay(); // Ensure the correct sampling time has elapsed // before starting conversion. AD1CON1bits.SAMP = 0; // End A/D sampling and start conversion // Example code for A/D ISR: void __attribute__ ((__interrupt__)) _ADC1Interrupt(void) { IFS0bits.AD1IF = 0; }
zalezi na prekladaci jak to ma