Arduino Forum

Products => Arduino Due => Topic started by: joeblogs on May 26, 2017, 05:53 am

Title: NVIC_EnableIRQ(PIOD_IRQn) disables serial
Post by: joeblogs on May 26, 2017, 05:53 am
Hey
if the serial monitor (Serial) uses the following pins on the due

PIO_PA8   // PIN 0, URXD
PIO_PA9   // PIN 1, UTXD

why would enabling the port D interrupt stop serial. ie NVIC_EnableIRQ(PIOD_IRQn)
Title: Re: NVIC_EnableIRQ(PIOD_IRQn) disables serial
Post by: ard_newbie on May 26, 2017, 06:29 am

Enabling PIOD interrupt doesn't stop Serial.
Title: Re: NVIC_EnableIRQ(PIOD_IRQn) disables serial
Post by: joeblogs on May 26, 2017, 06:42 am

sorry it was writing to PIO_IER that is causing the issues

Code: [Select]


void InputRecorder::enable_trig_interrupts()
{
TRIG_PIN_PORT->PIO_IDR = 0xFFFFFFFF;

//TRIG_PIN_PORT->PIO_IER |= PIO_PB12;   <--- swapped to b port, this was the offending line

if(actv_trigs[0] != 0)
{
pmc_enable_periph_clk(TRIG_PMC_CLK_ID);
trigs_are_enabled = true;
NVIC_EnableIRQ(TRIG_PORT_IRQ);
}

}