I want to create a very fast (fastest I can get) external oscillator with a MKR 1400 GSM.
With an Uno, this works, and generates a 8Mhz clock at pin 9…
DDRB |= (1 << 1); // Pin 9 is output TCCR1A = (1 << COM1A0) | (1 << WGM11) | (1 << WGM10); // Toggle OC1A compare match TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS10); // Clock select with no prescaler OCR1A = 0; // Match on 0 for fastest output (8Mhz).
How would I go about doing something similar with the MKR 1400 GSM? I’m looking at section 31 (page 704+) in the datasheet, but this is the first time I’m using a SAMD21 and am considerably confused. I’m also not sure how to get the output to a pin and which pin.
Anyone have example code that will do this?