<?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=8&amp;t=18332&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-05-04T21:31:55+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=8&amp;t=18332&amp;mode</id>
<entry>
<author><name><![CDATA[Jaglarz]]></name></author>
<updated>2017-05-04T20:38:48+01:00</updated>
<published>2017-05-04T20:38:48+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18332&amp;p=188439#p188439</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18332&amp;p=188439#p188439"/>
<title type="html"><![CDATA[Re: Xmega TWI - blokuje się]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18332&amp;p=188439#p188439"><![CDATA[
<!-- l --><a class="postlink-local" href="http://forum.atnel.pl/topic7402.html" >topic7402.html</a><!-- l --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=471">Jaglarz</a> — 4 maja 2017, o 20:38</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[lcdk]]></name></author>
<updated>2017-05-04T21:31:55+01:00</updated>
<published>2017-05-04T20:28:42+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18332&amp;p=188437#p188437</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18332&amp;p=188437#p188437"/>
<title type="html"><![CDATA[Xmega TWI - blokuje się]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18332&amp;p=188437#p188437"><![CDATA[
Witam Was, Podłączyłem do xmegi ADC MCP3421 rezystory pull-up 1k ( próbowałem z innymi ) transmisja 100kHz ( próbowałem z innymi prędkościami )  problem w tym że działa tylko chwilę zawsze zawiesza się w tym samym miejscu po takim samym czasie. Reset układu nie pomaga - powstaje tylko szpilka:<br /><br /><a href="https://obrazkiforum.atnel.pl/16664/89caede82d0b1c6d5caee00946e7fc29.jpg"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/16664/89caede82d0b1c6d5caee00946e7fc29.jpg" alt="Obrazek" /></a><br /><br /><strong>Tutaj rozpoczęcie komunikacji:</strong><br /><br /><a href="https://obrazkiforum.atnel.pl/16664/fb24f8cedd36b3ff0145a8a3fb56cecc.jpg"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/16664/fb24f8cedd36b3ff0145a8a3fb56cecc.jpg" alt="Obrazek" /></a><br /><br /><strong>A tutaj zawieszenie komunikacji:</strong><br /><br /><a href="https://obrazkiforum.atnel.pl/16664/78140c7852adbda7ab84b5c513326db9.jpg"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/16664/78140c7852adbda7ab84b5c513326db9.jpg" alt="Obrazek" /></a><br /><br /><strong>A tutaj kod programu:</strong><br /><br /><br />[syntax=c]#define BAUDRATE    100000<br />#define TWI_BAUD(F_SYS, F_TWI) ((F_SYS / (2 * F_TWI)) - 5);<br />#define TWI_BAUDSETTING TWI_BAUD(F_CPU, BAUDRATE);<br />#define MCP_ADDRESS 0xD4; <br /><br />void TWI_MasterInit(){<br />TWIC.MASTER.BAUD = TWI_BAUDSETTING;;<br />TWIC.CTRL = 0x00;      //SDA hold time OFF and normal TWI operation with two-pin interface<br /><br />// enable TWI / I2C / SMBUS<br />TWIC.MASTER.CTRLA = TWI_MASTER_ENABLE_bm;<br />TWIC.MASTER.CTRLB = 0x00; //disable Inactive Bus Timeout, disable QCEN and SMEN<br />TWIC.MASTER.CTRLC = 0x00;<br /><br />// force initial bus state to idle<br />TWIC.MASTER.STATUS = TWI_MASTER_BUSSTATE_IDLE_gc;<br />};<br /><br />void MCP_write_buf(uint8_t len, uint8_t *buf)<br />{<br />TWIC.MASTER.ADDR = MCP_ADDRESS;<br />while (!(TWIC.MASTER.STATUS &amp; TWI_MASTER_WIF_bm) || (TWIC.MASTER.STATUS &amp; TWI_SLAVE_RXACK_bm));<br />while (len--) <br /> { <br />TWIC.MASTER.DATA = *buf++;<br />while (!(TWIC.MASTER.STATUS &amp; TWI_MASTER_WIF_bm));<br /> }<br />TWIC.MASTER.CTRLC = TWI_MASTER_CMD_STOP_gc; <br />}<br /><br />void MCP_read_buf(uint8_t len, uint8_t *buf)<br />{<br />    TWIC.MASTER.ADDR = 0x01 + MCP_ADDRESS; <br />while (!(TWIC.MASTER.STATUS &amp; TWI_MASTER_RIF_bm)) //|| (TWIC.MASTER.STATUS &amp; TWI_SLAVE_RXACK_bm));<br />while (len--)<br />{<br />*buf++ = TWIC.MASTER.DATA;<br />TWIC.MASTER.CTRLC = TWI_MASTER_CMD_RECVTRANS_gc;<br />while (!(TWIC.MASTER.STATUS &amp; TWI_MASTER_RIF_bm));<br />}<br />TWIC.MASTER.CTRLC = TWI_MASTER_CMD_STOP_gc;<br />}<br /><br />//Pętla główna FCPU = 32Mhz TWI 100Khz<br /><br />TWI_MasterInit();<br />uint8_t MCP_Configuration = 0b10011000;<br />MCP_write_buf(1,&amp;MCP_Configuration);<br />while(1){<br />MCP_read_buf(4,&amp;bb2);<br />}[/syntax]<br /><br /><br /><br />Jakieś pomysły?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=16664">lcdk</a> — 4 maja 2017, o 20:28</p><hr />
]]></content>
</entry>
</feed>