Skip to content

RL78G22 Fast Prototyping Board pin list

SuguruHarada edited this page May 30, 2025 · 8 revisions

RL78/G22 Fast Prototyping Board

Description

  • The RL78/G22 Fast Prototyping Board is provided with interface pins for Arduino Uno conversion.

1. pinlist

  • A pin list of the RL78/G22 Fast Prototyping Board is shown below.
RL78/G22 port Number Pin Name Arduino Pin Number(Digital IO) Arduino Uno I/F MCU header Pmod I/F Grove I/F Analog IO PWM Serial Wire SPI Interrupt Tone PulseIn ShiftIn ShiftOut Servo Stepper LED User Switch
P01 0 0 - - - - RxD1 - - - - - -
P00 1 1 - - - - TxD1 - - - - - -
P140 ~2 2 - - - - - - 0 - - -
P31 ~3 3 - - - - - 1 - -
P120 4 4 - - - - - - - - - -
P41 ~5 5 - - - - - - - -
P10 ~6 6 - - - - - - - - - - -
P146 7 7 - - - - - - - - - - -
P30 8 8 - - - - - - - - - - - - - - - - - -
P17 ~9 9 - - - - - - - -
P16 ~10 10 - - - - SS 2 - -
P13 ~11 11 - - - - TxD2 - MOSI - - - -
P14 12 12 - - - - RxD2 - MISO - - - -
P15 13 13 - - - - - SCK - - - -
P62 - 14 - - - - - - - - - - LED1 -
P63 - 15 - - - - - - - - - - LED2 -
P75 - 16 - - - - - SCL1 - - - - -
P74 - 17 - - - - - SDA1 - - - - -
P73 - 18 - - - - - - - - - - -
P72 - 19 - - - - TxDA0 - - - - - -
P71 - 20 - - - - RxDA0 - - - - - -
P70 - 21 - - - - - - - - - - -
P50 - 22 - - - - - - - - - - -
P51 - 23 - - - - - - - - - - -
P12 - 24 - - - - - TxD0 - - - - - -
P11 - 25 - - - - - RxD0 - - - - - -
P22 - 26 - - - - - - - - - - - - - - - - - -
P21 - 27 - - - - - - - - - - - - - - - - -
P130(※3) - 28 - - - - - - - - - - - - -
P40 - 29 - - - - - - - - - - - -
P124 - 30 - - - - - - - - - - - - - - - - - -
P123 - 31 - - - - - - - - - - - - - - - - - -
P137(※2) - 32 - - - - - - - - 3 - - - - - SW
P122 - 33 - - - - - - - - - - - -
P121 - 34 - - - - - - - - - - - -
P20(※1) AREF 35 - - - - - - - - - - - - - - - -
P60 SCL 36 - - - - SCL0 - - - - - - - - - -
P61 SDA 37 - - - - SDA0 - - - - - - - - - -
P147 A0 38 - - A0 - - - - - - - -
P27 A1 39 - - A1 - - - - - - - -
P26 A2 40 - - - - - - - - - - - - - - - - - -
P25 A3 41 - - - - - - - - - - - - - - - - - -
P24 A4 42 - - - - - - - - - - - - - - - - - -
P23 A5 43 - - - - - - - - - - - - - - - - - -
- VDD(IOREF) - - - - - - - - - - - - - - -
- RESET - - - - - - - - - - - - - - - - -
- 3V3 - - - - - - - - - - - - - - - - - -
- 5V - - - - - - - - - - - - - - - - - -
- GND - - - - - - - - - - - - - - -
- VIN - - - - - - - - - - - - - - - - - -
  • (※1) External reference voltage supply pin.
  • (※2) Pin 28 (P130) is an output-only port, so the INPUT setting cannot be used.
  • (※3) Pin 32 (P137) is an input-only port, so the OUTPUT setting cannot be used.

2. Functions

  • The functions of the RL78/G22 Fast Prototyping Board are listed below.
