Arduino Uno can't read ADC6 & ADC7 analog pins

836 views
Skip to first unread message

Alex

unread,
Jan 18, 2018, 2:36:46 AM1/18/18
to Mozzi-users


Hi!
I'm Trying to use the awesome Mozzi library with a custom atmega328 based board that has access to the extra ADC6 & ADC7 pins only available on the SMD version of the atmega328.




The are normally readable via analogRead(A6) and analogRead(A7). Unfortunately mozziAnalogRead(A6) and mozziAnalogRead(A7) doesn't appear to return usable results.
I'm guessing a tweak is needed in the library to read these "special" pins.

Any guidance would be greatly appreciated!!!
Thanks in advance
Alex

Tim Barrass

unread,
Jan 18, 2018, 7:11:57 PM1/18/18
to 'Ian C.' via Mozzi-users
Hi Alex,
I expect it's to do with adcPinToChannelNum() in mozzi_analog.cpp, which calls Arduino's analogPinToChannel().
You might find something out by searching the Arduino source for analogPinToChannel.
Let us know how how you go... it's probably worth incorporating/fixing.
Tim

--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To post to this group, send email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/aba35307-caa8-4504-b45f-4d4a9171e9d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex

unread,
Jan 19, 2018, 2:00:53 PM1/19/18
to Mozzi-users
HI Tim

Thanks for the response, I had a look but it seems a little over my head, I'll see if I can "hack them in" by changing the admux registers
http://openenergymonitor.blogspot.fr/2012/08/low-level-adc-control-admux.html
Fun stuff :)
Cheers
Alex
Reply all
Reply to author
Forward
0 new messages