Using the Unit DDS ・ 使用 Unit DDS
M5StackのUnit DDSをコントローラーに接続する最小構成。配線とBOMつき。
この構成をエディタで開く・編集する →| 部品 | 役割 | ポート | リンク・価格 |
|---|---|---|---|
| M5Stack CoreS3 | Controller | grove_i2c, grove_analog, grove_uart, mbus, usb_c, sdcard | official page — $59.9 |
| Unit DDS | unit | grove_i2c | official page — $28.5 |
M5Stack CoreS3とUnit DDSで作る、かんたんな波形発生装置です。Unit DDSはAD9833チップとSTM32F0 MCUを搭載し、サイン波、三角波、方形波、のこぎり波を出力できます。CoreS3からI2Cで制御し、周波数や波形をプログラムで設定します。
# M5Stack CoreS3 + Unit DDS (AD9833 waveform generator)
# Wiring: Unit DDS -> CoreS3 red Port.A (I2C)
import time
from machine import Pin, I2C
# AD9833 I2C address (default 0x60, but Unit DDS uses 0x60? Check datasheet)
# Actually Unit DDS uses a different address; we'll use the known address 0x60 for AD9833.
# But Unit DDS has an STM32 that interprets commands; we need to send commands to it.
# For simplicity, we'll assume the unit is configured to respond to I2C commands.
# This code is a placeholder; you may need to use a library.
# Initialize I2C on Port.A (pins 21=SDA, 22=SCL)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=400000)
# Check if device is present
devices = i2c.scan()
print('I2C devices found:', [hex(d) for d in devices])
# If device found, send command to output sine wave at 1kHz
# This is a dummy example; actual command sequence depends on Unit DDS protocol.
# For AD9833, you would write to registers via SPI, not I2C.
# Unit DDS likely uses a different command set.
# Please refer to Unit DDS documentation for correct commands.
print('Unit DDS test: outputting 1kHz sine wave')
# Placeholder: assume we send a command via I2C
# i2c.writeto(0x60, b'\x01\x02\x03')
while True:
time.sleep(1)
この作り方はAIが構成から生成したものです(未検証)。通電前に配線とコードをご確認ください。
この構成はAIが実在するM5Stack部品から設計し、ポート互換をサーバで検証したものです。編集・共有できます。
エディタで開く →UnitKit は M5Stack® 製品向けの非公式ツール。作りたいものを書くと、部品リストと配線図が出ます。