Skip to content

JameChou/prechin-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

89C52RC-demo

sdcc your_location.c
packiph your_iph_file > your_hex.hex
stcgal -P stc89 -p /dev/tty.<your_port> <name.ihx>

注意芯片如果不是89C52RC: stcgal是无法烧制程序进入芯片的。

环境准备(Macos)

  1. 下载CH34* USB 驱动 下载地址 并安装,重启系统。
ls /dev/tt.*

查看是否已经成功驱动上。

  1. 安装sdcc环境
brew install sdcc
  1. 安装stcgal clone下相关地址 prev条件需要安装python2或者python3
git clone https://github.com/grigorig/stcgal

cd stcgal
./setup.py build

sudo ./setup.py install
  1. 编译Lib
# /lib/Makefile

default-target: all

all:
		for n in $(LIB_DIRS); do cd $$n && make all && cd ..; done
  1. 编译运行某个程序

进入相应目录查看Makefile文件来进行编译,亦可手动编译,但是前置条件需要把lib目录的相关先进行编译处理。

  1. 串口通信

使用 COMTool 来进行测试。

基础

  1. 点亮第一个LED
  2. 蜂鸣器
  3. 继电器
  4. 数码管
  5. 独立按键
  6. 组合按键
  7. IO扩展并转串
  8. IO扩展串转并
  9. LED矩阵
  10. 五线四项步进电机
  11. 步进电机
  12. 中断系统介绍
  13. 外部中断
  14. 定时器中断
  15. ADC
  16. DAC
  17. 串口通信
  18. LCD1602
  19. DS1302时钟
  20. I2C
  21. DS18B20&SINGLE_BUS