chipKIT® Development Platform

Inspired by Arduino™

chipKIT WifFire external ADC referance

Created Thu, 20 Oct 2016 01:05:35 +0000 by Jacob Christ


Jacob Christ

Thu, 20 Oct 2016 01:05:35 +0000

Some magic tricks had to be performed when Digilent make the chipKIT WiFire due to building the boards with different revisions of uC Silicone. Because of this the ADC code is not quite up to snuff at this time. Today we had to use and external reference and we ended up adding the following code to setup() to get this to work. This was tested on both a Rev B and Rev C WiFire boards. This code will use +VREF and AVss as your referances. If you need a different configuration refer the the ADC datasheet for the MZ parts to determine how these bits need to be set.

#if defined(32MZ2048ECG100) AD1CON3bits.VREFSEL = 0b001; // no need for EF code on an EF processor, just use the compiler supplied headers #elif defined(32MZ2048EFG100) ADCCON3bits.VREFSEL = 0x001; #endif

Jacob


jmlynesjr

Thu, 20 Oct 2016 18:42:23 +0000

Jacob:

Is there a typo in your code example?

0b001 vs 0x001

James


majenko

Thu, 20 Oct 2016 19:24:38 +0000

Probably, however 1 in binary is the same as 1 in hexadecimal...


Jacob Christ

Thu, 20 Oct 2016 19:41:19 +0000

I was testing you. You passed.

Jacob