文件名称:PWM12-simulate-proteus
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [MacOS] [C/C++] [源码]
- 上传时间:
- 2013-11-21
- 文件大小:
- 46kb
- 下载次数:
- 0次
- 提 供 者:
- j**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
这是利用proteus进行仿真,利用的是AVR单片机,对步进电机进行控制,有详细的仿真图-#include "config.h"
#include "PWM.h"
void PWM_Init(uint8 Mode, uint8 FioSelect)
{
switch(Mode)
{
case FAST_PWM:
TCCR0 &= (~(1 << WGM01) & ~(1 << WGM00))
TCCR0 |= (1 << WGM01) | (1 << WGM00)
break
case PHASE_FIX_PWM:
TCCR0 &= (~(1 << WGM01) & ~(1 << WGM00))
TCCR0 |= (0 << WGM01) | (1 << WGM00)
break
default: break
}
#if OCA_MODE
TCCR0 &= (~(1 << COM01) & ~(1 << COM00))
TCCR0 |= (1 << COM01) | (0 << COM00)
#else
TCCR0 &= (~(1 << COM01) & ~(1 << COM00))
TCCR0 |= (1 << COM01) | (1 << COM00)
#include "PWM.h"
void PWM_Init(uint8 Mode, uint8 FioSelect)
{
switch(Mode)
{
case FAST_PWM:
TCCR0 &= (~(1 << WGM01) & ~(1 << WGM00))
TCCR0 |= (1 << WGM01) | (1 << WGM00)
break
case PHASE_FIX_PWM:
TCCR0 &= (~(1 << WGM01) & ~(1 << WGM00))
TCCR0 |= (0 << WGM01) | (1 << WGM00)
break
default: break
}
#if OCA_MODE
TCCR0 &= (~(1 << COM01) & ~(1 << COM00))
TCCR0 |= (1 << COM01) | (0 << COM00)
#else
TCCR0 &= (~(1 << COM01) & ~(1 << COM00))
TCCR0 |= (1 << COM01) | (1 << COM00)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
PWM\config.h
...\default\dep\PWM.o.d
...\.......\Makefile
...\.......\PWM.eep
...\.......\PWM.elf
...\.......\PWM.hex
...\.......\PWM.o
...\PWM.aps
...\pwm.aws
...\PWM.c
...\PWM.h
...\仿真图\Last Loaded led.DBK
...\......\led.DSN
...\......\led.PWI
...\default\dep
...\default
...\仿真图
PWM