芯片 · microcontrollers
ATmega328P 微控制器
ATmega328P 是 Arduino Uno 的微控制器:8 位 AVR 内核、32 KB 闪存、1 KB SRAM、23 个 I/O、定时器、USART、I²C 和 SPI。CircuSim 可以导入 Arduino IDE 编译出的 .hex 并运行固件。
在 CircuSim 里,这颗芯片是原理图上的一个符号:引脚位置和封装一致,内部逻辑或模拟行为由模型实现。下面把最常查的引脚、功能和未建模项放在同一页,方便在画图前先核对。如果这个型号不在当前列表里,编辑器的芯片分类里仍然可以搜索到它。本页只描述模型支持的部分,完整边界见能力边界页。
引脚表按封装顺序排列;如果同一功能有多个别名,以原理图符号上的名称为准。相关示例可以直接打开,观察它在电路里的行为。
功能
Arduino Uno 微控制器;运行编译后的 .hex
引脚
按封装从 pin 1 开始。引脚名是原理图符号上的名字,和 datasheet 的编号顺序一致。
| Pin | 名称 |
|---|---|
| 1 | RESET |
| 2 | PD0 |
| 3 | PD1 |
| 4 | PD2 |
| 5 | PD3 |
| 6 | PD4 |
| 7 | VCC |
| 8 | GND |
| 9 | PB6 |
| 10 | PB7 |
| 11 | PD5 |
| 12 | PD6 |
| 13 | PD7 |
| 14 | PB0 |
| 15 | PB1 |
| 16 | PB2 |
| 17 | PB3 |
| 18 | PB4 |
| 19 | PB5 |
| 20 | AVCC |
| 21 | AREF |
| 22 | AGND |
| 23 | PC0 |
| 24 | PC1 |
| 25 | PC2 |
| 26 | PC3 |
| 27 | PC4 |
| 28 | PC5 |
本仿真器未建模的部分
Runs the .hex the Arduino IDE exports: the CPU, the pins and their pull-ups, interrupts, the three timers, serial in and out — type to it in the inspector — the EEPROM, erased at the start of every run, the watchdog, which resets the chip or wakes it from sleep, and analogRead(), which measures A0 to A5 against AVCC, AREF or the internal 1.1 V when its conversion samples. I²C reaches only the LCD modules wired to A4 and A5; SPI is a master on the pins, clocking D13 and D11 and reading D12, so a scope or a shift register sees every bit; a sketch that uses SPI as a slave is told so while it runs. AVCC is the converter's supply and reference, so analogRead() needs it wired, as on the real chip; the clock is set in the inspector rather than by a crystal on PB6 and PB7.
完整的能力边界见 能力边界。
相关示例
常见问题
CircuSim 能运行真实的 Arduino 程序吗?
可以。把 Arduino IDE 编译出的 .hex 导入芯片或 Uno 的检查器,即可运行;支持数字/模拟引脚、串口、I²C、SPI 和部分模块。
哪些外设没有仿真?
模拟比较器、SPI 从模式、片内温度传感器等没有建模;程序继续运行,但读取这些外设不会得到真实芯片的结果。