LoginSignup
0
0

More than 5 years have passed since last update.

GPIO PCAL6408AをArduinoで制御する(I2C)

Posted at

PCAL6408

Datasheet

PCAL6408 Datasheet

計測可能な値

種類 概要
GPIOエキスパンダ I2C,SPI等のシリアルバスでIOポートを拡張する。PCAL6408では8bitのポートを拡張可能。

Slave address

Slave Address 0x20

Register map

Address Name Type Default 概要
0x00 INPUT R xxxxxxxx PORTをINPUTに設定
0x01 OUTPUT R/W 11111111 PORTをOUTPUTに設定
0x02 POLARITY INVERSION R/W 00000000 極性反転
0x03 CONFIGURATION R/W 00000000 Configuration
0x40 Output drive strength 0 R/W 11111111 ?
0x41 Output drive strength 1 R/W 1111111 ?
0x42 Input latch R/W 00000000 TLOW MSB
0x43 Pull-up/pull-down enable R/W 00000000 TLOW LSB
0x44 Pull-up/pull-down selection R/W 00000000 TLOW LSB
0x45 Interrupt mask R/W 11111111 TCRIT MSB
0x46 Interrupt status R 00000000 TCRIT LSB
0x4F Output port configuration R/W 00000101 THYST setpoint

Who_am_i

デバイス名を取得できるResgiterアドレスは存在しない。

Configuration

CONFIGURATION 0x03
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
C7
LED7
C6
LED6
C5
LED5
C4
LED4
C3
LED3
C2
LED2
C1
LED1
C0
LED0
Bit 意味
1 Input
0 Output
arduino
#define PCAL6408_CONFIGURATION_REG 0x03

void configuration()
{
  writeI2c(PCAL6408_CONFIGURATION_REG, 0x00);
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0