Help with Timer Register on DUE for creating kHz clock

I am trying to transition a project from an UNO to a DUE.
To my surprise the DUE is a completely different beast.
Any timers that were coded for the UNO no longer work.
I figured I would give it a go myself but the Registers in the DUE are so much more complex and confusing.
I have been staring at the Atmel SAM3X data sheet with a gaping jaw.

I wanted to reverse engineer what was happening in the snippet below (which works well):

// Output a xxkHz PWM waveform at a resolution of 11-bits on pin DAC1 (PWML0)
void setup() {
  // PWM Set-up on pin: DAC1
  REG_PMC_PCER1 |= PMC_PCER1_PID36;                 // Enable PWM 
  REG_PIOB_ABSR |= PIO_ABSR_P16;                       // Set PWM pin perhipheral type A or B, in this case B
  REG_PIOB_PDR |= PIO_PDR_P16;                           // Set PWM pin to an output
  REG_PWM_CLK = PWM_CLK_PREA(0) | PWM_CLK_DIVA(1);      // Set the PWM clock rate to 84MHz (84MHz/1) 
  REG_PWM_CMR0 = PWM_CMR_CPRE_CLKA;            // Enable single slope PWM and set the clock source as CLKA
  REG_PWM_CPRD0 = 808;                                       // Set the PWM frequency 
  REG_PWM_CDTY0 = 404;                                       // Set the PWM duty cycle 
  REG_PWM_ENA = PWM_ENA_CHID0;                      // Enable the PWM channel     
}

This code snippet was posted by MartinL.
My needs are simple. I would like to have two distinct clocks on any two pins (except AN0 & AN1).
They will be fixed frequencies of approx 104khz and 150khz used to drive two external IC's. I understand that the frequencies will not be exactly 104 and 150 due to resolution.
I was able to use the snippet above to make one clock work but I cannot figure out what to copy and edit to make a second clock. Any changes I made did not produce any output. The documentation is really unclear for a novice like myself.

Thanks

If you feel it's too challenging to start with direct register programming, pwm_lib and tc_lib from antodom are for you:

plus the Graynomad pinout diagram.

ard_newbie:
If you feel it’s too challenging to start with direct register programming, pwm_lib and tc_lib from antodom are for you:

I did give the library a whirl.
With the example code I found that the duty cycle would change over time for reasons I cannot explain.
I would literally watch the duty cycle go from 10 to 20 to 30 percent and gradually continue grow.
I really did not change anything in the example code besides the frequency.
Maybe my duty cycle numbers are illegal?

#define PWM_PERIOD_PIN_35 608 // hundredth of usecs (1e-8 secs)    
#define PWM_DUTY_PIN_35 10 // 10 usecs in hundredth of usecs (1e-8 secs)

#define PWM_PERIOD_PIN_42 860 // 20 msecs in hundredth of usecs (1e-8 secs)
#define PWM_DUTY_PIN_42 10 // 1000 msecs in hundredth of usecs (1e-8 secs)

I am not sure I want to chase this library rabbit down its hole when the clocks I am looking to set will never change. Using the direct register program made a rock solid clock.

Post the code you are actually using.

ard_newbie:
Post the code you are actually using.

Here it is. I removed the probing library and associated lines in the demo file as I won’t need it.
I am also unclear on what “Duty Keeping Time” is in the LOOP.
Are additional delays from actual code in the LOOP going to effect the final output of the clocks?

Thanks

#include "pwm_lib.h"

using namespace arduino_due::pwm_lib;

#define PWM_PERIOD_PIN_35 608 // hundredth of usecs (1e-8 secs)    961=104kHz 607=165 kHz
#define PWM_DUTY_PIN_35 10 // 10 usecs in hundredth of usecs (1e-8 secs)

#define PWM_PERIOD_PIN_42 960 // 20 msecs in hundredth of usecs (1e-8 secs)
#define PWM_DUTY_PIN_42 10 // 1000 msecs in hundredth of usecs (1e-8 secs)

#define CAPTURE_TIME_WINDOW 40000 // usecs
#define DUTY_KEEPING_TIME 1000 // msecs

pwm<pwm_pin::PWMH0_PC3> pwm_pin35;

pwm<pwm_pin::PWMH1_PA19> pwm_pin42;


void setup() 
{
  // put your setup code here, to run once:

  // starting PWM signals
  pwm_pin35.start(PWM_PERIOD_PIN_35,PWM_DUTY_PIN_35);
  pwm_pin42.start(PWM_PERIOD_PIN_42,PWM_DUTY_PIN_42);
}


// FIX: function template change_duty is defined in
// #define to avoid it to be considered a function
// prototype when integrating all .ino files in one
// whole .cpp file. Without this trick the compiler
// complains about the definition of the template
// function.

#define change_duty_definition \
template<typename pwm_type> void change_duty( \
  pwm_type& pwm_obj, \
  uint32_t pwm_duty, \
  uint32_t pwm_period \
) \
{ \
  uint32_t duty=pwm_obj.get_duty()+pwm_duty; \
  if(duty>pwm_period) duty=pwm_duty; \
  pwm_obj.set_duty(duty); \
}

// FIX: here we instantiate the template definition
// of change_duty
change_duty_definition;

void loop() 
{
  // put your main code here,to run repeatedly:

  delay(DUTY_KEEPING_TIME);

  uint32_t status,duty,period;

   // changing duty in pwm output pin 35 
  change_duty(pwm_pin35,PWM_DUTY_PIN_35,PWM_PERIOD_PIN_35);

  // changing duty in pwm output pin 42 
  change_duty(pwm_pin42,PWM_DUTY_PIN_42,PWM_PERIOD_PIN_42);
}