RX13T MTU3-interrupt for simple PWM

Hi everybody,

I'm kind of stuck with trying to get a simple PWM out of P71/MTIOC3B with an RX13T,
and reading the hardware manual "R01UH0822EJ0100 Rev.1.00" didn't help me to get it working.

Below I describe what I was thinking and how I tried. Can someone help me to get it working, or
explain why it can't work?

Of course there is not a standard way to do this, as 19. Multi-Function Timer Pulse Unit 3 (MTU3c) says:

  1. PWM mode 1: MTIOC3A and MTIOC3C pins, with TGR3B and TGR3D used as buffer registers.
  2. PWM mode 2: not possible with MTU3
  3. Reset-synchronized PWM: 3-phase of positive and negative PWM waveforms: I don't want to loose MTU4.
  4. Complementary PWM mode with or without dead time output: looks too complicated for simple PWM.
  5. Brushless DC motor control setting: also looks too complicated for simple PWM.

Because I'm using PB7/MTIOC3C as RxD1-pin the obvious choice seemed to simulate PWM as follows:

  • TGR3B as compare match, init high, low on match and output on MTIOC3B.
  • TCNT3 as periodic counter, with TGR3C counter clear and interrupt on match.
    The interrupt would be used to stop TCNT3, reset it to get the init-value on MTIOC3B-pin, and restart.
  • Changing the duty-cycle could be done on the fly (with possible glitches) or in the interrupt routine.

Several problems had to be overcome, apart from the obvious PDR-bit to 1, PFS-function to 1 and PMR-bit to 1:

  1. Nothing happens on the pin as there is a MTU.TOERA-register disabling MTU3 and MTU4 output.
  2. Nothing happens on the pin as there is a POE.POECR2-register holding the pins in high-impedance state.

After setting a bit in the first and clearing a bit in the second register I got one change in output, as expected,
but no interrupt to get it back. When using high-toggle as MTIOC3B-setting I could verify that the counter was
reset by changing the TGR3C-setting to change the output frequency, but no interrupt.

At this moment I have no clue why the interrupt doesn't happen and the day I thought would be well enough
for getting it working has passed without the pin working as expected.

What did I do wrong, or is it just not possible with that pin?