I want to use Due Timer Counter to generate high frequency on TIOA1 which is PA2 or Due pin A7. TIOA1 is on TC0 channel 1, peripheral A, ID=28.
The code to achieve this is:
PMC->PMC_PCER0 = PMC_PCER0_PID28; // clock enable TC1 with ID=28
PIOA->PIO_ABSR &= !PIO_ABSR_P2; // multiplexer pin PA2 to peripheral A for TIOA1
PIOA->PIO_PDR = PIO_PDR_P2; // deactivate GPIO on Pin PA2 (TIOA1)
TC0->TC_CHANNEL[1].TC_CMR = TC_CMR_TCCLKS_TIMER_CLOCK1 | TC_CMR_WAVE |
TC_CMR_WAVSEL_UP_RC | TC_CMR_ACPC_TOGGLE;
TC0->TC_CHANNEL[1].TC_RC = 1; // max. frequency
TC0->TC_CHANNEL[1].TC_CCR = TC_CCR_CLKEN;
There is no clock at all on Pin A7 (measued with an oscilloscope).