☰
Apple Silicon 搭建51单片机开发环境
2026/10/17 4:21:13 网站建设 项目流程
  • Mac M1
  • STC89C52RC

安装工具

# homebrew/bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"# vscodebrewinstall--caskvisual-studio-code# Pythonbrewinstallpython3# USB转串口https://www.wch.cn/downloads/CH341SER_MAC_ZIP.html](https://www.wch.cn/downloads/CH341SER_MAC_ZIP.html# sdccbrewinstallsdcc sdcc-v# stcgalpip3installstcgal

VSCode

插件

C/C++ Extension Pack

c_cpp_properties.json

{"configurations":[{"name":"SDCC 8051 Mac","intelliSenseMode":"macos-clang-x64","compilerPath":"/opt/homebrew/bin/sdcc","cStandard":"c11","includePath":["${workspaceFolder}/**","/opt/homebrew/share/sdcc/include","/opt/homebrew/share/sdcc/include/mcs51"],"defines":["__SDCC","__MCS51__"]}],"version":4}

sdcc头文件

#include<mcs51/8052.h>

编译烧录

# 编译为 .ihx 文件sdcc main.c# sdcc -mmcs51 file1.c file2.c file3.c main.c# 查询串口 | 例:/dev/tty.wchusbserial210ls/dev/tty.wch*# 烧录 | -P 指定芯片系列 -p 指定串口sudostcgal-Pstc89-p/dev/tty.wchusbserial210 main.ihx

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询