Re: Adc on 18f67k22 - an4
Just a quick read of the datasheet shows the maximum internal oscillator is 16MHz.
Also, the chip has an onboard voltage regulator for 3.3VDC so I'm certain you'd have to supply somewhat more than that to actually get that voltage to the chip. Although it does say it will operate at 1.8 volts.
Not sure it matters but on the write to the value.lowbyte, you needs a space according to the book.
And now someone will add that I'm wrong so I'm not sure I'm correct.
Re: Adc on 18f67k22 - an4
working though the issue i found a setting for the low power idle mode - Section 4.4 for this chip allows for functions to be shut down individually while still allowing register access ,
PMD0.0 enable / disables the ADC module , this was was set incorrectly
darrel did a simulator of the the an4 setting as a seperate test program and i just did a hardware test of it a few moments ago , and found the above setting to be the cause of no reading
Also an additional EErata sheet sent out 4 days ago - point 1.2 indicates that a adc error offset when using 12 bit so a calibration issue need to be addressed in the software , but appers 10 bit should avoid this issue ,
I am currently looking why the values read are so different to that of the 16f1947
here a link to the same question posed on melabs forum , with darrels sample config and test for reference
http://support.melabs.com/threads/96...=2177#post2177
cheers
sheldon
Re: Adc on 18f67k22 - an4
May or may not help...
I have been playing with an 18F87J50. This chip was giving me trouble.
For me, I had to place the same voltage on VDD and AVDD, and have the typical capacitors across all VDDs and VSSs, also placed a capacitor from AVDD to VSS. Now the chip has smoothed out.
Re: Adc on 18f67k22 - an4
There were some originally issues acording to the errata sheet's for the 18F67K22 dealing with the a/d offset issue. I have found that working with the latest versions of silicon that placing 1uF. tantalum filtering caps at the AVDD to AVSS cleaned up all of the noise I was experencing. I 12 of the 16 available A/D channels currently and have had no problems with the 12 bit conversions. I also use 10uF. tantalum caps as well as .1uF at all of the Vdd to Vss connections. I run the on board regulator w/5 volts on all other pins except the A/D +vref pin which is 4.096 volts.
Dave Purola,
Re: Adc on 18f67k22 - an4
thanks guys , i have added addtional 0.1 caps to the VDD,VSS , the AVDD and AVSS are connected to the Vdd,VSS ,with 10 uf caps on the 3v3 line
wondering what setting you have for adcon1 & ADCON2 ,
i am currently finding that putting a large TAD value of 12 is getting me more consistant values ,
, but like to minimise the time per read as much as possible
found setting the 2.048 Vref was not giving a consistent reads and setting it to AVDD is
so i used
adcon1= $00
adcon2 = %10101110
and not used the defin ADC_clock , ADC_sampleus commands
i am still at a loss to find why the values are large differences between the 16f1947 and this chip , except 16f1947 is 10 bit ADC
any way as long as the reading are consistent ill move forward
cheers
sheldon
Re: Adc on 18f67k22 - an4
Longpole001, here is my configs:
'--------------------------------- A/D SETUP -----------------------------------
ADCON0 = %00000001 'DONE,A/D ON
ADCON1 = %00010000 'REF+ = EXT,REF- = VSS,single ended
ADCON2 = %10010110 'RIGHT JUSTIFIED,FOSC/64
ANCON0 = %11111111 'AN0;AN7 ANALOG
ANCON1 = %00001111 'AN8;AN11 ANALOG
ANCON2 = %00000000 'ALL REMAINING DIGITAL
CM1CON = %00000111 'COMPARATORS ALL OFF
CM2CON = %00000111 'COMPARATORS ALL OFF
CM3CON = %00000111 'COMPARATORS ALL OFF
CVRCON = %00000000 'VOLTAGE REFERENCE OFF,OUTPUT OFF
HLVDCON = %00000000 'CLEAR IRVST,LVDEN,AND DISABLE
WDTCON = %00000000 'DISABLE WATCH DOG TIMER
CTMUCONH = %00000000 'DISABLE CTMU
CTMUCONL = %00000000 'DISABLE CTMU
CTMUICON = %00000000 'DISABLE CTMU
Re: Adc on 18f67k22 - an4
thanks dave ,
darrel did some testing on the adc , found that its readings and offsets are way off,
i have been getting some really strange readings as well
i decided to do an average of the readings to smooth out the results a bit but this result is a worry
http://support.melabs.com/threads/96...n-18f67k22-an4