<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=4&amp;t=21037&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2018-07-25T21:48:30+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=21037&amp;mode</id>
<entry>
<author><name><![CDATA[Zealota]]></name></author>
<updated>2018-07-25T21:48:30+01:00</updated>
<published>2018-07-25T21:48:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210140#p210140</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210140#p210140"/>
<title type="html"><![CDATA[Re: Aging register w DS3231]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210140#p210140"><![CDATA[
Tak determinuje, wszystko zależy jak zaimplementowano rozwiązanie w kodzie.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=16487">Zealota</a> — 25 lip 2018, o 21:48</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Jarosław J]]></name></author>
<updated>2018-07-25T21:44:27+01:00</updated>
<published>2018-07-25T21:44:27+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210139#p210139</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210139#p210139"/>
<title type="html"><![CDATA[Re: Aging register w DS3231]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210139#p210139"><![CDATA[
Dziękuję !!! Czyli mogę ich używać zamiennie ?  <br />- oczywiście że nie -  Już wiem, że determinuje to  funkcja  WRITE/READ  TWI   lub podobna !<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=786">Jarosław J</a> — 25 lip 2018, o 21:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Zealota]]></name></author>
<updated>2018-07-25T21:37:57+01:00</updated>
<published>2018-07-25T21:37:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210138#p210138</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210138#p210138"/>
<title type="html"><![CDATA[Re: Aging register w DS3231]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210138#p210138"><![CDATA[
<div class="quotetitle">Jarosław J napisał(a):</div><div class="quotecontent"><br />Rozumiem - Dziękuję !<br /><br />A przy okazji   Czemu adresy  DS 3231   różnią się?  Ja  w  Mirkowej bibliotece mam zdefiniowany adres <br />#define DS3231_ADDR 0xD0//podstawowy adres DS3231<br />Natomiast w tej bibliotece jako adres DS'a mam <br />#define DS3231_ADDRESS 0x68 ?<br /></div><br /><br />Poczytaj o 7 i 8-śmio bitowych adresach TWI.<br />W skrócie Mirek używa 8 bit, 0xD0 &gt;&gt;1 = 0x68<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=16487">Zealota</a> — 25 lip 2018, o 21:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Jarosław J]]></name></author>
<updated>2018-07-25T21:21:12+01:00</updated>
<published>2018-07-25T21:21:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210137#p210137</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210137#p210137"/>
<title type="html"><![CDATA[Re: Aging register w DS3231]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210137#p210137"><![CDATA[
Rozumiem - Dziękuję !<br /><br />A przy okazji   Czemu adresy  DS 3231   różnią się?  Ja  w  Mirkowej bibliotece mam zdefiniowany adres <br />#define DS3231_ADDR 0xD0//podstawowy adres DS3231<br />Natomiast w tej bibliotece jako adres DS'a mam <br />#define DS3231_ADDRESS 0x68 ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=786">Jarosław J</a> — 25 lip 2018, o 21:21</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[anshar]]></name></author>
<updated>2018-07-25T21:18:21+01:00</updated>
<published>2018-07-25T21:18:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210136#p210136</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210136#p210136"/>
<title type="html"><![CDATA[Re: Aging register w DS3231]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210136#p210136"><![CDATA[
Funkcja TWI oczekuje wskaźnika jako czwarty argument, więc musisz dodać operator pozyskiwania adresu &amp;<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 1 minucie ]</span></strong><br /><br />[syntax=c]TWI_read_buf(DS3231_ADDR,DS3231_AGING_REG, 1 , &amp;agingReg);[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7157">anshar</a> — 25 lip 2018, o 21:18</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Jarosław J]]></name></author>
<updated>2018-07-25T21:09:26+01:00</updated>
<published>2018-07-25T21:09:26+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210135#p210135</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210135#p210135"/>
<title type="html"><![CDATA[Aging register w DS3231]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=21037&amp;p=210135#p210135"><![CDATA[
Hej. Jako że widzę jak pewne egzemplarze DS3231 mają pewną odchyłkę dokładności, chciałem trochę pogrzebać w rejestrze starzenia się układu. Znalazłem taki kod w C++  dla arduino, jednak próbuję go przerobić na C. Wydaje się to łatwe, jednak nie do końca  Pomóżcie mi zrozumieć co się tu  dzieje i gdzie robię błąd. <br /><br />Program w C++ wygląda tak: <br /><br />[syntax=cpp]#define DS3231_ADDRESS 0x68<br />#define DS3231_AGING_REG 0x10<br />/**<br />  Get Aging Register value<br />**/<br />uint8_t Himadri_DS3231::agingRegValue() {<br />  uint8_t agingReg = readRegister(DS3231_AGING_REG);<br /><br />  if ((agingReg &amp; 0x80) != 0) {                 // 10000000<br />    agingReg ^= 0xFF;                           // 11111111<br />    agingReg  += 0x1;                           // 00000001<br />    agingReg = agingReg * -1;<br />  }<br /><br />  return agingReg;<br />};<br /><br />/**[/syntax]<br /><br /><br /><br />Więc  przy użyciu naszych (Mirka) funkcji napisałem coś takiego:<br /><br /><br /><br /><br />[syntax=c]#define DS3231_ADDRESS 0x68<br />#define DS3231_AGING_REG 0x10<br />//-------------Funkcja - Get Aging Register Value<br />uint8_t GARV(void){<br /><br />uint8_t agingReg=0; // powołuję i inicjuję zmienną lokalną <br /><br />TWI_read_buf(DS3231_ADDR, DS3231_AGING_REG, 1 ,agingReg);  //   Odczytuję 1 bajt  z rejestru AGING_REG  z adresu układu DS3231. <br /><br />if ((agingReg &amp; 0x80) != 0) {               // 10000000          Pozostałe operacje na zmiennej<br />agingReg ^= 0xFF;                           // 11111111<br />agingReg  += 0x1;                           // 00000001<br />agingReg = agingReg * -1;<br />  }<br />return agingReg;<br />}[/syntax]<br /><br /><br />kompilator wywala warninga :  passing argument 4 of 'TWI_read_buf' makes  pointer from integer without a cast [enabled by default]<br />Tylko jak użyć wskaźnika skoro nie chcę otrzymać adresu tylko wartość rejestru spod adresu, który wskazałem we wcześniejszych argumentach?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=786">Jarosław J</a> — 25 lip 2018, o 21:09</p><hr />
]]></content>
</entry>
</feed>