当前位置:网站首页>2837xd代码生成模块学习(2)——ADC、ePWM模块、Timer0
2837xd代码生成模块学习(2)——ADC、ePWM模块、Timer0
2022-07-02 06:35:00 【Quikk】
2837xd代码生成模块学习(2)——ADC、ePWM模块、Timer0
模型链接:链接
1 ADC模块
模型结构:
以上结构完成了经过ADC采集,进行输出采集到的电压的过程。
1)ADC采集模块


2)SCI_A的采集配置见文章(链接)
3)Configuration Parameters中配置ADC(根据需要进行配置)

这里说一下,2837x的ADC采集较28335的ADC有所改动。总体来说我感觉是更加方便使用,具体的用法建议参考用户手册或者TI教学视频(链接)
实验结果图:

2 Timer0中断
Timer0中断作为仿真步长的基础时序,所以启动改变仿真时间就可以触发Timer0中断。Timer1和Timer2不属于PIE中断,所以中断服务函数模块无法进行驱动,目前没有找到方式进行启动,感觉是需要进行使用代码生成模块。这个问题先放着,后续再进行深入了解。
3 ePWM模块配置
模块简单配置:

ePWMLink TBPRD是将此参数链接到ePWM1,若选择为ePWM1,则代表TBPRD参数与ePWM1的参数相同。Timer period units可以选择PRD的单位是时钟周期还是秒(秒的范围在0到65535*1/(ePWM时钟周期)之内)。
然后在Configuration Parameters中完成参数配置:
2)死区模式配置:

这些参数都是与用户手册上面的内容进行对应,可以查找用户手册进行一部分一部分的设置。
3)中断模式配置

中断和SOC开启都在上图所示的ET模块中。
如下图,构建ePWM中断测试模型:

ePWM1的TBPRD设置为10000,中断在CTR=0时触发。即每0.0001秒触发一次中断。上方的GPIO以步长(0.5 s)进行闪烁。在ePWM的中断服务程序中构建如下的子函数,意思是10000次ePWM中断触发一次GPIO翻转(1秒)。如图中所示:这里的子模块使用的是Trigger Subsystem. Trigger模块可以设置为:上升沿、下降沿触发等。这里还可以用 StateFlow 进行编写(目前还不是很熟悉,后期会进行尝试)
今天调试遇到了一个小问题,就是模型存放在在有中文目录的路径下,一时间运行直接报错,生成的ccs程序也无法打开。以后要注意一定要放在英文目录下执行。

边栏推荐
- YOLO物体识别,生成数据用到的工具
- PI control of three-phase grid connected inverter - off grid mode
- C语言之二进制与十进制
- View the port of the application published by was
- Bugkuctf-web24 (problem solving ideas and steps)
- C语言之分草莓
- Mysql 多列IN操作
- Cmake command - Official Document
- What are the differences between TP5 and laravel
- int与string、int与QString互转
猜你喜欢

Redis installation and deployment (windows/linux)

Read 30 minutes before going to bed every day_ day4_ Files

Image recognition - Data Cleaning

2837xd code generation - stateflow (1)

kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)

分享一篇博客(水一篇博客)

Bugkuctf-web21 (detailed problem solving ideas and steps)

JDBC review

ZK configuration center -- configuration and use of config Toolkit

Inverter Simulink model -- processor in the loop test (PIL)
随机推荐
Bugkuctf-web21 (detailed problem solving ideas and steps)
QT qlabel style settings
Redis 序列化 GenericJackson2JsonRedisSerializer和Jackson2JsonRedisSerializer的区别
Beats (filebeat, metricbeat), kibana, logstack tutorial of elastic stack
2837xd Code Generation - Supplement (1)
Microservice practice | Eureka registration center and cluster construction
Bugkuctf-web16 (backup is a good habit)
攻防世界-Web进阶区-unserialize3
College Students' CET-4 and CET-6 composition template (self created version, successfully crossed CET-6)
2837xd code generation module learning (4) -- idle_ task、Simulink Coder
Share a blog (water blog)
PI control of three-phase grid connected inverter - off grid mode
Typora安装包分享
Typora installation package sharing
Hystrix implements request consolidation
Break the cocoon | one article explains what is the real cloud primordial
ClassFile - Attributes - Code
MySQL default transaction isolation level and row lock
图像识别-数据采集
Int to string, int to qstring