LoginSignup
8
9

More than 5 years have passed since last update.

Raspberry Pi2でGPIO制御(メモリマップトレジスタ)

Last updated at Posted at 2015-03-17

RaspberryPi の場合

RaspberryPiでは、SoCがBCM2835だったため、
ペリフェラルレジスタアドレスは、以下であった。
0x20000000

ペリフェラルレジスタアドレス+GPIOオフセット0x00200000となる
0x20200000
に対しアクセスすることでGPIOを制御できる。

RaspberryPi2の場合

RaspberryPi2では、SoCがBCM2836(BCM2709?)であるため、
上記アドレスでは、GPIOを制御できない。
BCM2836(BCM2709?)のペリフェラルレジスタアドレスは、以下となる。
0x3F000000

GPIOオフセットは、0x00200000のままであるため
0x3F200000
に対しアクセスすることでGPIOを制御できる。

参考HP

Jun's Homepage Raspberry Pi と Raspberry Pi2の非互換性
http://www.mztn.org/rpi/rpi42.html

こじ研 Raspberry Pi 応用編
http://www.myu.ac.jp/~xkozima/lab/raspTutorial3.html

#define BCM2708_PERI_BASE 0x3F000000
https://github.com/raspberrypi/linux/blob/cccc0886453edffc761ab30fa38cebfda434c36a/arch/arm/mach-bcm2709/include/mach/platform.h

8
9
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
8
9