用matlab自动生成PWM源代码,keil4编译后灌入8051芯片内,在proteus上仿真实现pwm.很好地显示了自动代码生成的过程。pwm.mdl是模型文件,pwmsil_ert_rtw在环测试。pwmsil8051_ert_rtw是keil4文件夹。pwm.dsn是proteus仿真电路图。pwmsil8051_ert_rtw是keil4文件夹。pwm.dsn是proteus电路图。
仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
单片机源程序如下:
所有资料51hei提供下载:
pwm-simulink.zip
(472.35 KB, 下载次数: 41)
|