• AVR Freaks

Hot!ADC / internal temperature sensor in PIC32MX350 can not be read

Author
Elmi79
Starting Member
  • Total Posts : 42
  • Reward points : 0
  • Joined: 2017/03/05 08:07:13
  • Location: 0
  • Status: offline
2020/01/25 07:38:57 (permalink)
0

ADC / internal temperature sensor in PIC32MX350 can not be read

I'm using following code to read data from the ADC which itself should read the internal temperature sensor:
The initialisation:
   AD1CON1 = 0x8000;
   AD1CON2 = 0x0;
   AD1CON3 = 0x0;
   CTMUCON|=0x1000;
   AD1CHS = 0x1D0000;
   AD1CSSL = 0x0;

 
Starting the ADC (done only once during initialisation - is this correct or needs it to be done repeatedly?):
   AD1CON1bits.SAMP = 1;

 
To check if conversion is complete I read register AD1CON1bits.DONE - but it never returns a 1, so it looks like samping/conversion was never done.
 
Any idea what I'm doing wrong?
 
Thanks :-)
 
#1

0 Replies Related Threads

    Jump to:
    © 2020 APG vNext Commercial Version 4.5