No. Name Function
1 Digital IO 33 Digital input pins / 27 Digital input_pullup pins / 31 Digital output pins
2 Analog IO 2 Analog input pins
3 PWM 4 PWM output pins(※3)
4 Serial(UART) 4 Serial(UART) channels(※1)(※2)
5 SoftwareSerial 4 RX pins / 31 TX pins
6 Wire(I2C) 2 Wire(I2C) channels
7 SPI 1 SPI channel(※2)
8 Interrupt 4 Interrupt pins
9 Tone 4 Tone output pins(※3)
10 PulseIn 33 Pulse Input pins
11 PulseInLong 33 Pulse Input pins
12 ShiftIn 31 Clock output pins / 33 Data input pins
13 ShiftOut 31 Clock output pins / 31 Data output pins
14 Servo 31 Servo output pins
15 Stepper 31 Stepper output pins
16 LED 2 on Board LED (pin 14 and pin 15)(※4)
17 User Switch 1 on Board User Switch (pin 32)(※5)
  • (※1) Serial(RxD0, TxD0) connects to a Micro-USB connector via a USB-serial converter.

  • (※2) Serial2 cannot be used simultaneously with the SPI channel.

  • (※3) PWM and Tone cannot be used simultaneously.

  • (※4) LED1 (pin 14) and LED2 (pin 15) are pulled up on the circuit.

  • (※5) User Switch (pin 32) is pulled up on the circuit.

  • Maximum number of functions that can be registered with attachCyclicHandler() is 8.

  • RTC and snooze mode cannot be used simultaneously.

  • The combination of reset factors and return values obtained by getResetFlag() are as follows.

    Reset factor Rutern value memo
    External reset or Power on reset 0x00 -
    Low voltage detection 0x01 The voltage detection level is 1.65 V on the falling edge and 1.69 V on the rising edge.
    Illegal instruction 0x80 -
  • Refer to the following link for reference on the various functions.

  • Arduino Reference - Arduino Reference

2-1. Digital IO

  • The RL78/G22 Fast Prototyping Board has 33 Digital input pins and 27 Digital input_pullup pins and 31 Digital output pins.
  • When using digital IO, pinMode() must first be called to set the specified pin to operate as an input or output.

    1. Using pin 2 as an input.
   pinMode(2,INPUT);
   val = digitalRead(2);
    1. Using pin 3 as an input_pullup.
   pinMode(3,INPUT_PULLUP);
   val = digitalRead(3);
    1. Using pin 4 as an output.
   pinMode(4,OUTPUT);
   digitailWrite(4,HIGH);
  • The pins corresponding to digital I/O are as follows.
Digital input pin Digital input_pullup pin Digital output pin memo
0-7, 9-25, 29, 32-34, 36-39 0-7, 9-13, 16-25, 29, 33, 34, 38 0-7, 9-25, 28, 29, 33, 34, 38, 39 -

2-2. Analog IO(Analog Input)

  • The RL78/G22 Fast Prototyping Board has 2 analog input pins.
  • Analog input signals are A/D converted and the resulting digital values are returned.
  • To use analog input, use analogRead() to specify the analog pin name and read the data.
  • The reference voltage used for analog input is 5V by default. When analogReference(INTERNAL) is called, the reference voltage is the internal reference voltage (1.48V).
  • analogReference(EXTERNAL) is not supported.

  • Use A0 pin
val =analogRead(A0);
  • The pins corresponding to analog input are as follows.
Analog input pin memo
A0, A1 -

2-3. PWM

  • The RL78/G22 Fast Prototyping Board has 4 PWM output pins.
  • To use PWM output, use analogWrite() to specify the pin name and duty, and generate PWM output.
  • To change the PWM output pulse frequency, use analogWriteFrequency() to set the frequency, then use analogWrite() to generate PWM output.
  • The range of frequencies that can be set with analogWriteFrequency() is 500 Hz to 8 MHz, and analogWrite() cannot control the duty ratio in detail at high frequencies.
  • The pins corresponding to PWM output are as follows.
PWM output pin memo
3, 5, 9, 10 -

2-4. Serial(UART)

  • The RL78/G22 Fast Prototyping Board has 4 serial (UART) channels.
  • The default transmit buffer size when using each channel is 256 bytes.
  • The default receive buffer size when using each channel is 256 bytes.
  • The pin assignments of the channels are as follows.
Channel Transmit pin Receive pin memo
Serial 24 25 Connect to Micro USB port via USB-Serial Converter when J15 is open-circuit.
Serial1 1 0 -
Serial2 11 12 Serial2 cannot be used simultaneously with the SPI channel.
Serial3 19 20 Connected to Pmod2 I/F.

