#include <xc.h>
#pragma config FOSC = HS
void main()
{
OSCCONbits.IRCF = 0b111;
OSCTUNE = 0b01111;
OSCCONbits.SCS = 0;
OSCCONbits.OSTS = 1;
OSCCONbits.HTS = 1;
OSCCONbits.LTS = 1;
TRISBbits.TRISA2 = 0;
ANSELbits.ANS2 = 1;
ADCON0 = 0x89;
ADCON1 = 0x00;
while(1)
{
ADCON0bits.GO = 1;
while(ADCON0bits.GO == 1)
{
PORTBbits.RB6 = ~(PORTBbits.RB6);
}
}
}
I am struggling to change the adc conversion. When i am checking in the oscilloscope. i am getting the conversion time as 10 micro seconds. but it needs to take like 200 nsec.
MPLAB version 5.40
Pickit 3 programmer
XC8 compiler