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

OKI单片机——ML610Q4XX PWM

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

 

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://www.xjtudll.cn/Exp/472/

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

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

BMP2PCB使用教程

BMP2PCB使用教程

BMP2PCB是一款将BMP图片转换成PCB图的工具软件,我们可以用它在Protel99SE中添加汉字或图形。如果要添加文字的话,首先就要将文字转化成图片了。需要注意的是,图片最好是单色位图。可先将BMP转化成单色位图,如图所示。 新版的BMP2PCB不仅仅支持转换成Protel PCB格式,...

NodeMCU无限打印:wifi_event_monitor_handle_event_cb is called

NodeMCU一直输出: wifi event monitor handle event cb is called wifi event monitor handle event cb is called wifi event monitor handle event cb is ca...

Android Studio Warning:Not annotated parameter overrides @NonNull parameter

问题: android studio提示:Not annotated parameter overrides @NonNull parameter 分析: Warning:The @NonNull annotation can be used to indicate that a given par...

Warning: xx pins must meet Altera requirements for 3.3-, 3.0-, and 2.5-V interfaces. For more information, refer to AN 447: Interfacing Cyclone IV E Devices with 3.3/3.0/2.5-V LVTTL/LVCMOS I/O Systems

Warning: xx pins must meet Altera requirements for 3.3-, 3.0-, and 2.5-V interfaces. For more information, refer to AN 447: Interfacing Cyclone IV E Devices with 3.3/3.0/2.5-V LVTTL/LVCMOS I/O Systems

问题描述: Cyclone IV EP4CE6E22C8N Quartus II编译 每次编译完,都有个warning: Warning: xx pins must meet Altera requirements for 3.3-, 3.0-, and 2.5-V interfaces. For...

SQL去掉小数点有效数字后的所有0

第一种方法 select cast(2.5000000000000   as  real) select cast(2   as  real) select cast(2.00000   as  r...

PlatformIO串口无输出

PlatformIO串口无输出

问题:同样的串口打印代码,在Arduino IDE里可以正常输出,但是在PlatformIO里看不到任何输出硬件:ESP32-S3 Camera解决方法:This is because DTR and RTS both are connected to the RESET pin and GPIO...

发表评论

访客

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