Cov txheej txheem:

Yuav Ua Li Cas Siv DS1307 Siv Arduino: 7 Kauj Ruam
Yuav Ua Li Cas Siv DS1307 Siv Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Siv DS1307 Siv Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Siv DS1307 Siv Arduino: 7 Kauj Ruam
Video: Tsis Paub Yuav Ua Li Cas 2024, Kaum ib hlis
Anonim
Yuav Ua Li Cas Siv DS1307 Siv Arduino
Yuav Ua Li Cas Siv DS1307 Siv Arduino
Yuav Ua Li Cas Siv DS1307 Siv Arduino
Yuav Ua Li Cas Siv DS1307 Siv Arduino

DS1307 yog Lub Sijhawm Tiag IC (RTC). IC no yog siv los muab cov ntaub ntawv sijhawm. Lub sijhawm tau faib pib los ntawm Thib Ob, feeb, Teev, Hnub, Hnub, Hli, thiab Xyoo.

IC no xav tau cov khoom siv sab nraud ntxiv xws li Crystal thiab 3.6V Cov Roj Teeb. Crystal yog siv rau lub moos qhov chaw. Cov roj teeb tau siv rau lub zog thaub qab kom lub sijhawm ua haujlwm tsis raug tso tseg thaum cov khoom siv tseem ceeb raug txiav tawm.

Kuv hais kom yuav DS1307 tus qauv uas tau nruab nrog cov khoom siv sab nrauv.

Cheebtsam xav tau:

  • Arduino Nano V.3
  • TSO DS1307
  • Jumper Hlau
  • USB mini tso

Lub tsev qiv ntawv siv:

DS1307 RTC

Kauj Ruam 1: Txuas DS1307 rau Arduino

Txuas DS1307 rau Arduino
Txuas DS1307 rau Arduino
Txuas DS1307 rau Arduino
Txuas DS1307 rau Arduino

Txuas DS1307 rau Arduino Nano raws li daim duab lossis cov lus hauv qab no.

DS1307 rau Arduino Nano

VCC ==> +5V

GND ==> GND

SCL ==> A5

SDA ==> A4

DS ==> NC

Tom qab ntawd, txuas Arduino rau Lub Laptop / PC siv Mini USB.

Kauj Ruam 2: Ntxiv DS1307RTC Library

Ntxiv rau DS1307RTC Library
Ntxiv rau DS1307RTC Library
Ntxiv rau DS1307RTC Library
Ntxiv rau DS1307RTC Library
Ntxiv rau DS1307RTC Library
Ntxiv rau DS1307RTC Library

Lub tsev qiv ntawv DS1307 tuaj yeem rub tawm ntawm no:

Lub tsev qiv ntawv DS1307

Tom qab rub tawm tiav, Qhib "Skecth ==> Xws li Lub Tsev Qiv Ntawv ==> ntxiv. ZIp Library"

Nrhiav lub tsev qiv ntawv cov ntaub ntawv uas tau rub tawm.

Yog tias nws ua tiav, kaw Arduino thiab qhib nws dua.

Kauj Ruam 3: Xaiv Arduino Board

Xaiv Pawg Arduino
Xaiv Pawg Arduino

Qhib cov cuab yeej thiab xaiv pawg Arduino raws li daim duab saum toj no.

Pawg "Arduino Nano"

Proccesor: "ATmega328P (Old Bootloader)"

Kauj ruam 4: SetTime Sketch

Teeb Sijhawm
Teeb Sijhawm
Teeb Sijhawm
Teeb Sijhawm

Muaj ob daim duab kos uas yuav siv tau. Thawj daim duab yog "SetTime" siv los teeb lub sijhawm ntawm DS1307 kom haum rau lub sijhawm tam sim no. qhov thib ob yog "ReadTest" siv los tso saib lub sijhawm suav.

Upload Sijhawm:

Qhib Cov Ntaub Ntawv> Piv txwv> DS1307RTC> Teeb Sijhawm

Tom qab Sketch tau qhib nyem upload thiab tos ob peb lub sijhawm.

Yog tias cov txheej txheem upload tiav, qhib Serial Monitor kom pom lub sijhawm teev tseg.

Kauj ruam 5: Nyeem Daim Ntawv Teev Npe

ReadTest Sketch
ReadTest Sketch

Upload Sketch "ReadTes" kom ua tiav lub sijhawm ua haujlwm.

Qhib Cov Ntaub Ntawv> Piv txwv> DS1307RTC> Nyeem Xeem

Nyem upload thiab tos ob peb lub sijhawm. Tom qab cov txheej txheem upload tiav ua tiav qhib qhov saib ua ntej kom pom cov txiaj ntsig.

Kauj Ruam 6: Qhov tshwm sim

Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim

Yog tias ua tiav, tus lej saib xyuas yuav tshwm raws li qhia hauv daim duab 1.

Yog tias DS1307 Module tsis tau teeb tsa lossis tsis txuas nrog rau Arduino pawg thawj coj saib, cov lej saib xyuas yuav tshwm raws li qhia hauv daim duab 2.

Kauj Ruam 7: Lwm Yam Articel Txog RTC

Lwm Yam Articel Txog RTC
Lwm Yam Articel Txog RTC
Lwm Yam Articel Txog RTC
Lwm Yam Articel Txog RTC

Koj tuaj yeem siv LCD lossis 7-Segment Module los tso saib lub sijhawm tsim los ntawm RTC.

Yog tias koj tsis paub siv nws li cas, koj tuaj yeem pom kuv kab lus tom ntej ntawm "Yuav ua li cas tso saib lub sijhawm ntawm LCD" lossis "Yuav ua li cas tso saib lub sijhawm hauv 7-Segment Module" hauv kuv kab lus tom ntej.

Ua tsaug rau koj nyeem kab lus no, vam tias nws muaj txiaj ntsig.

Yog tias muaj lus nug, tsuas yog sau hauv kab lus.

Pom zoo: