Cov txheej txheem:

Animation ntawm 16x2 I2c LCD Siv STM32 Nucleo: 4 Kauj Ruam
Animation ntawm 16x2 I2c LCD Siv STM32 Nucleo: 4 Kauj Ruam

Video: Animation ntawm 16x2 I2c LCD Siv STM32 Nucleo: 4 Kauj Ruam

Video: Animation ntawm 16x2 I2c LCD Siv STM32 Nucleo: 4 Kauj Ruam
Video: (Hmong Animation) Tus Qav & Tus Tsov 2024, Hlis ntuj nqeg
Anonim
Image
Image

Nyob zoo cov phooj ywg, qhov no yog cov lus qhia qhia yuav ua li cas thiaj tsim cov tsiaj ntawv tshwj xeeb ntawm 16x2 i2c LCD. Txhua yam tsawg heev uas xav tau rau txoj haujlwm, yog li yog koj nkag mus rau txoj cai koj tuaj yeem ua tiav hauv 1 teev.

Tom qab ua raws cov lus qhia no koj yuav tuaj yeem tsim koj tus kheej kev nyiam ua duab ntawm microcontroller.

ELECTRONICS xav tau rau txoj haujlwm:-

1) STM32L476RG Nucelo Board

2) 16x2 i2c LCD

3) Jumper Xov

SOFTWARE xav tau:-

1) STM32cubemx

2) Keil uVision5

Kev Sib Txuas: Txuas PB6 rau I2C-SCK thiab I2C-SDA rau PB7 tus pin ntawm nucleo board.

Kauj Ruam 1: Qhib STM32Cubemx thiab teeb tsa kom raug rau cov duab txuas nrog

Qhib STM32Cubemx thiab teeb tsa kom sib haum rau cov duab txuas nrog
Qhib STM32Cubemx thiab teeb tsa kom sib haum rau cov duab txuas nrog
Qhib STM32Cubemx thiab teeb tsa kom sib haum rau cov duab txuas nrog
Qhib STM32Cubemx thiab teeb tsa kom sib haum rau cov duab txuas nrog

1) Tom qab xaiv STM32L476RG ua microcontroller hauv STM32CUBE xaiv I2C1 interface li i2c.

2) Teem sijhawm tus nqi rau tus nqi siab tshaj (80Mhz)

3) Tom qab ntawd xaiv Timer1 thiab Timer2 thiab tom qab ntawd pib nws qhov txiaj ntsig raws li tau hais hauv ntu tom qab ntawm kev qhia.

4) Xaiv Timer1 hloov tshiab cuam tshuam thiab Timer2 thoob ntiaj teb cuam tshuam hauv NVIC teeb tsa.

5) Tsim cov cai rau Txoj Haujlwm hauv Keil 5.

Kauj Ruam 2: Ua Kom Tsim Nyog Cov Duab thiab Ntxiv Nws Cov Cai hauv Custom_char.h Cov Ntaub Ntawv

Ua Kom Tsim Nyog Cov Duab thiab Ntxiv Nws Cov Cai hauv Custom_char.h Cov Ntaub Ntawv
Ua Kom Tsim Nyog Cov Duab thiab Ntxiv Nws Cov Cai hauv Custom_char.h Cov Ntaub Ntawv
Ua Kom Tsim Nyog Cov Duab thiab Ntxiv Nws Cov Cai hauv Custom_char.h Cov Ntaub Ntawv
Ua Kom Tsim Nyog Cov Duab thiab Ntxiv Nws Cov Cai hauv Custom_char.h Cov Ntaub Ntawv

1) Txhua txoj haujlwm hauv 16x2 lcd tuaj yeem faib ua 32 ntu, txhua ntu muaj 5x8 pixels.

2) Koj tuaj yeem pom cov duab thiab nws thaj tsam ntawm ntu thiab sawv cev rau txhua feem ntawm ntu nrog tus nqi 1 yog tias txoj haujlwm ntawm ntu yog ib feem ntawm daim duab txwv tsis pub muab nws ua tus nqi 0 uas muab tus nqi rau txhua kab raws li qhia hauv kab ntawv txuas daim duab

3) Muab tus nqi ntawd los ntawm step2 hauv cov ntawv custom_char.h muab rau hauv cov cai txuas nrog.

Kauj Ruam 3: Ntxiv Cov Cai Tseem Ceeb hauv Keil 5

Ntxiv Txoj Cai Tseem Ceeb hauv Keil 5
Ntxiv Txoj Cai Tseem Ceeb hauv Keil 5
Ntxiv Txoj Cai Tseem Ceeb hauv Keil 5
Ntxiv Txoj Cai Tseem Ceeb hauv Keil 5
Ntxiv Txoj Cai Tseem Ceeb hauv Keil 5
Ntxiv Txoj Cai Tseem Ceeb hauv Keil 5

1) Sau cov lus txib kom pib Timer1 thiab Timer2 hauv main.c file. Timer 1 yog siv los tshem cov LCD thiab Timer2 yog siv los tso saib cov duab.

2) Sau qhov tseem ceeb rau Prescalar thiab Autoreload qhov tseem ceeb rau Timer1 thiab Timer2 hauv cov ntaub ntawv main.c uas zoo ib yam rau ob lub sijhawm.

3) Ntxiv cov cai cuam tshuam hauv Timer1 cuam tshuam niaj hnub thiab rau Timer2 cuam tshuam niaj hnub hauv stm32l4_it.c cov ntaub ntawv.

Pom zoo: