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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-01-29T18:48:17+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=46&amp;t=14335&amp;mode</id>
<entry>
<author><name><![CDATA[marcinozog]]></name></author>
<updated>2016-01-29T18:48:17+01:00</updated>
<published>2016-01-29T18:48:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152066#p152066</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152066#p152066"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152066#p152066"><![CDATA[
Mikrokontroler to  STM32F415RG, na razie się uczę, ale powiedzmy, że chce ustawić maksymalną częstotliwość.<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 16 minutach ]</span></strong><br /><br />Jest ok pomogła zmiana w OpenStm32 w funkcji SetSysClock z:<br />[syntax=c]/* Select the main PLL as system clock source */<br />    RCC-&gt;CFGR &amp;= (uint32_t)((uint32_t)~(RCC_CFGR_SW));<br />    RCC-&gt;CFGR |= RCC_CFGR_SW_PLL;<br /><br />    /* Wait till the main PLL is used as system clock source */<br />    while ((RCC-&gt;CFGR &amp; (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL);<br />    {<br />    }[/syntax]<br /><br />na<br /><br />[syntax=c]/* Select the HSE as system clock source */      // In the original file here is where the pll is turned on<br />    RCC-&gt;CFGR &amp;= (uint32_t)((uint32_t)~(RCC_CFGR_SW));<br />    RCC-&gt;CFGR |= RCC_CFGR_SW_HSE;<br /> <br />    /* Wait till the HSE is used as system clock source */<br />    while ((RCC-&gt;CFGR &amp; (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_HSE);<br />    {<br />    }[/syntax]<br /><br />Choć dalej w CooCox jest ta pierwsza wersja to dioda mruga identycznie.<br />Może mi ktoś w skrócie wytłumaczyć jakie znaczenie ma ta zmiana.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=6701">marcinozog</a> — 29 sty 2016, o 18:48</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Juffre]]></name></author>
<updated>2016-01-29T18:30:48+01:00</updated>
<published>2016-01-29T18:30:48+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152063#p152063</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152063#p152063"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152063#p152063"><![CDATA[
To znaczy że masz problem z rozbiegówką. <br />Jaki masz dokładnie procesor i jaką chcesz mieć częstotliwość taktowania?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=473">Juffre</a> — 29 sty 2016, o 18:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[marcinozog]]></name></author>
<updated>2016-01-29T17:29:41+01:00</updated>
<published>2016-01-29T17:29:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152059#p152059</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152059#p152059"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152059#p152059"><![CDATA[
Ogólnie ustawiając maksymalną wartość 16777216 w SysTick_Config w OpenStm32 dioda mruga chyba 4 razy szybciej niż w CooCox.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=6701">marcinozog</a> — 29 sty 2016, o 17:29</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[marcinozog]]></name></author>
<updated>2016-01-29T16:19:15+01:00</updated>
<published>2016-01-29T16:19:15+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152057#p152057</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152057#p152057"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152057#p152057"><![CDATA[
<div class="quotetitle">Juffre napisał(a):</div><div class="quotecontent"><br />Wywołaj jeszcze funkcję przed funkcją konfigurującą SysTick:<br />[syntax=c]SystemCoreClockUpdate();[/syntax]<br /><br />A ustawianie SysTicka najlepiej zrobić tak:<br />[syntax=c]#define FREQUENCY 1000<br />SysTick_Config(SystemCoreClock/FREQUENCY);[/syntax]<br />I dostajesz przerwanie z częstotliwością 1[kHz]<br /></div><br /><br />Dziwna sprawa w CooCox jak ustawie FREQUENCY 1 to mruga raz na sekundę, a w OpenStm32 jak zejdę FREQUENCY &lt; 11 to w ogóle nic się nie dzieje, przy 11 mruga szybko a poniżej świeci ciągle. Korzystam z płytki MINI-M4 STM32 Funkcja z RCC z OpenStm32:<br />[syntax=c]static void SetSysClock(void)<br />{<br />/******************************************************************************/<br />/*            PLL (clocked by HSE) used as System clock source                */<br />/******************************************************************************/<br />  __IO uint32_t StartUpCounter = 0, HSEStatus = 0;<br />  <br />  /* Enable HSE */<br />  RCC-&gt;CR |= ((uint32_t)RCC_CR_HSEON);<br /> <br />  /* Wait till HSE is ready and if Time out is reached exit */<br />  do<br />  {<br />    HSEStatus = RCC-&gt;CR &amp; RCC_CR_HSERDY;<br />    StartUpCounter++;<br />  } while((HSEStatus == 0) &amp;&amp; (StartUpCounter != HSE_STARTUP_TIMEOUT));<br /><br />  if ((RCC-&gt;CR &amp; RCC_CR_HSERDY) != RESET)<br />  {<br />    HSEStatus = (uint32_t)0x01;<br />  }<br />  else<br />  {<br />    HSEStatus = (uint32_t)0x00;<br />  }<br /><br />  if (HSEStatus == (uint32_t)0x01)<br />  {<br />    /* Select regulator voltage output Scale 1 mode */<br />    RCC-&gt;APB1ENR |= RCC_APB1ENR_PWREN;<br />    PWR-&gt;CR |= PWR_CR_VOS;<br /><br />    /* HCLK = SYSCLK / 1*/<br />    RCC-&gt;CFGR |= RCC_CFGR_HPRE_DIV1;<br />  <br />    /* PCLK2 = HCLK / 2*/<br />    RCC-&gt;CFGR |= RCC_CFGR_PPRE2_DIV2;<br />    <br />    /* PCLK1 = HCLK / 4*/<br />    RCC-&gt;CFGR |= RCC_CFGR_PPRE1_DIV4;<br />  <br />    /* Configure the main PLL */<br />    RCC-&gt;PLLCFGR = PLL_M | (PLL_N &lt;&lt; 6) | (((PLL_P &gt;&gt; 1) -1) &lt;&lt; 16) |<br />                   (RCC_PLLCFGR_PLLSRC_HSE) | (PLL_Q &lt;&lt; 24);  <br />    <br />    /* Enable the main PLL */<br />    RCC-&gt;CR |= RCC_CR_PLLON;<br /><br />    /* Wait till the main PLL is ready */<br />    while((RCC-&gt;CR &amp; RCC_CR_PLLRDY) == 0)<br />    {<br />    }<br />   <br />    /* Configure Flash prefetch, Instruction cache, Data cache and wait state */<br />    FLASH-&gt;ACR = FLASH_ACR_PRFTEN | FLASH_ACR_ICEN |FLASH_ACR_DCEN |FLASH_ACR_LATENCY_5WS;<br /><br />    /* Select the main PLL as system clock source */<br />    RCC-&gt;CFGR &amp;= (uint32_t)((uint32_t)~(RCC_CFGR_SW));<br />    RCC-&gt;CFGR |= RCC_CFGR_SW_PLL;<br /><br />    /* Wait till the main PLL is used as system clock source */<br />    while ((RCC-&gt;CFGR &amp; (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL);<br />    {<br />    }<br />  }<br />  else<br />  { /* If HSE fails to start-up, the application will have wrong clock<br />         configuration. User can add here some code to deal with this error */<br />  } <br />}[/syntax]<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 34 minutach ]</span></strong><br /><br />I jeszcze jedna funkcja z OpenStm32:<br />[syntax=c]void SystemInit(void)<br />{<br />  /* FPU settings ------------------------------------------------------------*/<br />  /* Reset the RCC clock configuration to the default reset state ------------*/<br />  /* Set HSION bit */<br />  RCC-&gt;CR |= (uint32_t)0x00000001;<br /><br />  /* Reset CFGR register */<br />  RCC-&gt;CFGR = 0x00000000;<br /><br />  /* Reset HSEON, CSSON and PLLON bits */<br />  RCC-&gt;CR &amp;= (uint32_t)0xFEF6FFFF;<br /><br />  /* Reset PLLCFGR register */<br />  RCC-&gt;PLLCFGR = 0x24003010;<br /><br />  /* Reset HSEBYP bit */<br />  RCC-&gt;CR &amp;= (uint32_t)0xFFFBFFFF;<br /><br />  /* Disable all interrupts */<br />  RCC-&gt;CIR = 0x00000000;<br />         <br />  /* Configure the System clock source, PLL Multiplier and Divider factors, <br />     AHB/APBx prescalers and Flash settings ----------------------------------*/<br />  SetSysClock();<br /><br />  /* Configure the Vector Table location add offset address ------------------*/<br /><br />  SCB-&gt;VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */<br /><br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=6701">marcinozog</a> — 29 sty 2016, o 16:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Juffre]]></name></author>
<updated>2016-01-29T12:02:22+01:00</updated>
<published>2016-01-29T12:02:22+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152047#p152047</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152047#p152047"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152047#p152047"><![CDATA[
Wywołaj jeszcze funkcję przed funkcją konfigurującą SysTick:<br />[syntax=c]SystemCoreClockUpdate();[/syntax]<br /><br />A ustawianie SysTicka najlepiej zrobić tak:<br />[syntax=c]#define FREQUENCY 1000<br />SysTick_Config(SystemCoreClock/FREQUENCY);[/syntax]<br />I dostajesz przerwanie z częstotliwością 1[kHz]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=473">Juffre</a> — 29 sty 2016, o 12:02</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[krafin]]></name></author>
<updated>2016-01-29T00:16:17+01:00</updated>
<published>2016-01-29T00:16:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152030#p152030</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152030#p152030"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152030#p152030"><![CDATA[
Tak apropo to do konfiguracji zegarów, jeżeli już nie chce nam się czytać manuala polecam <!-- m --><a class="postlink" href="http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF257927" >http://www.st.com/web/catalog/tools/FM1 ... 3/PF257927</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=487">krafin</a> — 29 sty 2016, o 00:16</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[krish]]></name></author>
<updated>2016-01-28T21:39:48+01:00</updated>
<published>2016-01-28T21:39:48+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152002#p152002</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152002#p152002"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=152002#p152002"><![CDATA[
Poszukaj w SPL-u ( w obu środowiskach) jak jest zdefiniowane:<br />#define HSE_VALUE<br />i ew. ustaw wartość ze swojej płytki ( oczywiście jeżeli Używasz zewnętrznego kwarcu).<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2273">krish</a> — 28 sty 2016, o 21:39</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[marmur]]></name></author>
<updated>2016-01-28T20:55:27+01:00</updated>
<published>2016-01-28T20:55:27+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=151992#p151992</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=151992#p151992"/>
<title type="html"><![CDATA[Re: [STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=151992#p151992"><![CDATA[
nie wkleiłeś nigdzie funkcji w której inicjalizujesz RCC, więc domniemywam, że oba środowiska w jakiś sposób Ci je konfigurują same, co daje oddmienne wyniki <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><br /><br /><br />Abstrahując trochę od tematu: <br />co do konfiguracji i działania na stmach, sciagnij i zainstaluj program CubeMX od ST - pozwoli ci przy pomocy GUI konfigurować podstawowe sprawy które potrzebujesz i generować kod.<br /><br />Co prawda używają warstwy HAL zamiast SPL, ale wydaje mi się, że HAL to przyszłość bo jest w chwili obecnej rozwijany na bieżąco i daje elegancką możliwość przenoszenia się między prockami bez większych nakładów pracy <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10570">marmur</a> — 28 sty 2016, o 20:55</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[marcinozog]]></name></author>
<updated>2016-01-28T18:17:40+01:00</updated>
<published>2016-01-28T18:17:40+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=151976#p151976</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=151976#p151976"/>
<title type="html"><![CDATA[[STM32F4] SysTick]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=14335&amp;p=151976#p151976"><![CDATA[
Witam, mam pytanie odnośnie kompilacji i wgrywania tego samego kodu w dwóch różnych środowiskach mianowicie CooCox i OpenStm32. Chodzio o to, że ten sam kod:<br />[syntax=c]#include &quot;stm32f4xx_gpio.h&quot;<br />#include &quot;stm32f4xx_rcc.h&quot;<br /><br />GPIO_InitTypeDef  GPIO_InitStructure;<br /><br />int main(void)<br />{<br />SysTick_Config(10500000) ;<br /><br />RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);<br /><br />GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;<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(GPIOC, &amp;GPIO_InitStructure);<br /><br />while(1){<br />}<br />}<br /><br />void SysTick_Handler()<br />{<br />GPIO_ToggleBits( GPIOC, GPIO_Pin_12);<br />}[/syntax]<br /><br />w CoocCox sprawia, że dioda mruga raz na sekundę a w OpenStm32 mniej więcej cztery razy na sekundę. Dodam, że funkcję SetSysClock mam identycznie skonfigurowaną w obu przypadkach.<br />Wie ktoś może dlaczego tak się dzieje?<br /><br /><strong><span style="color: #FF0000">Prosze poprawnie wklejać kody  na forum...<br />SunRiver</span></strong><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=6701">marcinozog</a> — 28 sty 2016, o 18:17</p><hr />
]]></content>
</entry>
</feed>