[DemoCode下载] ML51时钟输出功能

[复制链接]
 楼主| jiekou001 发表于 2020-5-28 15:49 | 显示全部楼层 |阅读模式
  1. /*---------------------------------------------------------------------------------------------------------*/
  2. /*                                                                                                         */
  3. /* Copyright(c) 2019 Nuvoton Technology Corp. All rights reserved.                                         */
  4. /*                                                                                                         */
  5. /*---------------------------------------------------------------------------------------------------------*/

  6. //***********************************************************************************************************
  7. //  Website: http://www.nuvoton.com
  8. //  E-Mail : MicroC-8bit@nuvoton.com
  9. //***********************************************************************************************************

  10. //***********************************************************************************************************
  11. //  File Function: ML51 simple GPIO toggle out demo code
  12. //***********************************************************************************************************
  13. #include "ML51.h"

  14. /**
  15. * [url=home.php?mod=space&uid=247401]@brief[/url]       Clock output enable
  16. * @param       None;
  17. * [url=home.php?mod=space&uid=266161]@return[/url]      None
  18. * [url=home.php?mod=space&uid=1543424]@Details[/url]     P3.2 / P4.6 / P5.6 can be setting as clock out function.
  19. */

  20. void main (void)
  21. {
  22. /* Setting P3.2 or P4.6 or P5.6 Multi function pin setting for GPIO clock out toggle
  23.    * include gipo.c in Common for GPIO mode setting
  24. */
  25.     MFP_P32_CLKO;
  26.     P32_PUSHPULL_MODE;

  27.     MFP_P46_CLKO;
  28.     P46_PUSHPULL_MODE;

  29.     MFP_P56_CLKO;
  30.     P56_PUSHPULL_MODE;

  31.   /*
  32. Clock out enable setting
  33. */   
  34.     ENABLE_CLOCK_OUT;

  35.     while(1)                          /*check the pin setting as clock output.*/
  36.     {
  37.       FsysSelect(FSYS_LXT);
  38.       Timer2_Delay(32768,1,1,1000);
  39.       FsysSelect(FSYS_HXT);
  40.       Timer2_Delay(110592,1,1000,1000);
  41.     }
  42. }





 楼主| jiekou001 发表于 2020-5-28 15:50 | 显示全部楼层
还可以为其他需要时钟节拍的芯片提供时钟信号,非常棒。
antusheng 发表于 2020-5-28 20:44 | 显示全部楼层
挺好用。
jerow 发表于 2020-5-28 21:58 | 显示全部楼层
支持下,谢谢分享!
gejigeji521 发表于 2020-5-29 09:58 | 显示全部楼层
这个功能非常不错,可以省不少料,还能更稳定。
捉虫天师 发表于 2020-5-29 11:31 | 显示全部楼层
提供的延时函数不错。
598330983 发表于 2020-5-29 11:38 | 显示全部楼层
为何要用推挽模式
643757107 发表于 2020-5-31 23:32 来自手机 | 显示全部楼层
输出给其他用,或者测试速度
xuanhuanzi 发表于 2020-6-2 23:27 | 显示全部楼层
竟然三个端口支持时钟输出?
xuanhuanzi 发表于 2020-6-2 23:44 | 显示全部楼层
下载手册看了看,还真是支持3个IO输出时钟。
晓伍 发表于 2020-6-5 18:27 | 显示全部楼层
非常感谢楼主分享
八层楼 发表于 2020-6-5 18:28 | 显示全部楼层
这种功能真不错
观海 发表于 2020-6-5 18:28 | 显示全部楼层
有么有成熟的公式可用啊
guanjiaer 发表于 2020-6-5 18:29 | 显示全部楼层
楼主辛苦了
heimaojingzhang 发表于 2020-6-5 18:29 | 显示全部楼层
代码非常棒
您需要登录后才可以回帖 登录 | 注册

本版积分规则

147

主题

1502

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部