Keil_XMC1300POSIF单元正交编码器例程
所属分类:单片机开发
开发工具:C/C++
文件大小:845KB
下载次数:5
上传日期:2017-06-03 23:58:51
上 传 者:
kingryluo
说明: Keil_XMC1300POSIF单元正交编码器例程
(Keil_XMC1300POSIF unit quadrature encoder routines)
文件列表:
Keil_XMC1300-POSIF-Decoder (0, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\ccu40.crf (274520, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\ccu40.d (455, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\ccu40.o (263596, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\ExtDll.iex (19, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\JLinkLog.txt (118400, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\JLinkSettings.ini (650, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.axf (295500, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.hex (5091, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.htm (29955, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.lnp (386, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.map (56016, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.plg (2589, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.sct (479, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.uvgui.shangaus (140325, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.uvopt (9611, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder.uvproj (15767, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder_Keil_XMC1300-POSIF-Decoder.dep (3957, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Keil_XMC1300-POSIF-Decoder_Target 1.dep (93, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Main.c (282, 2013-09-07)
Keil_XMC1300-POSIF-Decoder\main.crf (274536, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\main.d (548, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\main.o (264312, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\mcuinit.crf (274627, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\mcuinit.d (589, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\mcuinit.o (266484, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\MCUINIT (0, 2013-11-27)
Keil_XMC1300-POSIF-Decoder\MCUINIT\CCU40.c (8190, 2013-09-07)
Keil_XMC1300-POSIF-Decoder\MCUINIT\CCU40.h (2297, 2013-09-07)
Keil_XMC1300-POSIF-Decoder\MCUINIT\gpio_xmc1300_tssop38.h (33158, 2013-08-19)
Keil_XMC1300-POSIF-Decoder\MCUINIT\MCUInit.c (2049, 2013-09-24)
Keil_XMC1300-POSIF-Decoder\MCUINIT\MCUInit.h (251, 2013-09-07)
Keil_XMC1300-POSIF-Decoder\MCUINIT\POSIF0_Decoder.c (4972, 2013-09-04)
Keil_XMC1300-POSIF-Decoder\MCUINIT\POSIF0_Decoder.h (2307, 2013-09-04)
Keil_XMC1300-POSIF-Decoder\posif0_decoder.crf (274347, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\posif0_decoder.d (581, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\posif0_decoder.o (263540, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Startup (0, 2013-11-28)
Keil_XMC1300-POSIF-Decoder\Startup\startup_XMC1300.s (15415, 2013-06-24)
... ...
1.目的:
这个程序使用POSIF0和CCU40级联,POSIF0工作在正交编码模式,CCU40工作在外部计数模式。
通过P1.2、P1.1模拟A、B信号,CCU40工作在边沿对齐模式进行计数,达到周期值时产生中断。
2.实验器材:
- J-Link驱动安装到 PC
- J-Link v4.59或更高版本
- XMC1300 Boot Kit (XMC1300 CPU Card)
3.实验步骤:
- 连接 XMC1300 CPU板到 USB
创建此工程的步骤:
1) 在DAVE3.0中创建一个 Empty Main Project
2) 初始化时钟
3)设定分频初始值
4) 初始化Systick时钟、CCU40和POSIF0模块
5) 初始化配置:
Systick:更新系统时钟寄存器的值、使能周期中断、启动时钟
CCU40:周期寄存器、比较寄存器配置,事件0上升、下降沿触发计数。
POSIF0:配置正交编码模式、输入A、B信号端口P1.2、P1.1。
6) 初始化P1.2、P1.1为IO输出口模拟A、B信号,P0.0、P0.6对应LED显示前面信号的工作状态.
8) 建立中断处理程序,在中断中改变P0.6电平状态。
4.实验结果:
1. 时钟运行时,P0.0、P0.6对应LED交互闪烁,计数到周期值100后,进入周期匹配中断,P0.6对应LED改变状态。
近期下载者:
相关文件:
收藏者: