In the setting of the timer counter interrupt is not included.

Prompt please, what settings timer-counter in my program is not so. Settings sketched, maximum identical, with musical examples Arduino. No compilation of comments, but on-board Arduino Due not included interruption. In the program reads the input pulse duration for any differential input pulse.

volatile static int32_t counter1; /* ?????????? - ??????? ????????? ???????? 1 */

// ????????? ??????-??????? 0 ? ??? ????? 1

define WORK_TIMER TC0

define INPUT_CHNL 1

define INPUT_IRQ TC1_IRQn

static Tc chTC = WORK_TIMER; static uint32_t chNo = INPUT_CHNL; static uint32_t in_pin; / ?????? A7 ??? ??????? ???? PA2 in_pin - 85 ????? */

// ??????????? 1 ?????: ???????????? ???????? ??????? 32, ??? ????????? ?????? ???????? ???????? ?????? ???????? ? ??????? ? void set_timer1 (uint32_t ulPin) { pmc_set_writeprotect(false); pmc_enable_periph_clk((uint32_t)INPUT_IRQ); TC_Configure(chTC, chNo, TC_CMR_TCCLKS_TIMER_CLOCK3 | TC_CMR_LDRA_EDGE); chTC->TC_CHANNEL[chNo].TC_IER=TC_IER_LDRAS; chTC->TC_CHANNEL[chNo].TC_IDR=~TC_IER_LDRAS; NVIC_EnableIRQ(INPUT_IRQ); in_pin = ulPin; // ????????? A7 ??? ??????? ???? PA2 ?? ???? pinMode (in_pin, INPUT); }

void setup() { // put your setup code here, to run once: counter1 = 0; Serial.begin(9600); set_timer1 (A7); }

void loop() { // put your main code here, to run repeatedly: if (counter1 != 0) { Serial.println(counter1); counter1 = 0; } }

void TC1_Handler (void) { TC_GetStatus(TC0, 1); TC_Stop(chTC, chNo); counter1 = TC0->TC_CHANNEL[1].TC_RA; TC_Start(chTC, chNo); }