I am using the ATMEL SAM3x8e chip on an Arduino Due. I want to generate two pulses of frequency 100 kHz of the pattern shown below (1 period shown). For this I used TIOA8 and TIOA0 lines in the UPDOWN_RC mode and UP_RC mode. I see that the blue wave is very similar to an example waveform on TIOA shown on Pg.870 of the ATMEL datasheet.
My code is as follows, but I don't see any outputs on any of the two pins. What am I missing here? I deliberately didn't include the TCx_Handler() functions since I only want to generate the pulses and don't need any actions on interrupts.
void setup(){
//Waveform on TIOA8 i.e TC2 Ch2, pin no Port D.7 pin D11
PMC->PMC_PCER1 |= PMC_PCER1_PID35;
PIOD->PIO_PDR |= PIO_PDR_P7; //Disable GPIO on D.7
PIOD->PIO_ABSR |= PIO_PD7B_TIOA8;
TC2->TC_CHANNEL[2].TC_CMR = TC_CMR_TCCLKS_TIMER_CLOCK1
| TC_CMR_WAVE
| TC_CMR_WAVESEL_UP_RC
| TC_CMR_ACPA_CLEAR
| TC_CMR_ACPC_SET;
TC2->TC_CHANNEL[2].TC_RC = 420; //100 kHz frequency, sawtooth waveform
TC2->TC_CHANNEL[2].TC_RA = 218; //Calculated corresponding to RC
////////////////////////////////////////////////////
//Waveform on TIOA0 FOR SWITCH S1
PMC->PMC_PCER0 |= PMC_PCER0_PID27; //TC0 CH0
PIOB->PIO_PDR |= PIO_PDR_P25; //Disable GPIO on B.25
PIOB->PIO_ABSR |= PIO_ABSR_P25;
TC0->TC_CHANNEL[0].TC_CMR = TC_CMR_ACPA_TOGGLE |
TC_CMR_WAVE |
TC_CMR_WAVESEL_UPDOWN_RC |
TC_CMR_TCCLKS_TIMER_CLOCK1;
}
void loop(){}