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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-06-13T10:25:35+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=46&amp;t=11984&amp;mode</id>
<entry>
<author><name><![CDATA[Tannis]]></name></author>
<updated>2015-06-13T10:25:35+01:00</updated>
<published>2015-06-13T10:25:35+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131654#p131654</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131654#p131654"/>
<title type="html"><![CDATA[Re: Problem z odbieraniem danych:STM32, BTM-222 i Android]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131654#p131654"><![CDATA[
Witam. Dziękuje najmocniej za pomoc. Po 6h zabawy z tym programem zadziałało. Dodałem odbiór znaku w whilu oraz W GPIO dwie linijki &quot;GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_USART6);&quot; Jeżeli chodzi o USART6_IRQHandler(); znajdujący się w whilu, mam go wyrzucić gdyż przerwanie jeżeli jest dobrze skonfigurowane to i tak zadziała i wcale nie trzeba go wywoływać? Jeżeli komuś się przyda to kod zamieszczam poniżej. Pozdro <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" />[syntax=c]#include &quot;stm32f4xx.h&quot;<br />#include &quot;stm32f4xx_rcc.h&quot;<br />#include &quot;stm32f4xx_gpio.h&quot;<br />#include &quot;stm32f4xx_usart.h&quot;<br /><br /> <br />void NVIC_Configuration(void);<br />void GPIO_Configuration(void);<br />void USART_Configuration(void);<br />void USART6_IRQHandler(void);<br />//void UARTSend(const unsigned char *pucBuffer, unsigned long ulCount);<br />void usart_rxtx(void);<br /><br />GPIO_InitTypeDef GPIO_InitStructure;<br />char i;<br />int main(void){<br />usart_rxtx();<br /><br />    while(1)<br />    {<br /><br />//USART6_IRQHandler();<br />    }<br /><br />    USART_Cmd(USART6, DISABLE);<br />    }<br /><br />void USART6_IRQHandler(void)<br />{<br />while (USART_GetITStatus(USART6, USART_FLAG_RXNE) != RESET); // Wait for Char<br /> <br />    i = USART_ReceiveData(USART6);<br />if(i == '0'){<br />GPIO_SetBits(GPIOA, GPIO_Pin_0);  <br />GPIO_ResetBits(GPIOA, GPIO_Pin_1);<br />GPIO_ResetBits(GPIOA, GPIO_Pin_4);<br />        }<br />        else if(i == '1'){<br />GPIO_SetBits(GPIOA, GPIO_Pin_1); <br />GPIO_ResetBits(GPIOA, GPIO_Pin_0);<br />GPIO_ResetBits(GPIOA, GPIO_Pin_4);<br />          }<br /><br />else if(i == '2'){<br />GPIO_SetBits(GPIOA, GPIO_Pin_4);  <br />GPIO_ResetBits(GPIOA, GPIO_Pin_0);<br />GPIO_ResetBits(GPIOA, GPIO_Pin_1);<br /> <br />        }<br />else if(i == '3'){<br />GPIO_ResetBits(GPIOA, GPIO_Pin_0);<br />GPIO_ResetBits(GPIOA, GPIO_Pin_1); <br />GPIO_ResetBits(GPIOA, GPIO_Pin_4); <br /><br />        }<br />       <br />}<br /> <br />void usart_rxtx(void)<br />{<br />    /* Enable USART1 and GPIOA clock */<br /><br />RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART6, ENABLE);<br />RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);<br />RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);<br /> <br />    /* NVIC Configuration */<br />    NVIC_Configuration();<br /> <br />    /* Configure the GPIOs */<br />    GPIO_Configuration();<br /><br /> <br />    /* Configure the USART1 */<br />    USART_Configuration();<br /> <br />    /* Enable the USART1 Receive interrupt: this interrupt is generated when the<br />         USART1 receive data register is not empty */<br />    USART_ITConfig(USART6, USART_IT_RXNE, ENABLE);<br />}<br /><br /><br />void GPIO_Configuration(void)<br />{<br />  GPIO_InitTypeDef GPIO_InitStructure;<br /><br />//LED<br />GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4;<br />GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;<br />GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;<br />  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;<br />GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;<br />  GPIO_Init(GPIOA, &amp;GPIO_InitStructure);<br /><br />  /* Configure USART1 Tx (PA.09) as alternate function push-pull */<br />  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;<br />GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;<br />GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;<br />  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;<br />  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;<br />  GPIO_Init(GPIOC, &amp;GPIO_InitStructure);<br />GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_USART6);<br />  GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_USART6);<br />}<br /><br />void USART_Configuration(void)<br />{<br />  USART_InitTypeDef USART_InitStructure;<br /> <br />/* USART1 configuration ------------------------------------------------------*/<br />  USART_InitStructure.USART_BaudRate = 19200;        // Baud Rate<br />  USART_InitStructure.USART_WordLength = USART_WordLength_8b;<br />  USART_InitStructure.USART_StopBits = USART_StopBits_1;<br />  USART_InitStructure.USART_Parity = USART_Parity_No;<br />  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;<br />  USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;<br /> <br />  USART_Init(USART6, &amp;USART_InitStructure);<br /> <br />  /* Enable USART1 */<br />  USART_Cmd(USART6, ENABLE);<br />}<br /> <br />void NVIC_Configuration(void)<br />{<br />  NVIC_InitTypeDef NVIC_InitStructure;<br /> <br />  /* Enable the USARTx Interrupt */<br />  NVIC_InitStructure.NVIC_IRQChannel = USART6_IRQn;<br />  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;<br />  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;<br />  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;<br />  NVIC_Init(&amp;NVIC_InitStructure);<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5915">Tannis</a> — 13 cze 2015, o 10:25</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[QuadMan]]></name></author>
<updated>2015-06-12T22:33:03+01:00</updated>
<published>2015-06-12T22:33:03+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131629#p131629</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131629#p131629"/>
<title type="html"><![CDATA[Re: Problem z odbieraniem danych:STM32, BTM-222 i Android]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131629#p131629"><![CDATA[
Witam,<br />tak jak Kolega <strong>krafin</strong> napisał -koniecznie wywal z pętli głównej handler od przerwania - przecież to bez sensu. Poniżej masz zmodyfikowany kod z przerwaniami, moim zdaniem powinno działać, cała reszta wydaje się z grubsza ok. Po poprawkach uruchom terminal i sprawdź czy procek odbiera znak. Co do SPL - a, przemilczę, każdy orze jak może <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";-)" title="Puszcza oko" />.<br />[syntax=c]int main(void){<br />                usart_rxtx();<br />        //GPIO_SetBits(GPIOA, GPIO_Pin_5);<br />    while(1)<br />    {<br />              //  USART6_IRQHandler();<br />    }<br />    USART_Cmd(USART6, DISABLE);<br />    }<br /> <br />void USART6_IRQHandler(void)<br />{<br />       <br />  //      while(USART_GetITStatus(USART6, USART_FLAG_RXNE) != RESET); // Wait for Char - to bez sensu w przerwaniu <br /> // ta flagę można sprawdzać w pętli głównej, patrz linia niżej<br /> <br />   // if ((USART6-&gt;SR &amp; USART_FLAG_RXNE) != RESET)<br />        if    (USART_GetITStatus(USART6, USART_IT_RXNE) != RESET)  //a może to jest lepsze rozwiazanie?? - zdecydowanie, masz sprawdzić, czy przerwanie jest od odbiornika !!!<br />    {<br />        i = USART_ReceiveData(USART6);<br />        if(i == '1'){<br />                GPIO_SetBits(GPIOA, GPIO_Pin_5); //włącz diode<br />            //GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_SET);        //nie bardzo wiem czy ten zapis jest poprawny, czy linijka wyżej<br />           <br />        }<br />        else if(i == '0'){<br />            GPIO_ResetBits(GPIOA, GPIO_Pin_5); //wyłącz diodę<br />            //GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_RESET);    <br />           <br />        }<br />    }*/<br />}[/syntax]<br />Pozdrawiam, QuadMan.<br /><br />DOPISANE:<br />Nie wiem w jakim środowisku to uruchamiasz, jeśli to powyżej nie zadziała, spróbuj może na początek odebrać znak w pętli głównej, a IRQ handler zostaw pusty:<br />[syntax=c]t main(void){<br />                usart_rxtx();<br />        //GPIO_SetBits(GPIOA, GPIO_Pin_5);<br />    while(1)<br />    {<br />        while(USART_GetITStatus(USART6, USART_FLAG_RXNE) != RESET); // Wait for Char <br />        i = USART_ReceiveData(USART6);<br />        if(i == '1'){<br />                GPIO_SetBits(GPIOA, GPIO_Pin_5); //włącz diode<br />            //GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_SET);        //nie bardzo wiem czy ten zapis jest poprawny, czy linijka wyżej<br />           <br />        }<br />        else if(i == '0'){<br />            GPIO_ResetBits(GPIOA, GPIO_Pin_5); //wyłącz diodę<br />            //GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_RESET);    <br />           <br />        }<br />    }<br />    USART_Cmd(USART6, DISABLE);<br />    }<br /> <br />void USART6_IRQHandler(void)<br />{<br /><br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5291">QuadMan</a> — 12 cze 2015, o 22:33</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[krafin]]></name></author>
<updated>2015-06-12T00:42:37+01:00</updated>
<published>2015-06-12T00:42:37+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131542#p131542</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131542#p131542"/>
<title type="html"><![CDATA[Re: Problem z odbieraniem danych:STM32, BTM-222 i Android]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131542#p131542"><![CDATA[
Po 1 to powiedz nam co robi wywoływanie przerwania od uartu w pętli głównej???<br />Co do kodu to niezbyt umiem pomóc ponieważ nie korzystam z tych dziwnych stm-owskich bibliotek tylko z gołych rejestrów, dlatego polecam otworzyć ds twojego układu i spróbować w ten sam sposób zrobić obsługę przynajmniej uartu wprost na rejestrach. Jest ich raptem kilka a nauczysz się przy tym o niebo więcej.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=487">krafin</a> — 12 cze 2015, o 00:42</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Tannis]]></name></author>
<updated>2015-06-11T21:11:34+01:00</updated>
<published>2015-06-11T21:11:34+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131536#p131536</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131536#p131536"/>
<title type="html"><![CDATA[Re: Problem z odbieraniem danych:STM32, BTM-222 i Android]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131536#p131536"><![CDATA[
Już co raz lepiej jest. Dodałem do debuggera zmienną i, i widzę jak wysyłam np wartość 10 to zmienia mi się w rejestrach wartość dla i. Jednakże wszystko działa jeszcze tak niespodziewanie. Jakieś pomysły?<br /><br />[syntax=c]#include &quot;stm32f4xx.h&quot;<br />#include &quot;stm32f4xx_rcc.h&quot;<br />#include &quot;stm32f4xx_gpio.h&quot;<br />#include &quot;stm32f4xx_usart.h&quot;<br /><br />void NVIC_Configuration(void);<br />void GPIO_Configuration(void);<br />void USART_Configuration(void);<br />void USART6_IRQHandler(void);<br />void UARTSend(const unsigned char *pucBuffer, unsigned long ulCount);<br />void usart_rxtx(void);<br /><br />GPIO_InitTypeDef GPIO_InitStructure;<br />int i;<br />int main(void){<br />usart_rxtx();<br />//GPIO_SetBits(GPIOA, GPIO_Pin_5);<br />    while(1)<br />    {<br />USART6_IRQHandler();<br />    }<br />    USART_Cmd(USART6, DISABLE);<br />    }<br /><br />void USART6_IRQHandler(void)<br />{<br /><br />while(USART_GetITStatus(USART6, USART_FLAG_RXNE) != RESET); // Wait for Char<br /> <br />   // if ((USART6-&gt;SR &amp; USART_FLAG_RXNE) != RESET)<br />//if(USART_GetITStatus(USART6, USART_IT_RXNE) != RESET)  //a może to jest lepsze rozwiazanie??<br />    {<br />        i = USART_ReceiveData(USART6);<br />        if(i == '1'){<br />GPIO_SetBits(GPIOA, GPIO_Pin_5); //włącz diode<br />            //GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_SET);        //nie bardzo wiem czy ten zapis jest poprawny, czy linijka wyżej<br />           <br />        }<br />        else if(i == '0'){<br />    GPIO_ResetBits(GPIOA, GPIO_Pin_5); //wyłącz diodę<br />            //GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_RESET);     <br />           <br />        }<br />    }*/<br />}<br /> <br />void usart_rxtx(void)<br />{<br />RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART6, ENABLE);<br />                RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);<br />RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);<br />   <br /> <br />    /* NVIC Configuration */<br />    NVIC_Configuration();<br /> <br />    /* Configure the GPIOs */<br />    GPIO_Configuration();<br /> <br />    /* Configure the USART1 */<br />    USART_Configuration();<br /> <br />    /* Enable the USART1 Receive interrupt: this interrupt is generated when the<br />         USART1 receive data register is not empty */<br />    USART_ITConfig(USART6, USART_IT_RXNE, ENABLE);<br />}<br /> <br /><br />void GPIO_Configuration(void)<br />{<br />  GPIO_InitTypeDef GPIO_InitStructure;<br /><br />//Koniguracja LED<br />GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;<br />GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;<br />GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;<br />  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;<br />GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;<br />  GPIO_Init(GPIOA, &amp;GPIO_InitStructure);<br /><br />  /* Konfiguracja PC6 i PC7*/<br />  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;<br />GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;<br />GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;<br />  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;<br />  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;<br />  GPIO_Init(GPIOC, &amp;GPIO_InitStructure);<br />GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_USART6);<br />  GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_USART6);<br />}<br /> <br /><br />void USART_Configuration(void)<br />{<br />  USART_InitTypeDef USART_InitStructure;<br /> <br />/* USART1 configuration ------------------------------------------------------*/<br />  USART_InitStructure.USART_BaudRate = 19200;        // Baud Rate<br />  USART_InitStructure.USART_WordLength = USART_WordLength_8b;<br />  USART_InitStructure.USART_StopBits = USART_StopBits_1;<br />  USART_InitStructure.USART_Parity = USART_Parity_No;<br />  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;<br />  USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;<br /> <br />  USART_Init(USART6, &amp;USART_InitStructure);<br /> <br />  /* Enable USART1 */<br />  USART_Cmd(USART6, ENABLE);<br />}<br /> <br /><br />void NVIC_Configuration(void)<br />{<br />  NVIC_InitTypeDef NVIC_InitStructure;<br /> <br />  /* Enable the USARTx Interrupt */<br />  NVIC_InitStructure.NVIC_IRQChannel = USART6_IRQn;<br />  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;<br />  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;<br />  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;<br />  NVIC_Init(&amp;NVIC_InitStructure);<br />}<br /> <br />void UARTSend(const unsigned char *pucBuffer, unsigned long ulCount)<br />{<br />    while(ulCount--)<br />    {<br />        USART_SendData(USART6, (uint16_t) *pucBuffer++);<br />        /* Loop until the end of transmission */<br />        while(USART_GetFlagStatus(USART6, USART_FLAG_TC) == RESET)<br />        {<br />        }<br />    }<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5915">Tannis</a> — 11 cze 2015, o 21:11</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[QuadMan]]></name></author>
<updated>2015-06-11T20:57:39+01:00</updated>
<published>2015-06-11T20:57:39+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131534#p131534</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131534#p131534"/>
<title type="html"><![CDATA[Re: Problem z odbieraniem danych:STM32, BTM-222 i Android]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131534#p131534"><![CDATA[
Witam,<br /><br />A włączyłeś w ogóle przerwania od UART-a w kontrolerze NVIC ? No i chociaż pokaż inicjalizację tego UART-a, bo z tego co napisałeś, podejrzewam, że przerwanie od UART-a w ogóle się nie wykonuje - albo nie jest włączone, albo UART niczego nie odbiera, bo na przykład jest źle skonfigurowany, albo na przykład zapomniałeś włączyć odbiornik. Ogólnie - wróżenie z fusów - najlepiej pokaż cały ten projekt.<br /><br />Pozdrawiam, QuadMan.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5291">QuadMan</a> — 11 cze 2015, o 20:57</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Tannis]]></name></author>
<updated>2015-06-11T19:26:09+01:00</updated>
<published>2015-06-11T19:26:09+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131529#p131529</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131529#p131529"/>
<title type="html"><![CDATA[Problem z odbieraniem danych:STM32, BTM-222 i Android]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11984&amp;p=131529#p131529"><![CDATA[
Witam. Mam problem z odbieraniem wysyłanych przeze mnie liczb:1 oraz 0. Chcę napisać kod, za pomocą, którego bym włączał i wyłączał diodę led płytki Nucleo F411RE, podłączonej do pinu PA5. Odbywać się to ma za pomocą komunikacji Bluetooth. BTM-222 jest podłączony przez USART6 do pinów PC7(Rx) jak i PC6(Tx). Oczywiście podłączyłem na krzyż. Poniżej zamieszczam kod, konfiguracji GPIO oraz funkcję, za pomocą której powinienem włączać diodkę.<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">    //receinving data<br />        void USART6_IRQHandler(void)<br />        {<br />            if (USART6-&gt;SR &amp; USART_FLAG_RXNE)// != RESET)<br />            {<br />                i = USART_ReceiveData(USART6);<br />                if(i == '1'){<br />                 GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_SET);    // Set '1' on PA5<br />                }<br />                else if(i == '0'){<br />                    GPIO_WriteBit(GPIOA,GPIO_Pin_5,Bit_RESET);  // Set '0' on PA5<br />                }<br />            }<br />        }<br />    //gpio configuration<br />    void GPIO_Configuration(void)<br />    {<br />          RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART6, ENABLE);<br />            RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);<br />            RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);<br />            GPIO_InitTypeDef GPIO_InitStructure;<br />          <br />       //LED as PA5<br />       GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;<br />       GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;<br />       GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;<br />        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;<br />       GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;<br />        GPIO_Init(GPIOA, &amp;GPIO_InitStructure);<br />       <br />      /* Configure USART6 Tx (PC6)*/<br />      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;<br />      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;<br />      GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;<br />      GPIO_Init(GPIOC, &amp;GPIO_InitStructure);<br />    <br />       GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_USART6);<br />      /* Configure USART6 Rx (PC7)*/<br />      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;<br />       GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;<br />      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;<br />      GPIO_Init(GPIOC, &amp;GPIO_InitStructure);<br />    }<br /></div><br />Ustawiam pułapkę na linii &quot;i = USART_ReceiveData(USART6);&quot; i nie dochodzi do tego miejsca, więc coś jest nie tak z ifem, jednakże co? Nie bardzo umiem poradzić sobie z tym problemem. Z góry dziękuję za pomoc.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5915">Tannis</a> — 11 cze 2015, o 19:26</p><hr />
]]></content>
</entry>
</feed>