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

AnalogIn test requires that analog input pins also support digital output function #1

Closed
maclobdell opened this issue Jul 22, 2016 · 8 comments

Comments

@maclobdell
Copy link
Contributor

maclobdell commented Jul 22, 2016

Need an alternative way to test analog pins when they don't support digital output for some rare cases. A resistor ladder is preferred such that a different value can be read on each analog pin. This would confirm that the analog pins are configured correctly for individually measuring on each pin.
Alternatively, have a way to fly-wire the pwm-capable digital signals (selectable) to a capacitor to ground, then to the resistors in parallel to the analog pins.

@BlackstoneEngineering
Copy link
Contributor

I think it is a fair assumption that all pins can be digital IO. This assumption is an underlying assumption made in the mbed SDK, so having a ping that cannot do GPIO would be an SDK implementation error, not a test case?

@sg- care to comment on this one?

@sg-
Copy link

sg- commented Sep 27, 2016

My previous though was that a resistor ladder would provide the coverage needed and avoid this case where analog pins are not digital capable

@BlackstoneEngineering
Copy link
Contributor

Will consider changing to resistor ladder for next revision. But how often is it the case that a pin can do analog in but not digital out?

@maclobdell
Copy link
Contributor Author

I think that most mcus these days probably do offer both analog and digital capabilities on the same pin. But there are definitely potential cases where they do not - most probably on high-precision ADCs. In my opinion, a simple circuit that isolates the feature under test (analogin, not analogin + digitalout) would be preferred.

@BlackstoneEngineering
Copy link
Contributor

BlackstoneEngineering commented Sep 28, 2016

I do not disagree, the problem is we're pretty far down the path to getting these produced, making any HW changes would delay the release of the CI Test Shield by 1-2 months. Is this worth it?

Also, wouldnt adding a resistor ladder across A0-5 messup the analogout test? Or are you proposing a resistor ladder across A0-3 with A4-5 being loopback?

@BlackstoneEngineering
Copy link
Contributor

As a solution I have added the 'assumptions' tests, which will check the assumptions made in the tests. In this case the TESTS/assumptions/analogin/analogin.cpp test will check that the AnalogIn pins can be used as DigitalOut pins. If not then the assumption fails, as does the entire test. Is this an acceptable solution?

@BlackstoneEngineering
Copy link
Contributor

@maclobdell are the assumptions tests an acceptable solution?

@BlackstoneEngineering
Copy link
Contributor

Marking as resolved.

mray190 added a commit that referenced this issue Jul 13, 2017
Formatted code, removed TEST_ASSERT(true), fixed bugs, added comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants