SAMC21 XPLAINED Issue

Moderator: nferre

kevingrumble
Posts: 1
Joined: Tue Aug 04, 2015 7:48 pm

SAMC21 XPLAINED Issue

Tue Aug 04, 2015 8:15 pm

I've bought a SAMC21 XPLAINED development board to begin learning how to program with ARM microcontrollers and I've run in to an issue with the clock settings. I'm trying to set the OSC48 divisor by writing 0x00 to the OSC48MDIV register. When I start a debugging session I lose my PC and the ability to connect to the board within about 3 instructions of writing the value to the register. I don't see anything in the datasheet that suggests that the OSC48M isn't meant to be clocked at 48MHz. Code below shows the issue I am encountering.

// Setup MCLK & GCLK
OSCCTRL_OSC48MDIV = 0x00;
MCLK_CPUDIV = 0x00;
MCLK_AHBMASK = 0x00001FFF;
MCLK_APBAMASK = 0x00001FFF;
MCLK_APBBMASK = 0x00000027;
MCLK_APBCMASK = 0x00FFFE7F;

GCLK_GENCTRL(0) = 0x00000106;

while (!(MCLK_INTFLAG & 0x01) && GCLK_SYNCBUSY);

Thank you for any help!

Return to “SAM9-based”

Who is online

Users browsing this forum: No registered users and 1 guest