Using multiple IRQ and PDCA channels

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to use PDCA (DMA transfer) with the UART, SPI, and TWI at the same time, all interrupt driven. But I'm having some weird problem where the IRQ numbers and PDCA channels I select don't work unless I pick just the right combinations. Is there some magic recipe for selecting the IRQ and PDCA channel numbers for each PDCA?

The symptoms I'm having are glitchy or unreliable execution.

Is there documentation on using PDCA and interrupts?

Here are the IRQ and PDCA numbers I'm using.


/****************************************************************************/
// PDCA
/****************************************************************************/
//! The channel instance for the USART example, here PDCA channel 0 (highest priority).
#define PDCA_CHANNEL_SPI_RX 	0	
#define PDCA_CHANNEL_SPI_TX 	1
#define PDCA_CHANNEL_TWI 	2
#define PDCA_CHANNEL_USART_RX 	3
#define PDCA_CHANNEL_USART_TX 	4


/****************************************************************************/
// Interrupts
/****************************************************************************/
// PDCA Lines (IRQ) - These must match the PDCA channel number (Not sure why)
#define INT_LINE_PDCA_SPI_RX		AVR32_PDCA_IRQ_0
#define INT_LINE_PDCA_SPI_TX		AVR32_PDCA_IRQ_1
#define INT_LINE_PDCA_TWI			AVR32_PDCA_IRQ_2
#define INT_LINE_PDCA_USART_RX		AVR32_PDCA_IRQ_3
#define INT_LINE_PDCA_USART_TX		AVR32_PDCA_IRQ_4

// Priorities (Interrupt Level)
#define INT_PRIORITY_USART1			AVR32_INTC_INT1
#define INT_PRIORITY_PDCA_USART_RX	AVR32_INTC_INT2
#define INT_PRIORITY_PDCA_USART_TX	AVR32_INTC_INT2
#define INT_PRIORITY_PDCA_SPI		AVR32_INTC_INT1
#define INT_PRIORITY_PDCA_TWI		AVR32_INTC_INT1

Walt

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you using both RX and TX of the TWI? If so, you need a separate PDCA channel for each.

Letting the smoke out since 1978