出自flip the world

Application - DS1302, RTC module:修訂間差異

Tommy​(留言 | 貢獻)
Refactor: add [[Category:Projects ]]
 
Tommy​(留言 | 貢獻)
Consistency: fix external-link syntax, heading case and wikilink form
第4行: 第4行:
* In version 2 Pi GPIO27 is in place of GPIO21 (same pin)
* In version 2 Pi GPIO27 is in place of GPIO21 (same pin)
== Software ==
== Software ==
* [http://www.hobbytronics.co.uk/download/rtc-pi.zip,  Real Time Clock Source Code]
* [http://www.hobbytronics.co.uk/download/rtc-pi.zip Real Time Clock Source Code]
<pre>
<pre>
  Modify the following GPIO definition for RPi 2
  Modify the following GPIO definition for RPi 2
第14行: 第14行:


== Reference ==
== Reference ==
* [http://www.hobbytronics.co.uk/raspberry-pi-real-time-clock, Raspberry Pi Real Time Clock]
* [http://www.hobbytronics.co.uk/raspberry-pi-real-time-clock Raspberry Pi Real Time Clock]


[[Category:Projects]]
[[Category:Projects]]

2026年8月23日 (日) 15:58的版本

Hardware

RPi with DS1302

  • In version 2 Pi GPIO27 is in place of GPIO21 (same pin)

Software

 Modify the following GPIO definition for RPi 2
 #define GPIO_ADD 0x20200000L                          ->  #define GPIO_ADD 0x3F000000L
 #define SCLK_OUTPUT *(gpio+GPIO_SEL2) &= 0xFFFFFFC7L  ->  #define SCLK_OUTPUT *(gpio+GPIO_SEL2) &= 0xFF1FFFFFL
 #define SCLK_HIGH *(gpio+GPIO_SET) = 0x00200000L      ->  #define SCLK_HIGH *(gpio+GPIO_SET) = 0x08000000L
 #define SCLK_LOW *(gpio+GPIO_CLR) = 0x00200000L       ->  #define SCLK_LOW *(gpio+GPIO_CLR) = 0x08000000L

Reference