-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc for STM32 perif configuration
- Loading branch information
Showing
17 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Comment builder et flasher ton code sur le STM32 | ||
|
||
En 2 lignes : | ||
- Build : bouton "Hammer" ou (Ctrl+B) | ||
- Flash (télécharger ton code sur le STM32) : bouton "Play" ou (Ctrl+Shift+B) | ||
|
||
![Build and Flash](../../images/elecsoft/stm32cubeide/build_and_flash.png) | ||
|
||
**Notes :** | ||
- Le Flash fait aussi le Build si t'as pas encore buildé. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Comment debug ton STM32 avec STM32CubeIDE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,75 @@ | ||
# Guide pour configurer d'un STM32 | ||
|
||
|
||
Oula, ce sujet est très vaste. On essaie de couvrir le minimale pour avoir une idée, après ça dépend vraiment chaque périphérique. | ||
|
||
D'ailleur, si tu ne comprends pas ce que c'est un périphérique, je te conseille de lire [ce document](../stm32/index.md). | ||
|
||
## Table des matières | ||
- [Pin](#pin) | ||
- [GPIO](#gpio) | ||
- [Timer](#timer) | ||
- [Clock](#clock) | ||
- [UART](#uart) | ||
|
||
## Pin | ||
Un pin est une broche de sortie ou d'entrée. Il peut être relier à un "Entrée/Sortie Général" (GPIO), ou à un périphérique spécifique (Timer, UART, SPI, etc). | ||
|
||
***Pour configurer un pin***, cliquez sur le pin dans le schéma de votre microcontrôleur. Vous pouvez choisir entre plusieurs options. | ||
|
||
![Pin](../../images/elecsoft/stm32cubeide/perif_pin.png) | ||
|
||
Souvent, autre que le GPIO, le pin sera automatiquement assigné à une fonction quand tu configure une périphérique. | ||
|
||
***Pour trouver un pin alternative qui peut assure la même fonction***, gardez Ctrl puis cliquez sur le pin. Vous devez voir les pins alternatives clignotent. Cliquez sur un pin pour le choisir. | ||
|
||
![Pin alternative](../../images/elecsoft/stm32cubeide/perif_pin_alternative.png) | ||
|
||
## GPIO | ||
Pour la théorie des GPIO, voir [ce document](../stm32/gpio.md). | ||
|
||
***Pour commencer*** | ||
|
||
Choisissez le fenêtre de configuration de GPIO ici : | ||
![GPIO](../../images/elecsoft/stm32cubeide/perif_gpio_1.png) | ||
|
||
**Quelques configurations indispensables pour un GPIO:** | ||
- Mode: Output Push-Pull, Output Open-Drain, Input, Analog | ||
- Pull-up/Pull-down: seulement pour les modes Input | ||
- User Label: pour identifier le pin | ||
|
||
***Exemple**:* | ||
|
||
Configurer un GPIO pour un sortie '0' et '1' "normal" : | ||
- Mode: Output Push-Pull | ||
- User Label: `motor_dir` | ||
|
||
![GPIO](../../images/elecsoft/stm32cubeide/perif_gpio_2.png) | ||
|
||
**Notes:** | ||
Tu peux nommer les pins utilsés par un autre périphérique dans les onglets correspondants (voir image ci-dessus, en haut à gauche). | ||
|
||
## Timer | ||
|
||
Un Timer peut servir à plusieurs choses : | ||
- Générer des interruptions à intervalles réguliers | ||
- Mesurer le temps (compter) | ||
- Générer des signaux PWM | ||
- Compter des événements externes | ||
|
||
Voir [ce document](../stm32/timer.md) pour plus d'informations. | ||
|
||
### Pour générer un PWM | ||
![Timer](../../images/elecsoft/stm32cubeide/perif_timer.png) | ||
|
||
- Choisir le Clock Source (normalement, c'est le clock interne du microcontrôleur) | ||
- Choisir un channel et asigner le mode PWM Generation CHx pour ce channel (un pin sera automatiquement assigné à ce channel) | ||
- Configurer la fréquence du signal PWM en changant la "Prescaler" et la "Counter Period" | ||
|
||
``` | ||
pwm_frequency = clock_frequency / [(prescaler+1) * (counter_period+1)] | ||
``` | ||
|
||
|
||
## Clock | ||
|
||
## UART |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Comment configurer ton project STM32CubeIDE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Quelques astuces pour écrire du code dans STM32CubeIDE |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.