Timer capture with the "B" pins

I am trying to get timer capture to work with the "B" pins (TIOB0, TIOB1, etc) but I seem to be missing a step and I could really use some help figuring out just what I'm missing.

I've started with the sample code posted here by drm0hr...
http://forum.arduino.cc/index.php?topic=167763.0

However I have simplified it so that it just captures RA and RB and prints their values. I've gotten it to work with TIOA0, TIOA1, and TIOA6. But I haven't gotten it to work with TIOB0, TIOB1, or TIOB2. My only guess was that I might be missing a call to set the A/B select register (ABSR) however PIO_Configure() calls into PIO_SetPeripheral() which seems to do that. So, I'm stumped.

The code I'm using now is below. You'll notice some blocks of #define macros are commented out - uncommenting the ones for the TIOA pins works great. But using the one for pin 60 / TIOB1 doesn't work. According to variant.cpp, pin 60 can be assigned to ADC6 or TC0_CHB1.

Can anyone tell me what I'm doing wrong here?

Thanks!

// Derived from a post by drm0hr at http://forum.arduino.cc/index.php?topic=167763.0

/*
* PWM Capture using Arduino Due Timer Counters
*
* Available channels:
*   TC    Chan   NVIC irq   Handler       PMC ID   Arduino Pin
*   TC0   0      TC0_IRQn   TC0_Handler   ID_TC0   D2     (TIOA0) TIOB0 = D13
*   TC0   1      TC1_IRQn   TC1_Handler   ID_TC1   D61/A7 (TIOA1) TIOB1 = A6 aka D60
*   TC0   2      TC2_IRQn   TC2_Handler   ID_TC2   TIOA2 N/C      TIOB2 = A4 aka D58
*   TC2   0      TC6_IRQn   TC6_Handler   ID_TC6   D5     (TIOA6) 
*   TC2   1      TC7_IRQn   TC7_Handler   ID_TC7   D3     (TIOA7)
*   TC2   2      TC8_IRQn   TC8_Handler   ID_TC8   D11    (TIOA8)
*
* Change the following defines to use different channels as input.
*
*/

// PIN 2 / TIOA0 - PROVEN
/*
#define CAPTURE_TC TC0
#define CAPTURE_CHANNEL 0
#define CAPTURE_IRQn TC0_IRQn
#define CAPTURE_Handler TC0_Handler
#define CAPTURE_ID ID_TC0
#define CAPTURE_PIN 2
#define CAPTURE_CLOCK_SELECTION TC_CMR_TCCLKS_TIMER_CLOCK3
*/

// PIN 61 / A7 / TIOA1 - PROVEN
/*
#define CAPTURE_TC TC0
#define CAPTURE_CHANNEL 1
#define CAPTURE_IRQn TC1_IRQn
#define CAPTURE_Handler TC1_Handler
#define CAPTURE_ID ID_TC1
#define CAPTURE_PIN 61
#define CAPTURE_CLOCK_SELECTION TC_CMR_TCCLKS_TIMER_CLOCK3
*/

// PIN 5 / TIOA6  - PROVEN
/*
#define CAPTURE_TC TC2
#define CAPTURE_CHANNEL 0
#define CAPTURE_IRQn TC6_IRQn
#define CAPTURE_Handler TC6_Handler
#define CAPTURE_ID ID_TC6
#define CAPTURE_PIN 5
#define CAPTURE_CLOCK_SELECTION TC_CMR_TCCLKS_TIMER_CLOCK3
*/

// PIN 60 / A6 / TIOB1 - BROKEN

#define CAPTURE_TC TC0
#define CAPTURE_CHANNEL 1
#define CAPTURE_IRQn TC1_IRQn
#define CAPTURE_Handler TC1_Handler
#define CAPTURE_ID ID_TC1
#define CAPTURE_PIN 60
#define CAPTURE_CLOCK_SELECTION TC_CMR_TCCLKS_TIMER_CLOCK3


// clock divisors corresponding to CAPTURE_CLOCK_SELECTION
static const uint32_t divisors[5] = { 2, 8, 32, 128, 0 };

volatile uint32_t captured_pulses = 0;
volatile uint32_t captured_ra = 0;
volatile uint32_t captured_rb = 0;

// timer interrupt handle
void CAPTURE_Handler() {
 if ((TC_GetStatus(CAPTURE_TC, CAPTURE_CHANNEL) & TC_SR_LDRBS) == TC_SR_LDRBS) {
 captured_pulses++;
 captured_ra = CAPTURE_TC->TC_CHANNEL[CAPTURE_CHANNEL].TC_RA;
 captured_rb = CAPTURE_TC->TC_CHANNEL[CAPTURE_CHANNEL].TC_RB;
 }
}


void setup() {
 Serial.begin(57600);
 Serial.print("Initializing...");

 // configure the PIO pin as peripheral
 // (Note that PIO_Configure also enables PIO_PULLUP for peripherals.)
 const PinDescription *config = &g_APinDescription[CAPTURE_PIN];
 PIO_Configure(
 config->pPort,
 config->ulPinType,
 config->ulPin,
 config->ulPinConfiguration 
 );

 // enable timer peripheral clock
 pmc_enable_periph_clk(CAPTURE_ID);

 // configure the timer
 TC_Configure(CAPTURE_TC, CAPTURE_CHANNEL,
 CAPTURE_CLOCK_SELECTION /* Clock Selection */
 | TC_CMR_LDRA_FALLING /* RA Loading: falling edge of the input signal */
 | TC_CMR_LDRB_RISING /* RB Loading: rising edge of the input signal */
 );

 // configure TC interrupts
 NVIC_DisableIRQ(CAPTURE_IRQn);
 NVIC_ClearPendingIRQ(CAPTURE_IRQn);
 NVIC_SetPriority(CAPTURE_IRQn, 0);
 NVIC_EnableIRQ(CAPTURE_IRQn);

 // enable interrupts
 CAPTURE_TC->TC_CHANNEL[CAPTURE_CHANNEL].TC_IER = TC_IER_LDRBS;

 Serial.println("ready!");
}

uint iteration;

void loop() {
 iteration++;

 captured_pulses = 0;
 captured_ra = 0;
 captured_rb = 0;

 CAPTURE_TC->TC_CHANNEL[CAPTURE_CHANNEL].TC_CCR = TC_CCR_CLKEN | TC_CCR_SWTRG;
 delay(2000);
 
 Serial.print("Iteration "); Serial.print(iteration);
 Serial.print(", pulses = "); Serial.print(captured_pulses);
 Serial.print(", RA = "); Serial.print(captured_ra);
 Serial.print(", RB = "); Serial.print(captured_rb);
 Serial.println("");
}

After looking at the data sheet more closely... The B lines can only be used to trigger the timer. Capture is only supported with the A lines.

Somehow I got the idea that the A or B lines could be used for capture, based on the A/B select register (ABSR) but that is not actually the case.