2-5. SoftwareSerial

  • The RL78/G22 Fast Prototyping Board has 4 RX pins and 31 TX pins for SoftwareSerial.
  • The receive buffer size is 256 bytes.
  • The baud rates that can be set are 4800, 9600, 19200, 38400, 57600, and 115200 bps.
  • The pins corresponding to SoftwareSerial are listed below.
RX pin TX pin memo
2, 3, 10, 32 0-7, 9-25, 28, 29, 33, 34, 38, 39 -

2-6. Wire(I2C)

  • The RL78/G22 Fast Prototyping Board has 2 wire (I2C) channels.
  • The pin assignments of the channels are as follows.
Channel Data pin Clock pin memo
Wire 37(SDA0) 36(SCL0) -
Wire1 17(SDA1) 16(SCL1) Connected to Pmod1 I/F.

2-7. SPI

  • The RL78/G22 Fast Prototyping Board has 1 SPI channel.
  • The configurable clock frequency range is 125 kHz to 8 MHz.
  • The pin assignment of the channel is as follows.
Channel Chip Select pin Data out pin Data in pin Clock pin memo
SPI 10 11 12 13 Serial2 cannot be used simultaneously with the SPI channel.

2-8. Interrupt

  • The RL78/G22 Fast Prototyping Board has 4 external interrupt pins.
  • The correspondences between external interrupt numbers and pins are as follows.
Interrupt No. Interrupt pin memo
0 2 -
1 3 -
2 10 -
3 32(SW) -

2-9. Tone

  • The RL78/G22 Fast Prototyping Board has 4 tone output pins.
  • The range of frequencies that can be set with Tone() is from 500 Hz to 65535 Hz.
  • The correspondences between tone outputs and pins are as follows.
Tone output pin memo
3, 5, 9, 10 -

2-10. PulseIn

  • The RL78/G22 Fast Prototyping Board has 33 pulse input pins corresponding to pulseIn().
  • The default time until timeout is 1 second and can be set in the range of unsigned long type.
  • If measurement is made while using functions with interrupts such as HardwareSerial, the error with the actual pulse width may be large.
  • The pins corresponding to pulseIn() are as follows.
Pulse input pin memo
0-7, 9-25, 29, 32-34, 36-39 -

2-11. PulseInLong

  • The RL78/G22 Fast Prototyping Board has 33 pulse input pins corresponding to pulseInLong().
  • The time until timeout is set to 1 second by default, within the range of unsigned long type.
  • Pulse measurement is not available when interrupt processing is disabled.
  • The pins corresponding to pulseInLong() are as follows.
Pulse input pin memo
0-7, 9-25, 29, 32-34, 36-39 -

2-12. ShiftIn

  • The RL78/G22 Fast Prototyping Board has 31 clock output pins and 33 data input pins corresponding to shiftIn().
  • The pins corresponding to shiftIn() are as follows.
Clock pin Data pin memo
0-7, 9-25, 28, 29, 33, 34, 38, 39 0-7, 9-25, 29, 32-34, 36-39 -

2-13. ShiftOut

  • The RL78/G22 Fast Prototyping Board has 31 clock output pins and 31 data output pins corresponding to shiftOut() and shiftOutEx().
  • The pins corresponding to shiftOut() and shiftOutEx() are as follows.
Clock pin Data pin memo
0-7, 9-25, 28, 29, 33, 34, 38, 39 0-7, 9-25, 28, 29, 33, 34, 38, 39 -

2-14. Servo

  • The RL78/G22 Fast Prototyping Board has 31 Servo output pins.
  • The number of pins that can be used simultaneously is limited to 24.
  • The correspondences between Servo output pins are as follows.
Servo output pin memo
0-7, 9-25, 28, 29, 33, 34, 38, 39 -

2-15. Stepper

  • The RL78/G22 Fast Prototyping Board has 31 Stepper output pins.
  • The correspondences between Stepper output pins are as follows.
Stepper output pin memo
0-7, 9-25, 28, 29, 33, 34, 38, 39 -

2-16. LED

  • The RL78/G22 Fast Prototyping Board has two LEDs mounted on it.
  • The pins connected to the LEDs are as follows.
Name pin memo
LED1 14 -
LED2 15 -

2-17. User Switch

  • The RL78/G22 Fast Prototyping Board has one user switch.
  • The pin connected to the user switch is as follows.
Name pin memo
SW 32 -
Clone this wiki locally