Weact.Studio 64Pin RA4M1 (Uno R4 minima"-clone") Pin-mapping

As described in this thread

I managed to flash the Uno R4 minima Bootloader into these weact.Studio 64 Pin Renesas RA4M1 boards which use the same microcontroller as the Arduino Uno R4-boards

And did a basic "Serial print "Hello World" test.

Next step is to test the IO-pins. These boards have a blue onboard LED. But I do not yet know which IO-pin this is.

I looked up the schematic of the Uno R4

And I guess the


LED is the onboard-LED.

On the schematic the IO-pin is named "P111" but what Arduino-IDE IO-pin number is this?
Where can I look the pin-mapping processor pin XYZ is Arduino-IO-Pin nr.

best regards Stefan

You can see from the schematic:

D13

its D13 ( or LED_BUILTIN )
But if it's the same on your board?
I think the layout of your board is very different from UNO R4.

Weact has a schematic on GitHub

The blue onboard-LED is connected to "P012"
image

On the chip itself this is here
image

Now I need to find the maybe you can call it a translation-table from Renesas Port and bit-number to the numbers used in the Arduino-IDE.
I tried to look up this in the core-files but I did not find anything useful yet
Inside digital.cpp there is f.e. pinMode()

void pinMode(pin_size_t pin, const PinMode mode) {
	switch (mode) {
		case INPUT:
		case INPUT_PULLDOWN: // TODO: document the INPUT_PULLDOWN is unavailable
			R_IOPORT_PinCfg(NULL, g_pin_cfg[pin].pin, IOPORT_CFG_PORT_DIRECTION_INPUT);

which uses an array

g_pin_cfg[pin].pin

standard code for blinking did not work
I found this "arduino" demo-code for blink.
Looks very different from Arduino-Standards

These are the functions and pin-definitions of the Renesas HAL. If you want to use the 'standard' Arduino calls you probably need to create your own 'variant' of the R4 boards and add it to the boards.txt ( there are two already: MINIMA and UNOWIFIR4 ).
(...\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5)
E.g. the mapping of Renesas-Pins to Arduino pins for the R4 Minima is done in ...\1.0.5\variants\MINIMA\variant.cpp::

extern "C" const PinMuxCfg_t g_pin_cfg[] = { 
  { BSP_IO_PORT_03_PIN_01,    P301   }, /* (0) D0  -------------------------  DIGITAL  */
  { BSP_IO_PORT_03_PIN_02,    P302   }, /* (1) D1  */
  { BSP_IO_PORT_01_PIN_05,    P105   }, /* (2) D2  */
  { BSP_IO_PORT_01_PIN_04,    P104   }, /* (3) D3~ */
  { BSP_IO_PORT_01_PIN_03,    P103   }, /* (4) D4  */
  { BSP_IO_PORT_01_PIN_02,    P102   }, /* (5) D5~ */
  { BSP_IO_PORT_01_PIN_06,    P106   }, /* (6) D6~ */
  { BSP_IO_PORT_01_PIN_07,    P107   }, /* (7) D7  */
  { BSP_IO_PORT_03_PIN_04,    P304   }, /* (8) D8  */
  { BSP_IO_PORT_03_PIN_03,    P303   }, /* (9) D9~  */
  { BSP_IO_PORT_01_PIN_12,    P112   }, /* (10) D10~ */
  { BSP_IO_PORT_01_PIN_09,    P109   }, /* (11) D11~ */
  { BSP_IO_PORT_01_PIN_10,    P110   }, /* (12) D12 */
  { BSP_IO_PORT_01_PIN_11,    P111   }, /* (13) D13 */
  { BSP_IO_PORT_00_PIN_14,    P014   }, /* (14) A0  --------------------------  ANALOG  */
  { BSP_IO_PORT_00_PIN_00,    P000   }, /* (15) A1  */
  { BSP_IO_PORT_00_PIN_01,    P001   }, /* (16) A2  */
  { BSP_IO_PORT_00_PIN_02,    P002   }, /* (17) A3  */
  { BSP_IO_PORT_01_PIN_01,    P101   }, /* (18) A4/SDA  */
  { BSP_IO_PORT_01_PIN_00,    P100   }, /* (19) A5/SCL  */

  { BSP_IO_PORT_05_PIN_00,    P500   }, /* (20) Analog voltage measure pin  */
  { BSP_IO_PORT_00_PIN_12,    P012   }, /* (21) TX LED  */
  { BSP_IO_PORT_00_PIN_13,    P013   }, /* (22) RX LED  */

  { BSP_IO_PORT_05_PIN_01,    P501   }, /* (23) TX on SWD connector  */
  { BSP_IO_PORT_05_PIN_02,    P502   }, /* (24) RX on SWD connector  */
  { BSP_IO_PORT_01_PIN_08,    P108   }, /* (25) SWDIO  */
  { BSP_IO_PORT_03_PIN_00,    P300   }, /* (26) SWCLK  */
};

But there maybe more to do ...

[EDIT] The board you bought isn't a "clone", but a completely different board, only with the same processor. So it's a 'variant' :wink:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.