🏠
🌡️ 📆 令和6年4月20日
戻る 進む

🗒️ ESP8266(Nefry)のtimer1割り込み

⇒#2252@研究ノート;

日時
関係者(共同研究者)

http://amenity.yz.yamagata-u.ac.jp/
#HTTPS

ESP8266にはタイマーつ搭載されているようあるそのつのtimer123bit CountDown Timerになっている(https://github.c…).すなわち223-1の値までタイマーに指定できるさらにプリスケーラ1, 16, 256が搭載されている基本クロCPUクロ周波数80MHz基準しているようであるタイマー最大値はプリスケーラ256にしたときに26.8秒となるそれ以上はtimer2割り込みが使えそうであるがその関数はまだ見つかっていないなおtimer232bit CountUp Timerになっている

ライブラリークラス
https://github.c…


サンプルコード
https://github.c…

以下ダーファイルから抜粋↓
https://github.c…
//timer dividers
#define TIM_DIV1 0 //80MHz (80 ticks/us - 104857.588 us max)
#define TIM_DIV16 1 //5MHz (5 ticks/us - 1677721.4 us max)
#define TIM_DIV265 3 //312.5Khz (1 tick = 3.2us - 26843542.4 us max)
//timer int_types
#define TIM_EDGE 0
#define TIM_LEVEL 1
//timer reload values
#define TIM_SINGLE 0 //on interrupt routine you need to write a new value to start the timer again
#define TIM_LOOP 1 //on interrupt the counter will start with the same value again

#define timer1_read() (T1V)
#define timer1_enabled() ((T1C & (1 << TCTE)) != 0)
#define timer1_interrupted() ((T1C & (1 << TCIS)) != 0)

typedef void(*timercallback)(void);

void timer1_isr_init(void);
void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload);
void timer1_disable(void);
void timer1_attachInterrupt(timercallback userFunc);
void timer1_detachInterrupt(void);
void timer1_write(uint32_t ticks); //maximum ticks 8388607

関連: Nefry

器具・消耗品(履歴)
履歴ID概要
サンプル(履歴)
履歴ID概要
装置(履歴)
履歴ID概要

  1 375 🖱 テキスト画像変換

テキストは、文字コードの羅列です。 文字コードを 表示や印刷するには、フォントを使って画像にします。


西暦と元号

  1 西暦と元号
西暦 令和 🔷 平成 🔷 昭和 🔷 大正 🔷 明治
2012 R-6 H24 S87 T101 M145
2013 R-5 H25 S88 T102 M146
2014 R-4 H26 S89 T103 M147
2015 R-3 H27 S90 T104 M148
2016 R-2 H28 S91 T105 M149
2017 R-1 H29 S92 T106 M150
2018 R0 H30 S93 T107 M151
2019 R1 H31 S94 T108 M152
2020 R2 H32 S95 T109 M153
2021 R3 H33 S96 T110 M154
2022 R4 H34 S97 T111 M155
*

参考文献


QRコード
https://edu.yz.yamagata-u.ac.jp/developer/Asp/Youzan/Laboratory/LaboNote/@LaboNote.asp?id=2252
名称: 教育用公開ウェブサービス
URL: 🔗 https://edu.yz.yamagata-u.ac.jp/
管理運用 山形大学 学術情報基盤センター

🎄🎂🌃🕯🎉
名称: サイバーキャンパス「鷹山」
URL: 🔗 http://amenity.yz.yamagata-u.ac.jp/
管理運用 山形大学 データベースアメニティ研究会
〒992-8510 山形県米沢市城南4丁目3-16

Copyright ©1996- 2024 Databese Amenity Laboratory of Virtual Research Institute,  Yamagata University All Rights Reserved.