Changing Arduino Zero PWM Frequency

Hello MartinL,

love your work on the Zero, and I need your help as well.
I want to send a simple clock signal over port 2 with 8 MHz. The code I modified from yours is this:

REG_GCLK_GENDIV = GCLK_GENDIV_DIV(6) | GCLK_GENDIV_ID(4);
while (GCLK->STATUS.bit.SYNCBUSY);
REG_GCLK_GENCTRL = GCLK_GENCTRL_OE | GCLK_GENCTRL_IDC | GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_DFLL48M | GCLK_GENCTRL_ID(4);
while (GCLK->STATUS.bit.SYNCBUSY);
PORT->Group[g_APinDescription[2].ulPort].PINCFG[g_APinDescription[2].ulPin].bit.PMUXEN = 1;
PORT->Group[g_APinDescription[2].ulPort].PMUX[g_APinDescription[2].ulPin >> 1].reg |= PORT_PMUX_PMUXO_H;

I need the signal for communication with an IC, but it does not respond. I want to eliminate all possible error sources. Can you tell me what I need to change here?

Greetings, Rico