Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADC library must support negative ADC results #193

Open
GoogleCodeExporter opened this issue Mar 3, 2016 · 2 comments
Open

ADC library must support negative ADC results #193

GoogleCodeExporter opened this issue Mar 3, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

The ADC library currently assumes that the result of an A-D Conversion is 
always a positive value (byte or word). However, the ADC modules of newer PICs, 
e.g. 16F1783, support negative results of ADC. With 12-bits resolution this 
means the result can be in the range -4096 to +4095.  A modification of the 
library is desired to support and return signed values.

Original issue reported on code.google.com by robhamerling on 17 Apr 2013 at 8:40

@GoogleCodeExporter
Copy link
Author

Original comment by robhamerling on 17 Apr 2013 at 8:41

  • Changed title: *ADC library must support negative ADC results *

@GoogleCodeExporter
Copy link
Author

Currently I limit my tests and analysis to the 16f1783, but I expect that other 
14H PICs suffer of similar omissions the ADC libraries. Later other PICs - 
especially 14H - could be analyzed to obtain a complete picture of the required 
changes. I'll collect my findings here for the person(s) who will eventually 
update these libraries. 
The 16f1783 ADC module requires ADCON2 to be configured properly. As default 
'compatibility' setting it could be set to 0b0000_1111. See the datasheet for 
details.

Original comment by robhamerling on 17 Apr 2013 at 7:16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant