mcpField
D
datasheet-interpreter

datasheet-interpreter

github.com/wedsamuel1230ドキュメント28153 回インストール2 週間前に更新
リポジトリ

datasheet-interpreter について

datasheet-interpreter は、部品のデータシート PDF から実用的な仕様を抽出するスキルです。メーカーや組み込み開発者が、ドライバーライブラリを作らずにピン、インターフェース、電気的制限、タイミング、レジスター情報を確認できます。

主な機能

  1. 01PDF データシートから仕様を抽出
  2. 02URL から取得またはローカル PDF を読込
  3. 03ピン、インターフェース、動作制限の確認
  4. 04タイミングとレジスター情報の検索
  5. 05配線図とサンプルコードの作成

活用シーン

  1. 01チップの I2C アドレスやピン配置の確認
  2. 02配線前の電圧・電流制限の確認
  3. 03タイミングやレジスター情報の調査
  4. 04データシートから部品のクイックリファレンスを作成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/wedsamuel1230/embedded-engineering-skills --skill datasheet-interpreter

インストール後、Claude Code で/datasheet-interpreterを入力して読み込まれたか確認します。

同梱ファイルreferences/common-parameters.mdscripts/extract_specs.py

詳細

データシートインタープリター

部品のデータシート PDF から、実用的な仕様を抽出します。

リソース

スクリプト
  • scripts/extract_specs.py - URL からデータシート PDF をダウンロードし、パターンマッチングで仕様を抽出します
参考資料
  • references/common-parameters.md - データシートのパラメーターを理解するためのガイド
クイックスタート
# Extract specs from a datasheet URL
uv run --no-project scripts/extract_specs.py --url "https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf"

# Extract specs with markdown output
uv run --no-project scripts/extract_specs.py --url "https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf" --format markdown

# Extract from local PDF file
uv run --no-project scripts/extract_specs.py --file "local_datasheet.pdf"

# Interactive mode
uv run --no-project scripts/extract_specs.py --interactive

使用する場面

  • 「このチップの I2C アドレスは何ですか?」
  • 「このセンサーはどのように接続しますか?」
  • 「このモジュールの各ピンの機能は何ですか?」
  • ユーザーが PDF データシートの URL を共有した場合
  • タイミング仕様やレジスター情報が必要な場合
  • ドライバーを完全に生成せずに、すぐに参照したい場合

他のスキルとの関係

  • datasheet-parser:ドライバーライブラリーを完全に生成します(lexus2k 形式)
  • datasheet-interpreter(このスキル):すぐに使える仕様を素早く抽出します

情報抽出ワークフロー

ステップ 1:データシートをリクエストする
Please provide:
1. Component name (e.g., "BME280", "MPU6050")
2. Datasheet PDF file or URL (manufacturer version preferred)
3. What specific information you need:
   □ Pin assignments / pinout
   □ I2C/SPI address and protocol
   □ Operating conditions (voltage, current)
   □ Timing requirements
   □ Register map
   □ Example circuit
   □ All of the above
ステップ 2:PDF の品質を検証する

確認項目:

  • テキストを検索できる(スキャン画像ではない)
  • メーカー公式のデータシートである(クローンや販売代理店の概要資料ではない)
  • 改訂版/バージョン番号が記載されている
  • 文書が完全である(該当する場合はレジスターテーブルを含む)

PDF に問題がある場合:

⚠️ This appears to be a [scanned image | partial datasheet | third-party summary].

For best results, please provide the official manufacturer datasheet from:
- [Manufacturer website link]
- Or search: "[component] datasheet pdf site:manufacturer.com"

抽出テンプレート

クイックリファレンスカード

あらゆる部品について、以下を生成します。

# [Component Name] Quick Reference

## Basic Info
- **Manufacturer:** [name]
- **Part Number:** [full part number with variants]
- **Datasheet Version:** [rev/date]
- **Description:** [one-line description]

## Electrical Characteristics
| Parameter | Min | Typ | Max | Unit |
|-----------|-----|-----|-----|------|
| Supply Voltage (VDD) | | | | V |
| Operating Current | | | | mA |
| Sleep Current | | | | µA |
| Operating Temp | | | | °C |

## Communication Interface
- **Protocol:** [I2C / SPI / UART / GPIO]
- **Address:** [0xNN (7-bit)] or [selectable via pin]
- **Max Clock:** [frequency]
- **Logic Levels:** [3.3V / 5V tolerant]

## Pinout
| Pin | Name | Type | Description |
|-----|------|------|-------------|
| 1 | VDD | Power | Supply voltage |
| 2 | GND | Power | Ground |
| ... | ... | ... | ... |

## Key Registers (if applicable)
| Address | Name | R/W | Description |
|---------|------|-----|-------------|
| 0x00 | WHO_AM_I | R | Device ID (expect 0xNN) |
| ... | ... | ... | ... |

## Arduino Wiring
| Component Pin | Arduino Uno | ESP32 | Pico |
|---------------|-------------|-------|------|
| VCC | 3.3V | 3.3V | 3V3 |
| GND | GND | GND | GND |
| SDA | A4 | GPIO21 | GP4 |
| SCL | A5 | GPIO22 | GP5 |

## Important Notes
- [Critical warnings from datasheet]
- [Application notes]

一般的な部品カテゴリー

I2C センサー

抽出項目:

□ I2C address (7-bit format, note if configurable)
□ WHO_AM_I register address and expected value
□ Configuration register settings
□ Data registers (where to read measurements)
□ Resolution and range options
□ Conversion time / measurement rate

I2C アドレスのクイックリファレンス:

部品アドレス(7 ビット)設定ピン別のアドレス
BME2800x76SDO→GND0x77(SDO→VDD)
BME6800x76SDO→GND0x77(SDO→VDD)
MPU60500x68AD0→GND0x69(AD0→VDD)
SHT300x44ADDR→GND0x45(ADDR→VDD)
BH17500x23ADDR→GND0x5C(ADDR→VDD)
VL53L0X0x29-ソフトウェアで設定可能
INA2190x40A0,A10x40-0x4F
ADS11150x48ADDR→GND0x49-0x4B
SPI デバイス

抽出項目:

□ SPI mode (CPOL, CPHA)
□ Max clock frequency
□ Data order (MSB/LSB first)
□ Command format
□ Chip select behavior (active low?)
モータードライバー

抽出項目:

□ Logic voltage (VCC)
□ Motor voltage range (VM)
□ Current per channel (continuous/peak)
□ Control interface (PWM frequency, step/dir)
□ Protection features (thermal, overcurrent)
□ H-bridge or half-bridge
ディスプレイモジュール

抽出項目:

□ Resolution (width x height)
□ Controller IC (SSD1306, ILI9341, etc.)
□ Interface (I2C, SPI, parallel)
□ Memory map / pixel format
□ Initialization sequence
□ Refresh rate

重要な仕様の検索

電源計画用
Search datasheet for:
- "Electrical Characteristics" table
- "Power Consumption" or "Current Consumption"
- "Typical Operating Conditions"
- Sleep/standby modes and their currents

テンプレート出力:

## Power Specs for [Component]

### Operating Modes
| Mode | Typical Current | Conditions |
|------|-----------------|------------|
| Active | XXX mA | [freq, voltage, etc.] |
| Idle | XXX µA | |
| Sleep/Standby | XXX µA | |
| Deep Sleep | XXX nA | |

### Wake-up Time
- From sleep: XXX ms
- From deep sleep: XXX ms
タイミング要件用
Search datasheet for:
- "Timing Characteristics"
- "AC Characteristics"
- Setup/hold times
- Clock specifications
ピンの許容電圧用
Search datasheet for:
- "Absolute Maximum Ratings"
- "ESD protection"
- "5V tolerant" mentions
- Input voltage specifications

レジスターマップの抽出

構造化形式
// [Component] Register Definitions
// Extracted from datasheet v[X.Y], p.[N]

// === REGISTER ADDRESSES ===
#define REG_NAME          0x00  // Description

// === BITFIELD DEFINITIONS ===
// REG_NAME (0x00) - [Description]
// Bit 7-6: FIELD_A - [description]
// Bit 5:   FIELD_B - [description]
// Bit 4-0: FIELD_C - [description]

#define REG_NAME_FIELD_A_MASK    0xC0
#define REG_NAME_FIELD_A_POS     6
#define REG_NAME_FIELD_B_BIT     5
#define REG_NAME_FIELD_C_MASK    0x1F
一般的なレジスターパターン

設定レジスター:

- Enable/disable features
- Set operating mode
- Configure interrupt behavior

ステータスレジスター:

- Data ready flags
- Error/fault indicators
- Interrupt sources

データレジスター:

- Usually consecutive addresses
- Note byte order (MSB first or LSB first)
- Signed vs unsigned interpretation

配線図ジェネレーター

テキストベースの配線図を生成します。

  [Component]          [Arduino Uno]
  ┌─────────┐         ┌───────────┐
  │ VCC ────┼─────────┤ 3.3V      │
  │ GND ────┼─────────┤ GND       │
  │ SDA ────┼─────────┤ A4 (SDA)  │
  │ SCL ────┼─────────┤ A5 (SCL)  │
  │ INT ────┼─────────┤ D2 (INT0) │
  └─────────┘         └───────────┘
  
  Notes:
  - Add 4.7kΩ pull-ups on SDA/SCL if not on module
  - INT is open-drain, needs pull-up

サンプルコードジェネレーター

抽出した仕様に基づいて、最小限の動作サンプルを生成します。

/*
 * [Component] Basic Example
 * Generated from datasheet interpretation
 * 
 * Wiring:
 * - VCC → 3.3V
 * - GND → GND
 * - SDA → A4 (Arduino Uno) / GPIO21 (ESP32)
 * - SCL → A5 (Arduino Uno) / GPIO22 (ESP32)
 */

#include <Wire.h>

#define COMPONENT_ADDR  0x00  // From datasheet p.X
#define REG_WHO_AM_I    0x00  // Expected: 0xNN
#define REG_CTRL        0x00  // Configuration
#define REG_DATA        0x00  // Data output

void setup() {
  Serial.begin(115200);
  Wire.begin();
  
  // Verify communication
  Wire.beginTransmission(COMPONENT_ADDR);
  if (Wire.endTransmission() != 0) {
    Serial.println("Component not found!");
    while(1);
  }
  
  // Read device ID
  uint8_t id = readReg(REG_WHO_AM_I);
  Serial.print("Device ID: 0x");
  Serial.println(id, HEX);
  
  // Initialize
  writeReg(REG_CTRL, 0x00);  // [Configuration value from datasheet]
}

void loop() {
  // Read data
  int16_t data = readReg16(REG_DATA);
  Serial.println(data);
  delay(100);
}

uint8_t readReg(uint8_t reg) {
  Wire.beginTransmission(COMPONENT_ADDR);
  Wire.write(reg);
  Wire.endTransmission(false);
  Wire.requestFrom(COMPONENT_ADDR, (uint8_t)1);
  return Wire.read();
}

void writeReg(uint8_t reg, uint8_t val) {
  Wire.beginTransmission(COMPONENT_ADDR);
  Wire.write(reg);
  Wire.write(val);
  Wire.endTransmission();
}

int16_t readReg16(uint8_t reg) {
  Wire.beginTransmission(COMPONENT_ADDR);
  Wire.write(reg);
  Wire.endTransmission(false);
  Wire.requestFrom(COMPONENT_ADDR, (uint8_t)2);
  int16_t val = Wire.read() << 8;  // MSB first (check datasheet!)
  val |= Wire.read();
  return val;
}

クイック検索データベース

よくある質問への回答

「[component] に必要な電圧は?」 → 「Absolute Maximum Ratings」と「Recommended Operating Conditions」を確認します

「3.3V と 5V のどちらですか?」 → 電気的特性で「VDD」または「VCC」を探します → I/O ピンが「5V tolerant」かどうかを確認します

「I2C はどのくらいの速度で動作させられますか?」 → タイミング仕様で「I2C Clock Frequency」を探します(通常、標準モードは 100kHz、高速モードは 400kHz です)

「スリープ状態から復帰させるには?」 → 「Power Management」または「Operating Modes」のセクションを探します

「想定したアドレスで応答しないのはなぜですか?」 → アドレス選択ピン(AD0、ADDR、SA0)を確認します → 8 ビットアドレスが記載されているデータシートもあります(7 ビットにするには 2 で割ります)


データシートを読む際のヒント

重要な情報の記載箇所
情報セクション名
I2C アドレス「Serial Interface」または「Communication」
電圧/電流「Electrical Characteristics」
ピン配置「Pin Configuration」または「Package Information」
レジスター「Register Map」または「Memory Map」
タイミング「Timing Characteristics」または「AC Characteristics」
回路例「Application Information」または「Typical Application」
データシートの注意信号
  • 🚩 絶対最大定格の記載がない
  • 🚩 バージョン/改訂番号がない
  • 🚩 レジスターの説明に一貫性がない
  • 🚩 機械翻訳されたテキスト
  • 🚩 プロトコルのタイミング図がない

→ これらが見られる場合は、元のメーカーが公開している、より品質の高いデータシートを探してください

共通出力契約

共通の Arduino スキル契約を使用してください。 前提条件、必要なツールとバージョン、実装手順、証明段階ごとのテスト/証拠、 既知の制限事項、復旧/セキュリティに関する注記を明記してください。

コメント