当前位置:首页 > 技术心得 > 正文内容

OKI单片机——ML610Q4XX PWM

xjtudll9年前 (2017-09-27)技术心得6930

 

clip_image002

/***********************************************/

* @brief 初始PWM 引脚

* @details

/***********************************************/

void P43_Init(void)

{

P43DIR = 0;//P43 pin: Output (initial value)

P43C1 = 1;//CMOS output

P43C0 = 1;

P43MD1 = 1;//PWM0 output pin

P43MD0 = 0;

}

 

/***********************************************/

* @brief 串口 发送单字节数据

* @details Cycle值要大于Duty值

* @param[in] Cycle : 周期

* @param[in] Duty : 电平转换时间

/***********************************************/

void PWM_Init(uint16 Cycle,uint16 Duty)

{

PW0PH = (uint8)((Cycle-1)>>8);//周期

PW0PL = (uint8)(Cycle-1);

PW0DH = (uint8)((Duty-1)>>8);;//电平转换时间

PW0DL = (uint8)(Duty-1);

P0CS1 = 0;//LSCLK (initial value)

P0CS0 = 0;

P0IS1 = 0;//When the periods coincide. (Initial value)

P0IS0 = 0;

P0NEG = 0;//Positive logic (initial value)

P0RUN = 1;//Starts counting.

}

扫描二维码推送至手机访问。

版权声明:本文由鸟的天空发布,如需转载请注明出处。

本文链接:http://xjtudll.cn/Exp/472/

标签: OKI单片机
分享给朋友:

“OKI单片机——ML610Q4XX PWM” 的相关文章

Eclipse安装android 开发插件(ADT)

Eclipse安装android 开发插件(ADT)

如果是单独的eclipse,需要下载ADT。 (1)打开Eclipse, 在菜单栏上选择 help->Install New SoftWare 出现如下界面: 点击 Add按钮,出现如下界面 输入网址: https://dl-ssl.google.com/android/eclipse/...

浅析电波表——英国MSF码

浅析电波表——英国MSF码

参考文献: http://en.wikipedia.org/wiki/Time_from_NPL http://www.npl.co.uk/science-technology/time-frequency/time/products-and-services/msf-radio-time-sig...

Project Serve 2010 Error:Project Server 2010 要求至少使用 Microsoft Internet Explorer 7

Project Serve 2010 Error:Project Server 2010 要求至少使用 Microsoft Internet Explorer 7

安装好project server2010后,提示: Project Server 2010 要求至少使用 Microsoft Internet Explorer 7.0。 如下图所示: 换成IE11,还是提示这个问题,怎么办呢?猜测可能是IE兼容性问题,于是修改兼容性设置 修改完后,问题又来了...

金蝶 KFO.Dictionary 怎么写

.Net 调用,以C#为例,调用如下: 1、添加kfo.dll的引用。 2、调用方法 KFO.Dictionary dct=new KFO.Dictionary(); dct.let_value("FInteID",100);...

windows环境下TortoiseSVN多仓库(repository)转移合并(修改+转载)

http://www.lilin.net/blog/?p=1346 问题: 两个不同的版本库,放在不同的及其上,各有数个项目在里面,为了统一管理,我现在都集中在一个仓库内,然后用金山快盘,多个机器同步。 回答: 完美包含版本信息,把双库融合,方便管理同步。 自己尝试后发现问题...

Android Studio:Your project path contains non-ASCII characters

Android Studio:Your project path contains non-ASCII characters

参考资料: http://stackoverflow.com/questions/32171968/your-project-path-contains-non-ascii-characters-android-studio 问题: Android Studio编译工程时,提示: Error:(1...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。