展示HN:香料仿真 → 示波器 → 使用Claude Code进行验证
Show HN: Spice simulation → oscilloscope → verification with Claude Code

原始链接: https://lucasgerads.com/blog/lecroy-mcp-spice-demo/

卢卡斯·杰拉德斯一直在探索使用 Claude Code 进行硬件开发,发现从自然语言提示直接创建电路对于简单的设计之外的电路来说具有挑战性。 通过赋予 Claude 访问工具(SPICE 模拟器和示波器)的能力,以便获得即时反馈和验证,他的工作流程得到了显著改善。 这使得 Claude 能够验证 SPICE 电路,协助嵌入式编程,并且至关重要的是,自动化以前手动完成的繁琐数据分析任务,例如归一化和对齐。杰拉德斯强调向 Claude 提供*明确*的信息:微控制器的详细引脚图,用于构建/闪存命令的预定义 Makefile,以及避免直接访问原始数据(更喜欢文件交互)。 关键在于,Claude Code 在与现有工具集成到硬件开发循环中时表现出色,而不是试图仅根据自然语言从头开始生成设计。

一位 Hacker News 用户 (_fizz_buzz_) 分享了一个项目,该项目使用 Claude Code 和 MCP (消息控制协议) 连接 SPICE 模拟器和示波器,从而创建一个闭环测试系统。目标是允许 Claude Code 根据实际硬件反馈自动修改微控制器 (MCU) 代码。 虽然 Claude Code *可以* 自我纠正和调整代码,但它并非完全自主。用户指出偶尔会出现错误——错误地声称模拟匹配,或做出次优的编码选择(例如使用位操作代替 UART)。因此,在整个测试过程中,人工验证仍然至关重要。 本质上,该项目展示了人工智能辅助硬件开发方面的一个有趣步骤,但也强调了目前需要人工监督以确保准确性和效率。另一位用户赞扬了连接模拟和实际硬件的概念。
相关文章

原文
SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads

I have been experimenting with using Claude Code for hardware development over the past few weeks. I looked at some projects that use Claude similarly to how one would in software development: Write a prompt in natural language, let Claude create a circuit. I found it somewhat tricky to express what I want to build in plain English. It worked fine for trivial circuits but became difficult for more complex designs. I also realized that Claude Code really shines when it can get immediate feedback.

So I tried a different approach: give Claude access to my oscilloscope and a SPICE simulator. This has become extremely valuable for validating SPICE circuits and models, embedded programming, and data analysis. In particular the data analysis had been very tedious before: normalizing the time axis, aligning data, and so on. Usually I would just eyeball it.

Below is a deliberately simple demo showcasing my setup and workflow. The circuit and MCU are trivial. The point is to illustrate the approach, which scales well to much more complex circuits and real embedded projects.

A few lessons learned:

Oscilloscope

  • Claude doesn't see your physical setup. Don't let it guess what is connected where.
  • Make sure Claude never gets stale measurement data.
  • Don't dump raw data into Claude's context. Save it to a file and let Claude interact with it indirectly.

Microcontroller

  • Give Claude a pinout/pinmux map explicitly.
  • Prepare a Makefile that exposes functions like build, flash, ping, and erase, and encourage Claude to rely on it. Claude should not construct these commands on the fly.

Repos

联系我们 contact @ memedata.com