Cov txheej txheem:

Rotary Encoder Nrog STM32 Nucleo Board: 12 Cov Kauj Ruam
Rotary Encoder Nrog STM32 Nucleo Board: 12 Cov Kauj Ruam

Video: Rotary Encoder Nrog STM32 Nucleo Board: 12 Cov Kauj Ruam

Video: Rotary Encoder Nrog STM32 Nucleo Board: 12 Cov Kauj Ruam
Video: Absolute Encoder (Shaft Encoder, Rotary encoder) - how it works! 2024, Kaum ib hlis
Anonim
Teb Encoder Nrog STM32 Nucleo Board
Teb Encoder Nrog STM32 Nucleo Board

Qhov no yog Tutorial rau Tau txais txoj haujlwm ntawm Rotary Encoder, uas yog hom zuj zus ntxiv ntawm encoder. Encoders yog ob hom feem ntau:- ib qho yog nce ntxiv lwm qhov yog qhov tseeb. Qhov chaws no tuaj yeem siv rau STM32L476 thiab STM32L0 microcontrollers. Tab sis yog tias koj muaj koj tus kheej lcd tsev qiv ntawv lossis tus lej rau LCD qhov no yuav ua haujlwm rau ib qho STM32 microcontroller.

Kuv tab tom siv STM32L476 nucleo board rau qhov kev qhia no.

Koj tuaj yeem tswj cov tshuab zoo li STEPPER lub cev muaj zog lossis servo motor los ntawm kev sau cov cai raws li kev txav ntawm tus lej nkag mus. Kuv tau sau cov cai no lawm. Please khaws kuv cov lus qhia ntxiv.

Kauj Ruam 1: Nruab STM32CUBEMX thiab Keil Nrog Pob rau STM32L476

Kauj Ruam 2: Ua Kev Sib Txuas Hluav Taws Xob rau Koj Txoj Haujlwm

Cov khoom siv hluav taws xob xav tau rau txoj haujlwm no yog:-

1) 16x2 alphanumeric LCD 2) STM32L476 nucleo board. 3) Pawg mov ci 4) Jumper xov hlau. 5) Ib lub laptop nrog lub qhov rais teeb tsa (6) Rotary Encoder. Kev sib txuas ntawm LCD thiab STM32L476 pawg thawj coj tau hais hauv qab no:-

STM32L476 - LCD

GND - PIN 1

5V - PIN 2

NA - 2.2K resistor txuas nrog GND

PB10 - PIB

PB11 - RWJ

PB2 - TSO

PEB 12 - D4

PEB 13 - D5

PEB 14 - D6

PEB 15 - D7

5V - PIN 15

GND - PIN 16

Kev sib txuas ntawm Rotary Encoder thiab STM32 yog hauv qab no

Teb Encoder-STM BOARD

Lub hwj chim pin-3.3 V

GND-GND

CLK-PC1

DT-PC0

Kauj Ruam 3: Xaiv Microcontroller hauv STM32CUBEMX

Qhib cubemx thiab xaiv nucleo64 board nrog microcontroller li STM32L476

Kauj Ruam 4: Xaiv Qhov Tsim Nyog hauv STM32cubemx Raws Li Cov Duab Qhia Hauv Cov Ntawv Qhia no

Xaiv Qhov Tsim Nyog Xaiv hauv STM32cubemx Raws Li Cov Duab Qhia Hauv Qhov Kev Qhia no
Xaiv Qhov Tsim Nyog Xaiv hauv STM32cubemx Raws Li Cov Duab Qhia Hauv Qhov Kev Qhia no
Xaiv Qhov Tsim Nyog Xaiv hauv STM32cubemx Raws Li Cov Duab Qhia Hauv Qhov Kev Qhia no
Xaiv Qhov Tsim Nyog Xaiv hauv STM32cubemx Raws Li Cov Duab Qhia Hauv Qhov Kev Qhia no
Xaiv Qhov Tsim Nyog Xaiv hauv STM32cubemx Raws Li Cov Duab Qhia Hauv Qhov Kev Qhia no
Xaiv Qhov Tsim Nyog Xaiv hauv STM32cubemx Raws Li Cov Duab Qhia Hauv Qhov Kev Qhia no

