energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
798 stars 670 forks source link

CC3220S analogRead incorrect reading #1054

Open dcjw opened 4 years ago

dcjw commented 4 years ago

Thank you for opening an issue on the Energia repository.

Do not use GitHub issues for project related questions.

Use instead the 43oh forum and TI E2E forum, so everyone can share the questions and answers.

Do not use GitHub issues for questions on third-party libraries.

Use instead their own repositories.

Check the issue hasn't been reported yet.

If an issue has alreday been reported, add your case to its thread.

Please provide the following information.

Describe the expected results.

`I tried to perform an analogRead with analog pins (pin 57 - 60) on CC3220S launch pad. Input voltage was around 1.1V. From the CC3220S launch pad schematics, there is a voltage divider ( 422 / 998 ) before ADC, so I would expect ADC code to be around 1360. Could it be there are additional ADC setup required (clock, register configuration, etc)?

My code basically just calls analogRead periodically as shown below.

void setup() { // put your setup code here, to run once: Serial.begin(250000); } void loop(){ int out = analogRead(24); Serial.print(out); delay(1000); } `

Describe the actual results.

However, the ADC code turned out to be 333 (around 0.11V)

List the steps to reproduce the problem.

Compile and run the code above. Drive pin60 with different voltages and observe output in Serial monitor