forked from arduino/Arduino
    
        
        - 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
RL78G22 Fast Prototyping Board pin list
        SuguruHarada edited this page Aug 8, 2024 
        ·
        8 revisions
      
    - 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(※2) | 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(※2) | - | MOSI | - | - | 〇 | 〇 | 〇 | 〇 | - | - | 
| P14 | 12 | 12 | 〇 | 〇 | - | - | - | - | RxD2(※2) | - | MISO | - | - | 〇 | 〇 | 〇 | 〇 | - | - | 
| P15 | 13 | 13 | 〇 | 〇 | 〇 | - | - | - | - | - | SCK | - | - | 〇 | 〇 | 〇 | 〇 | - | - | 
| P62 | - | 14 | - | 〇 | - | - | - | - | - | - | - | - | - | 〇 | 〇 | 〇 | 〇 | LED1 | - | 
| P63 | - | 15 | - | 〇 | - | - | - | - | - | - | - | - | - | 〇 | 〇 | 〇 | 〇 | LED2 | - | 
| P75 | - | 16 | - | 〇 | 〇 | - | - | - | - | - | - | - | - | 〇 | 〇 | 〇 | 〇 | - | - | 
| P74 | - | 17 | - | 〇 | 〇 | - | - | - | - | - | - | - | - | 〇 | 〇 | 〇 | 〇 | - | - | 
| 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(※4) | - | 32 | - | 〇 | - | - | - | - | - | - | - | 3 | - | 〇 | 〇 | - | - | - | 〇 | 
| P122 | - | 33 | - | 〇 | - | - | - | - | - | - | - | - | - | 〇 | 〇 | 〇 | 〇 | - | - | 
| P121 | - | 34 | - | 〇 | - | - | - | - | - | - | - | - | - | 〇 | 〇 | 〇 | 〇 | - | - | 
| P20 | AREF | 35 | 〇(※1) | 〇 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | 
| 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) Serial2(RXD2,TXD2) cannot be used simultaneously with the SPI channel.
 - (※3) Pin 28 (P130) is an output-only port, so the INPUT setting cannot be used.
 - (※4) Pin 32 (P137) is an input-only port, so the OUTPUT setting cannot be used.
 
- The functions of the RL78/G22 Fast Prototyping Board are listed below.
 
| No. | Name | Function | 
|---|---|---|
| 1 | Digital IO | 32 Digital Input/output pins | 
| 2 | Analog IO | 2 Analog Input pins | 
| 3 | PWM | 4 PWM Output pins | 
| 4 | Serial(UART) | 4 Serial(UART) channels(※1) | 
| 5 | Wire(I2C) | 1 Wire(I2C) channels | 
| 6 | SPI | 1 SPI channels | 
| 7 | Interrupt | 4 Interrupt pins | 
| 8 | Tone | 4 Tone Output pins | 
| 9 | PulseIn | 31 Pulse Input pins | 
| 10 | ShiftIn/ShitOut | 32(16pair) shiftIn/ShiftOut pins | 
| 11 | Servo | 31 Servo Output pins | 
| 12 | Stepper | 31 Stepper Output pins | 
| 13 | LED | 2 on Board LED (pin 14 and pin 15) | 
| 14 | User Switch | 1 on Board User Switch (pin 32) | 
- (※1) One serial channel (Serial) connects to a Micro-USB connector via a USB-serial converter.
 - (※2) Serial2(RXD2,TXD2) cannot be used simultaneously with the SPI channel.
 - Refer to the following link for reference on the various functions.
 - Arduino Reference - Arduino Reference
 
- The RL78/G22 Fast Prototyping Board has 32 digital inputs and outputs.
 - In order to use digital I/O, it is necessary to first configure pin direction settings using
 
- 
- Using pin3 as an input.
 
 
   pinMode(3,INPUT);
   val = digitalRead(3);- 
- Using pin4 as an output.
 
 
   pinMode(4,OUTPUT);
   digitailWrite(4,HIGH);- 
The pins corresponding to digital I/O are as follows.
Digital pin memo  
| 0-7, 9-25, 28, 29, 32-34, 38, 39 | - |
- The RL78/G22 Fast Prototyping Board has 2 analog inputs and outputs.
 - 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.
 
- Use A0 pin
 
val =analogRead(A0);- The pins corresponding to analog input are as follows.
 
| analog input pin | memo | 
|---|---|
| A0 | - | 
| A1 | - | 
- 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 anaglogWriteFrequency() to set the frequency, then use analogWrite() to generate PWM output.
 - The pins corresponding to PWM output are as follows.
 
| PWM output pin | memo | 
|---|---|
| 3, 5, 9, 10 | - | 
- The RL78/G22 Fast Prototyping Board has 4 serial (UART) channels.
 - A serial channel (Serial) is connected to a Micro-USB connector via a USB-serial converter.
 - The Serial2 channel and SPI channel cannot be used simultaneously.
 - 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 | - | 
| Serial1 | 1 | 0 | - | 
| Serial2 | 11 | 12 | Serial2 cannot be used simultaneously with the SPI channel. | 
| Serial3 | 19 | 20 | Connectable to Pmod2 I/F. | 
- The RL78/G22 Fast Prototyping Board has 1 wire (I2C) channel.
 - The pin assignments of the channels are as follows.
 
| Channel | Data pin | Clock pin | memo | 
|---|---|---|---|
| Wire | 37 | 36 | - | 
- The RL78/G22 Fast Prototyping Board has one SPI channel.
 - The SPI channel cannot be used simultaneously with the Serial2 channel.
 - 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. | 
- 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 | - | 
- The RL78/G22 Fast Prototyping Board has 4 tone output pins.
 - The correspondences between tone outputs and pins are as follows.
 
| Tone output pin | memo | 
|---|---|
| 3 | - | 
| 5 | - | 
| 9 | - | 
| 10 | - | 
- The RL78/G22 Fast Prototyping Board has 31 pulse input pins.
 - The correspondences between pulse inputs and pins are as follows.
 
| Pulse input pin | memo | 
|---|---|
| 0-7, 9-25, 29, 32-34, 38, 39 | - | 
- The RL78/G22 Fast Prototyping Board has 32 shift input/output pins (16 pairs).
 - The correspondences between shift inputs/outputs and pins are as follows.
 
| Clock pin | Data pin | memo | 
|---|---|---|
| 0-7, 9-25, 28, 29, 33, 34, 38, 39 | 0-7, 9-25, 28, 29, 32-34, 38, 39 | Pin 28 cannot be used as a Data pin when ShiftIn is used, Pin 32 cannot be used as a Data pin when ShiftOut is used. | 
- The RL78/G22 Fast Prototyping Board has 31 Servo output pins.
 - The correspondences between Servo output pins are as follows.
 
| Servo output pin | memo | 
|---|---|
| 0-7, 9-25, 28, 29, 33, 34, 38, 39 | - | 
- 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 | - | 
- 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 | - | 
- The RL78/G22 Fast Prototyping Board has one user switch.
 - The pin connected to the user switch is as follows.
 
| Name | pin | memo | 
|---|---|---|
| SW1 | 32 | - | 
