Page 1 of 1

ADC not corrrectly working on 16LF1939

Posted: Sun Sep 15, 2013 5:48 pm
by medelec35
Using flowchart on this post:
http://www.matrixmultimedia.com/mmforum ... 878#p51793
when programmed in demo board:
http://www.matrixmultimedia.com/mmforum ... 92&#p40121

LCD display (and LED's) is showing wildly drifting ADC values from 300ish to 500ish when pot is on maximum setting
64 when on minimum settings.


Note There is a bug with LED array, so inorder to compile, LED array will require deleting from panel.
Otherwise, syntax error will halt compiling process.

Re: ADC not corrrectly working on 16LF1939

Posted: Sun Sep 15, 2013 10:07 pm
by medelec35
I have worked out what the issue is.
No matter what the settings are An is reading too fast. So im assuming the cap is not allowed enough timing to be charged before taking a sample.
The more I slow the internal osc down the more accurate the setting. Experimenting with Conversion speed and Aquisition cycles has made no difference unless it has to be set really high.
Could Aquisition cycles and conversion speed be confirmed working as intended please?

When clock is running at 32MHz then ADC is no good at all.
min is drifting from 60 flashing up with 120is at random times
Max is as reported in the above post.

When clock is running at 8MHz:
min is 32
Max is 1023

When clock is running at 4MHz:
min is 30
Max is 1023

When clock is running at 500KHz:
min is 0
Max is 1023