Gadget Renesas

Linking Ideas and Electronics

がじぇるね工房

Using function on GR-KURUMI, Multiple terminals vol.

GR-KURUMIの機能を使うI2C編

####

A terminal has multiple functions

image01

One chip MCU such as RL78/G13 is likely to have less number of terminals while MCU build in a lot of peripheral modules like serial , timer etc. Several peripheral modules scramble for a terminal.
Not limited to RL78/G13, but also other type of MCU. Can you guess how the symbol of CPU look like?
For example, serial port has three multiple functions such as UART, I2C, SPI, while it is used for one function, others is not available.When you design hardware, you must check in advance if the functions share the terminal or not.

We might think that you can do everything to see that MCU build in various peripheral function modules, however, we have to be careful if there might be a constraint.



For instance, we are not allowed to use SPI or SD card at the same time of using Serial 2.

####

Cross reference between Terminals and port number for GR-KURUMI

Here is the cross reference between terminal number on GR-KURUMI and port number for RL78/G13. ※() function can be assigned by setting up of PIOR.

image02 image03

※Please refer to the hardware manual about each function in details.

####

How to use analog input

image04

More than one terminal can be assigned for analog input. In GR-KURUMI case, you can use the terminals up to 8 (A0~A7) for external analog input.Please find A4~A7 apart form the edge on board, like Arduino Pro Mini.
You might think that you can assign any terminals for analog input since we have 8 possible ones.Trap there!

image05

However, the picture shows the only pattern of assignment we have for RL78 series.
※Partially excerpted, please refer to the hardware manual in details.

In the chart, the red circle in the left stands for resistor for setting up, the one in the right stands for the terminals. “D” stand for digital terminals while “A” stands for analog terminals.

The chart says, analog terminals should be assigned in turn from a small number only such as ANI0.
Also “ANI0 analog, ANI1 digital, ANI2 analog“ are not allowed. 
Again, please make sure for analog input to be assigned in tern from a small number of AO. And don’t insert a digital terminal among analogs.

####

The volume of electric current carrying on a terminal

image06 image07

One of the features of Atmega328P on Arduino Pro Mini is that the volume is large for electric current to carry on a terminal or whole device. . Checked with datasheets, you can see 20mA both for SINK and SOURCE, Vol=0.7V, Voh=2.25V under condition Vcc=3V, 25℃.
Maximum rating for whole device is 200mA.

image08

RL78/G13 on GR-KURUMI, at SOURCE side, more than 10mA can flow at 3.3V battery run.
However, the current flowing on the terminals of P20~P27 is extremely small.
The terminals of P20~27 are equivalent with A0~A5 on GR-KURUMI.
These terminals can’t assume heavy load functions such as LED etc. ※It’s much better than former RENESAS MCU.

image09

At sink side, more than 15mA of electric current can flow at 3.3V battery run.
The current on the terminals of P20~P27 is extremely small as well.These terminals can’t assume heavy load functions.

MVP information

@chobichan

General hard engineer.. submitting his writing for technical magazine occasionally.
twitter account:
https://twitter.com/chobichan

Chobichan avatar

Follow him

All articles from @chobichan

share