https://elinux.org/index.php?title=NGW100-RTC&feed=atom&action=historyNGW100-RTC - Revision history2024-03-28T14:41:32ZRevision history for this page on the wikiMediaWiki 1.31.0https://elinux.org/index.php?title=NGW100-RTC&diff=74005&oldid=prevCschalle: Add category2011-10-28T10:14:37Z<p>Add category</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 10:14, 28 October 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l55" >Line 55:</td>
<td colspan="2" class="diff-lineno">Line 55:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Schematics / Image created with [[fritzing]] - [http://fritzing.org/]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Schematics / Image created with [[fritzing]] - [http://fritzing.org/]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:HOWTOs]]</ins></div></td></tr>
<!-- diff cache key elinux:diff::1.12:old-21526:rev-74005 -->
</table>Cschallehttps://elinux.org/index.php?title=NGW100-RTC&diff=21526&oldid=prevPeter Huewe: Added instructions how to add a external RTC to the NGW100 - text and schematics created by me.2010-05-27T03:46:13Z<p>Added instructions how to add a external RTC to the NGW100 - text and schematics created by me.</p>
<p><b>New page</b></p><div>== Adding an external RTC ==<br />
Unfortunately the RTC embedded in the AT32AP700x is not battery backed (and no battery can be added) and consequently loses the time on powerloss.<br />
In order to keep the time one has to add an external rtc.<br />
<br />
I've choosen the simple DS1672 Binary Counter RTC from Maxim IC [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2750], as it is already supported in the linux kernel. (Device-Drivers->RTC->DS1672, CONFIG_RTC_DRV_DS1672') and as it is quite cheap and simple.<br />
<br />
=== Enabling it in Linux ===<br />
Select support for i2c, i2c-gpio, rtc, rtc-ds1672 in the Kernel config, either as module or compiled in.<br />
(either via 'make menuconfig', or for Buildroot 'make linux26-menunonfig')<br />
<br />
In arch/avr32/boards/atngw100/setup.c add<br />
{I2C_BOARD_INFO("ds1672", 0x68), },<br />
to static struct i2c_board_info __initdata i2c_info[] (line 169)<br />
<br />
OR compile and load this simple module/driver:<br />
#include <linux/i2c.h><br />
#include <linux/rtc.h><br />
#define DRV_VERSION "0.1"<br />
static struct i2c_board_info i2c_info = {I2C_BOARD_INFO("ds1672", 0x68)};<br />
static struct i2c_client *i2c_client;<br />
static int __init ngw_ds1672_init(void)<br />
{<br />
struct i2c_adapter *adap = i2c_get_adapter(0);//we only have 1 i2c.<br />
i2c_client = i2c_new_device(adap,&i2c_info);<br />
return 0;<br />
}<br />
static void __exit ngw_ds1672_exit(void)<br />
{<br />
i2c_unregister_device(i2c_client);<br />
}<br />
MODULE_AUTHOR("Peter Huewe <peterhuewe <!at!> gmx.de>");<br />
MODULE_DESCRIPTION("Register Dallas/Maxim DS1672 i2c-client");<br />
MODULE_LICENSE("GPL");<br />
MODULE_VERSION(DRV_VERSION);<br />
module_init(ngw_ds1672_init);<br />
module_exit(ngw_ds1672_exit);<br />
<br />
== Setting the system clock from RTC at boot time ==<br />
<br />
In order to use the external RTC as a reference clock, I'd recommend adding the line to setup.c and compile in the drivers mentioned above (i2c, i2c-gpio, rtc, rtc-ds1672).<br />
<br />
Then, in the kernel config, set 'CONFIG_RTC_HCTOSYS_DEVICE' to 'rtc1' in order to use the external RTC as reference clock.<br />
Location:<br />
-> Device Drivers<br />
-> Real Time Clock<br />
-> Set system time from RTC on startup and resume<br />
-> RTC used to set the system time (change this from rtc0 to rtc1)<br />
<br />
<br />
== Schematics ==<br />
In order to ease the wiring of the ds1762 I created some schematics<br />
<br />
<br />
[[File:Ds1672-rtc Schaltplan.png]] [[File:Ds1672-rtc Steckplatine.png]]<br />
<br />
Schematics / Image created with [[fritzing]] - [http://fritzing.org/]</div>Peter Huewe