avr: Timer0 overflow interrupt uses about one third of the CPU time
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go
調査の方向性
Start by reading the AVR Timer0 clock and PWM code, then inspect the changes described in linked issues #6070 and #6071, which this proposal depends on. Reproduce the timing measurements on an ATmega328P if hardware is available, and check how prescaler changes affect ticks() and short sleeps. Done means Timer0 uses the proposed prescaler while maintaining the intended time resolution, with the reported flash and runtime costs understood.
索引モデルが issue の本文から書いたものです。
説明
On ATmega328P and ATmega1280/2560, the runtime sets Timer0 to prescaler 1 for the monotonic clock. The overflow interrupt then fires every 256 CPU cycles (16 µs at 16 MHz), and each interrupt does a 64-bit add. On an ATmega328P this takes about one third of the CPU time.
Measurements
ATmega328P (Freetronics Eleven, Uno clone) at 16 MHz, TinyGo 0.44.0. A loop wrote 32768 bytes to the SPI0 registers at 8 MHz:
| Timer0 overflow interrupt | Time |
|---|---|
| on (default) | 126 ms |
| off | 83 ms |
Both builds used -opt=2. With the default -opt=z the times were 196 ms and 126 ms.
On a SparkFun MicroView (ATmega328P), a Lorenz attractor demo on the OLED ran 13.4 frames per second with the default timer, and 20.8 frames per second with prescaler 64.
Proposal
Use prescaler 64, as the Arduino core does. The interrupt then fires every 1024 µs. To keep a fine time resolution, ticks() can add TCNT0 times the time per count, which gives 4 µs steps. Sleeps shorter than one tick can busy wait.
Cost, measured: blinky1 for arduino grows by 320 bytes of flash. RAM stays the same.
This change depends on #6071 and #6070, because the PWM code can change the Timer0 prescaler at run time.
- 主要言語
- Go
- スター
- 17.8k
- フォーク
- 1.1k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 380
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tinygo-org/tinygo のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6727 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
tinygo-org/tinygo#6711 ·
メンテナーはふだん 1 日以内に返信
-
Builds are not reproducible: cgo snippet paths in debug info対応中かも @tridev-tej が 1 日前に担当しました。 オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6619 ·
メンテナーはふだん 1 日以内に返信
-
Fix the targets that tinygo build -target rejects対応中かも @narguis が 2 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
tinygo-org/tinygo#6617 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
tinygo-org/tinygo#6312 ·
メンテナーはふだん 1 日以内に返信
tinygo-org/tinygo の issue をすべて見る
似ている issue
-
release
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
github/gh-aw-mcpg#17603 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
oras-project/oras-go#1827 ·
メンテナーはふだん 1 日以内に返信
-
docs: database/sql Sessions example never commits its batch, and its "Full Example" link is a 404オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
ClickHouse/clickhouse-go#2185 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage receiver/podman
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-collector-contrib#53700 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
tagvalue.Read fails with "token too long" on lines over 64 KiB対応中かも @G26karthik が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
spdx/tools-golang#319 ·