as my first project is going on I find some difficulty understanding and choosing the easiest codes/choices for both speed and accuracy of both reading of the A0 pin of my Nano v3.0 and writing to AnalogWrite() .
First question I probably already did errors: having started with Arduino since few weeks I thought settings all the outputs (even the not-PWM ones) of the Nano would have let me use the AnalogWrite() function for the "brightness" part for the LEDs so I already soldered the LEDS from pin 12, 10, 8, 6, 4, 2 to have a sort of dBm(VU) meter depending on the voltage reading on A0. So set OUTPUT to all the pins and used the functions, it gave me no errors and sort of work, but I was asking myself if it's actually using brightness values for the not-PWM pins or just a DigitalWrite() similar 0 to 5 volts output.
Second: the module I'm reading from, gives out a very fast 10ns voltages from around 2.10 to around 0.40 volts, linear decreasing depending on the increasing of dBm measured. As much as I can understand from these weeks of reading, soldering, burning my fingers during the pcb building :D, I'm just using the internal Vcc reference 5V as the usual sketch suggest. But this make quite some problems cause for both LEDs and possibly LCD, I need both accurated reading and very fast reading; I've measured like +/-0.05 volts differences from my multimeter with the 1023 readings of A0 (and feel like the whole read->write to LEDs is not fast enough for real time sensible feedbacks for the next question). So I understood I could use the INTERNAL 1.1 volts reference that seems a bit better if measured on AREF pin and coded inside the sketch for that Vin range, or an EXTERNAL one I'd buy and install on the PCB to set up for example a precise 2.50 volts to take values from.
Is the last one the best option? Cause if I use the INTERNAL and my range of voltages is about double that, will I need a "voltage divider" I can't easily install at this point on the project.. or I could just double the measured 1.044 volts (example) internal reference measured number * 2 and use the result as the range approximately similar to what I need?
Third: Speed of both reading and writing. I've seen there're different ways to increase reading speed of both reading and writing, register modifications, etc... but I can't really choose the easiest one to just code to have a something close to the 10ns variations I'd have to the input A0. What code/library would you suggest to easily increase the sensibility of A0 reading? And about the AnalogWrite() I'd have same problem for both LEDs or LCD that may or not even light up if the variation would be fast and I was thinking maybe I could sort of save the last peak value to still have the information at the next cycle.
EDIT: 10ns is not the right time, maybe 1.5us.
Thank you for any explanation I still need to understand about these. I've read that some kind of modifications at registers or lower level would change all the other timing possible values I'd need later.