How do I change Registers for nano 33 iot

I need to increase the sample speed of the ADC and have learned enough to know I need to change the value of the SAMPCTRL register. I see lots of examples of people doing this kind of thing, but have been unable to figure it out. I don't have any code to show, as nothing I try does anything but generate errors. Can someone show this newby the basics of changing a register?

I found my own answer. Add this to setup:

#ifdef SAMD21_ADC_COMPONENT
ADC->CTRLB.bit.PRESCALER = ADC_CTRLB_PRESCALER_DIV32_Val;
#endif

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.