XIAO RA4M1 Examples for timer interrupts?

Hello all,

two questions about RA4M1:

  1. Are there any examples for timer interrupts with RA4M1?
  2. More than a year ago I reported that the RA4M1 had too much noise in the ADC results, and Seeed figured out that’s because of too much noise on the ADC’s power supply. “We changed the R4 from 0Ω to 15Ω”. But this has never been changed in the schematic diagram. When I order new RA4M1 modules now, do they have the 15R resistor?

Thanks, Michael

For timer interrupts on the RA4M1, the Renesas FSP has a few basic GPT timer examples that are worth a look—they translate pretty cleanly even if you’re not using the full FSP stack. On the ADC noise issue, from what I’ve seen Seeed did update the hardware on newer batches, but the schematic never got updated publicly. If it’s critical, the safest bet is to visually check the resistor or ask Seeed support to confirm which revision you’re getting.

1 Like

The schematic diagram for RA4M1 has now disappeared from the website.
Renesas FSP sounds awfully complicated. I found another example for timer interrupts with RA4M1:

#include "FspTimer.h"

FspTimer timer;

void timer_callback(timer_callback_args_t __attribute((unused)) *p_args) {
  R_PORT0->POSR = bit(14);   // D0 = 1    83ns
  R_PORT0->PORR = bit(14);   // D0 = 0    83ns
}

void setup() {
  pinMode(D0,OUTPUT);      // test pin  
  pinMode(D1,OUTPUT);      // test pin    

  uint8_t timer_type = GPT_TIMER;
  int8_t tindex = FspTimer::get_available_timer(timer_type);

  timer.begin(TIMER_MODE_PERIODIC, timer_type, tindex, 100000.0f, 0.0f, timer_callback);
    
  timer.setup_overflow_irq();  
  timer.open();
  timer.start();
}

void loop()
{   
  R_PORT0->POSR = bit(0);    // D1 = 1    83ns
  R_PORT0->PORR = bit(0);    // D1 = 0    83ns
  R_PORT0->POSR = bit(0);    // D1 = 1    83ns
  R_PORT0->PORR = bit(0);    // D1 = 0    83ns
  R_PORT0->POSR = bit(0);    // D1 = 1    83ns
  R_PORT0->PORR = bit(0);    // D1 = 0    83ns
  R_PORT0->POSR = bit(0);    // D1 = 1    83ns
  R_PORT0->PORR = bit(0);    // D1 = 0    83ns
}