I have recently bought an Arduino Nano RP2040 connect and I want to see if I can replace the normal Arduino Nano with the new board to improve the performance of my datalogging applications
One issue I am having however is finding a list of available MACROs or equivalents online for using the RP2040 connect. For example, if I'm using the normal Nano, which is based on the Atmega328p, I know I can use the following registers:
ADMUX - Choose ADC channel and ref voltage, set final 4 bits to 1000 for temp sensor
ADCSRA - Can be used to enable/disable ADC by setting ADEN bit high/low
PRR - Power reduction register, disable clock to certain peripherals to save power
SMCR - Choose the mode the Atmega328p uses when the device goes to sleep
MCUCR - Can be used to enable/disable BOD before going to power-down sleep mode
which are all defined as MACROs within the Arduino IDE. So for example, I can measure the internal temperature of the Atmega328p's temperature sensor using:
ADMUX = bit (REFS0) | bit (REFS1) | 0x08; //use internal temperature sensor bitSet (ADCSRA, ADSC); //start a conversion while (bit_is_set(ADCSRA, ADSC)); //wait for it to finish uint16_t temp_10bit = ADC; //read 10-bit value from ADC register
So, if I wanted to have the same level of control on the RP2040 connect, and achieve all that is detailed above, will I just have to skim through the RP2040 datasheet?
I'm willing to put the work in if that's the case, it would just be nice to know if there is a link or page somewhere where examples are available for new users.