Siv cov theem saum toj no txhawm rau xaiv qhov tsim nyog hauv STM32Cubemx, thiab xaiv lub moos siab tshaj plaws rau lub microcontroller uas koj siv (STM32L476 Kuv tab tom siv hauv qhov kev qhia no)

Kauj Ruam 5: Tsim Txoj Cai rau UVision Keil

Kauj Ruam 6: Sau Code rau LCD hauv Main.c File. Use Cov Kauj Ruam no Tsuas Yog Rau STM32L4 thiab STM32L0 Microcontrollers. Lwm Lwm Cov Microcontrollers Siv Koj Tus Kheej

Sau Txoj Cai rau LCD hauv Main.c File. Use Cov Kauj Ruam no Tsuas Yog Rau STM32L4 thiab STM32L0 Microcontrollers. Lwm Lwm Tus Microcontrollers Siv Koj Tus Kheej
Sau Txoj Cai rau LCD hauv Main.c File. Use Cov Kauj Ruam no Tsuas Yog Rau STM32L4 thiab STM32L0 Microcontrollers. Lwm Lwm Tus Microcontrollers Siv Koj Tus Kheej

Qhib main.c cov ntaub ntawv los ntawm cov phiaj xwm, cov ntawv qhia zaub mov ntawm Keil thiab sau cov lej rau LCD pib ua ntej thaum lub voj ntawm lub ntsiab. Refer daim duab txuas nrog.

Kauj Ruam 7: Sau Txoj Cai Thaum Lub Loop Sab Hauv Main.c Cov Ntaub Ntawv. Xa cov ntaub ntawv txuas nrog

Sau Txoj Cai thaum Thaum Loop Sab Hauv Main.c Cov Ntaub Ntawv. Xa cov ntaub ntawv txuas nrog
Sau Txoj Cai thaum Thaum Loop Sab Hauv Main.c Cov Ntaub Ntawv. Xa cov ntaub ntawv txuas nrog

Kauj Ruam 8: Sau Code hauv STM32L4xx_it.c Cov Ntaub Ntawv hauv Keil

Sau Code hauv STM32L4xx_it.c Cov Ntaub Ntawv hauv Keil
Sau Code hauv STM32L4xx_it.c Cov Ntaub Ntawv hauv Keil

Sau cov cai hauv STM32L4xx_it.c cov ntaub ntawv hauv Keil.see code hauv cov ntawv txuas nrog.

Kauj Ruam 9: Ntxiv Cov Hloov Pauv hauv Ob Qhov Ntaub Ntawv

Ntxiv qhov hloov pauv hauv ob qho ntaub ntawv
Ntxiv qhov hloov pauv hauv ob qho ntaub ntawv
Ntxiv Cov Hloov Pauv hauv Ob Cov Ntaub Ntawv
Ntxiv Cov Hloov Pauv hauv Ob Cov Ntaub Ntawv

Ntxiv qhov hloov pauv hauv ob qho ntawv. Saib cov ntawv txuas nrog.

Kauj Ruam 10: Los ntawm Cov Ntawv Qhia Ua Haujlwm hauv Uvision Keil Mus rau Submenu Application/Users

Los ntawm Cov ntawv qhia zaub mov hauv uvision Keil mus rau submenu Application/Users. Attach lcd_hd44780_stml4xx.c file (Txoj cai nyem rau ntawm lub submenu thiab mus rau qhov xaiv thiab muab cov ntawv tom qab luam peb lcd cov ntaub ntawv mus rau qhov chaw nplaub tshev ntawm keil.)

Kauj ruam 11: Sau koj li Code

Sau cov cai thiab Debug yog tias muaj qhov ua yuam kev.

Kauj Ruam 12: Ua Haujlwm Pab Pawg Nrog Microcontroller

Program lub rooj tsavxwm nrog microcontroller. Will tau txais cov zis zoo li hauv daim vis dis aus no.

Pom zoo: