Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
das_stm32f030_nucleo [2014/04/13 13:28] huwaldt |
das_stm32f030_nucleo [2019/02/04 14:10] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Das STM32F030 Nucleo ====== | ||
- | Das STM32F030 Nucleo ist die kleinste Variante aus der arduinokompatiblen Nucleo-Familie von ST. | ||
- | **Eigenschaften:** | ||
- | * STM32F030 Cortex M0 32-Bit ARM Mikrocontroller im LQFP64 Gehäuse | ||
- | * 64K FLASH {{ :nucleo401.jpg?300|}} | ||
- | * 8K SRAM | ||
- | * 48 MHz | ||
- | * Arduino Uno Revision 3 kompatible Steckverbinder | ||
- | * On-board ST-LINK/V2-1 Debugger/Programmer mit SWD | ||
- | * Flexible Spannungsversorgung üver USB oder externe (3.3 V, 5 V, 7 - 12 V) | ||
- | * drei LEDs | ||
- | * USB Kommunikation (LD1), | ||
- | * Benutzer LED (LD2), | ||
- | * Power LED (LD3) | ||
- | * zwei Taster | ||
- | * Benutzertaster | ||
- | * RESET | ||
- | * USB Virtual Com Port Unterstützung | ||
- | |||
- | Beschaffung: [[http://shop.myavr.de/index.php?sp=artlist_kat.sp.php&katID=37|STM32 Discovery im myMCU Shop]] | ||
- | |||
- | ====== Schnelleinstieg mit dem STM32F030 Nucleo ====== | ||
- | |||
- | - SiSy starten | ||
- | - neues Projekt anlegen, Profil ARM Vorgehensmodell auswählen | ||
- | - keine Vorlage aus dem Libstore wählen | ||
- | - kleines Programm anlegen, Zielsprache ARM C++, Ziel Hardware STM32F030 Nucleo mit JLink | ||
- | - Grundgerüst laden | ||
- | |||
- | |||
- | >>><code c> | ||
- | //---------------------------------------------------------------------- | ||
- | // Titel : Grundgerüst einer einfachen ARM C Anwendung in SiSy | ||
- | //---------------------------------------------------------------------- | ||
- | // Funktion : ... | ||
- | // Schaltung : ... | ||
- | //---------------------------------------------------------------------- | ||
- | // Hardware : ... | ||
- | // MCU : ... | ||
- | // Takt : ... | ||
- | // Sprache : ... | ||
- | // Datum : ... | ||
- | // Version : ... | ||
- | // Autor : ... | ||
- | //---------------------------------------------------------------------- | ||
- | #include <stddef.h> | ||
- | #include <stdlib.h> | ||
- | #include "hardware.h" | ||
- | |||
- | void initApplication() | ||
- | { | ||
- | SysTick_Config(SystemCoreClock/100); | ||
- | // weitere Initialisierungen durchführen | ||
- | } | ||
- | int main(void) | ||
- | { | ||
- | SystemInit(); | ||
- | initApplication(); | ||
- | do{ | ||
- | // Eingabe | ||
- | // Ausgabe | ||
- | // Verarbeitung | ||
- | } while (true); | ||
- | return 0; | ||
- | } | ||
- | extern "C" void SysTickFunction(void) | ||
- | { | ||
- | // Application SysTick | ||
- | } | ||
- | </code> | ||
- | |||
- | |||
- | ====== Blinky ====== | ||
- | |||
- | >>><code c> | ||
- | //---------------------------------------------------------------------- | ||
- | // Titel : Einfache digitale Ausgabe mit dem STM32F030 Nucleo | ||
- | //---------------------------------------------------------------------- | ||
- | // Funktion : lässt die User-LED toggeln | ||
- | // Schaltung : LED an GPIO Port A5 | ||
- | //---------------------------------------------------------------------- | ||
- | // Hardware : STM32F030 Nucleo | ||
- | // MCU : STM32F030R | ||
- | // Takt : 48 MHz | ||
- | // Sprache : ARM C | ||
- | // Datum : 04.04.2014 | ||
- | // Version : 1.0 | ||
- | // Autor : Alexander Huwaldt | ||
- | //---------------------------------------------------------------------- | ||
- | #include <stddef.h> | ||
- | #include <stdlib.h> | ||
- | #include "hardware.h" | ||
- | |||
- | void initApplication() | ||
- | { | ||
- | SysTick_Config(SystemCoreClock/100); | ||
- | // weitere Initialisierungen durchführen | ||
- | |||
- | /* GPIOA Takt einschalten */ | ||
- | RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); | ||
- | |||
- | /* Konfiguriere GPIO Port A5 */ | ||
- | GPIO_InitTypeDef GPIO_InitStructure; | ||
- | GPIO_StructInit (&GPIO_InitStructure); | ||
- | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; | ||
- | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; | ||
- | GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; | ||
- | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; | ||
- | GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; | ||
- | GPIO_Init(GPIOA, &GPIO_InitStructure); | ||
- | } | ||
- | int main(void) | ||
- | { | ||
- | SystemInit(); | ||
- | initApplication(); | ||
- | do{ | ||
- | GPIO_SetBits(GPIOA,GPIO_Pin_5); | ||
- | waitMs(300); | ||
- | GPIO_ResetBits(GPIOA,GPIO_Pin_5); | ||
- | waitMs(300); | ||
- | } while (true); | ||
- | return 0; | ||
- | } | ||
- | extern "C" void SysTick_Handler(void) | ||
- | { | ||
- | // Application SysTick default 10ms | ||
- | } | ||
- | //------------------------------------------------------------------------------ | ||
- | </code> | ||
- | |||
- | ====== Übersetzen, übertragen und testen ====== | ||
- | Die Programme sind getestet und können sofort übersetzt (kompilieren, linken) und in den Programmspeicher des Controllers übertragen werden (brennen). | ||
- | |||
- | >{{:uebersetzen.jpg?350|}} {{:brennen.jpg?350|}} | ||
- | |||
- | |||
- | ====== Weitere Beispiele ====== | ||
- | Weitere Beispiele erhalten sie aus dem [[http://www.sisy.de/index.php?id=6&_cmd=showPage&_para=searchLibList&searchTxtLib=Beispiele STM32|SiSy-Libstore]]. | ||
- | |||
- | >{{:beispielef0.png?700|}} | ||
- | |||
- | |||
- | ====== Videozusammenfassung ====== | ||
- | |||
- | >>><flashplayer width="600" height="400" position="0">file=http://youtu.be/84Y3jYLWYpo</flashplayer> | ||
- | |||
- | >>>[[http://youtu.be/84Y3jYLWYpo|besser auf youTube]] | ||
- | |||
- | |||
- | ====== Weitere Hinweise ====== | ||
- | * [[Programmierung anderer Controller]] | ||
- | * [[http://www.sisy.de/index.php?id=6&_cmd=showPage&_para=searchLibList&searchTxtLib=STM32|der STM32 im SiSy-LibStore]] |