ADC not corrrectly working on 16LF1939

Please add any bug reports that require discussion here

Moderator: Benj

Forum rules
Only bug reports will be considered here. General questions should not be posted in this forum.
Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

ADC not corrrectly working on 16LF1939

Post 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.
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: ADC not corrrectly working on 16LF1939

Post 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
Martin

Post Reply