How to utilize ADC Noise Reduction mode? #892
Replies: 5 comments
-
I should also say, in the README.md file, it says to just use analogRead_NR() instead of analogRead(), but when I do, I get the message: |
Beta Was this translation helpful? Give feedback.
-
I'm using the installed 1.5.2 ATTinyCore library and I see the Arduino.h is not the same as the one if I'm perusing the GitHub path to: The installed Arduino.h I'm thinking is what my system is using down in: has no mention of the analogRead_NR() function. I guess that returns to my original question: How do I set up my system to be able to use the analogRead_NR() capability for a Digispark Pro in the current Arduino environment (I'm running Arduino IDE 2.3.3)? |
Beta Was this translation helpful? Give feedback.
-
You are searching in the source code of AttinyCore V2.0.0 that is in development. In the V2.0.0 version analogRead_NR() compiles fine. You are using 1.5.2 , so you need to look in the sourcecode of that release analogRead_NR() is not present in that version. |
Beta Was this translation helpful? Give feedback.
-
Thanks for that insight. What are my options to take advantage of ADC Noise Reduction mode? Is the V2.0.0 version stable enough I can install and use that version? Do I need to write registers manually and do the equivalent of the analogRead_NR() function if I'm limited to version 1.5.2? Or ? |
Beta Was this translation helpful? Give feedback.
-
I have a separate portable installation of the IDE (1.8.13) just for Attinycore V2.0.0 You will have to do a manual installation of Attinycore afterwards. Then you have a totally separate second IDE, that will never interfere with whatever IDE version you have now. In fact the reason I probably will never upgrade to version 2 of the IDE, is that I have 14 different portable IDE versions on my PC all tuned to a specific purpose. The Arduino team decided in their wisdom that V2 of the IDE has no portable installation and they put a lock on the discussion thread where people asked for it. |
Beta Was this translation helpful? Give feedback.
-
Within the ATTinyCore Arduino environment, how do I go about doing an ADC conversion with the Noise Reduction mode enabled? I'm using a Digispark Pro board.
I see a reference in the Arduino.h file of:
#ifdef SLEEP_MODE_ADC
int analogRead_NR(uint8_t pin);
int _analogRead(uint8_t pin, bool use_noise_reduction);
#else
int _analogRead(uint8_t pin);
#endif
so, I think the capability is supported.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions