当前位置:网站首页>2837xd code generation module learning (2) -- ADC, epwm module, timer0
2837xd code generation module learning (2) -- ADC, epwm module, timer0
2022-07-02 09:55:00 【Quikk】
2837xd Code generation module learning (2)——ADC、ePWM modular 、Timer0
Model links : link
1 ADC modular
Model structure :
The above structure has been completed ADC collection , The process of outputting the collected voltage .
1)ADC Acquisition module


2)SCI_A See the article for the collection configuration of ( link )
3)Configuration Parameters Middle configuration ADC( Configure as needed )

Here's to say ,2837x Of ADC Acquisition comparison 28335 Of ADC There are changes . Generally speaking, I think it is more convenient to use , For specific usage, please refer to the user manual or TI Teaching video ( link )
Experimental results :

2 Timer0 interrupt
Timer0 Interrupt is the basic timing of simulation step , Therefore, starting and changing the simulation time can trigger Timer0 interrupt .Timer1 and Timer2 Do not belong to PIE interrupt , Therefore, the interrupt service function module cannot be driven , At present, there is no way to start , I feel that I need to use the code generation module . Let's put this question first , Later, we will have an in-depth understanding .
3 ePWM The module configuration
Simple module configuration :

ePWMLink TBPRD Is to link this parameter to ePWM1, If selected as ePWM1, Then represent TBPRD Parameters and ePWM1 Same parameters for .Timer period units You can choose PRD Is the unit of clock cycle or second ( The range of seconds is 0 To 65535*1/(ePWM Clock cycle ) within ).
And then in Configuration Parameters Complete parameter configuration :
2) Deadband mode configuration :

These parameters correspond to the contents of the user manual , You can find the user manual and set it part by part .
3) Interrupt mode configuration

Break and SOC The opening is shown in the figure above ET Module .
Here's the picture , structure ePWM Interrupt test model :

ePWM1 Of TBPRD Set to 10000, The interruption is in CTR=0 Trigger when . That is, every 0.0001 Seconds triggers an interrupt . At the top of the GPIO In steps (0.5 s) Flashing . stay ePWM The following sub functions are built in the interrupt service program of , intend 10000 Time ePWM Interrupt triggers once GPIO Flip (1 second ). As shown in the picture : The sub module here uses Trigger Subsystem. Trigger Modules can be set to : Rising edge 、 Falling edge trigger, etc . You can also use StateFlow Compiling ( At present, I am not very familiar with , Try later )
There is a small problem in debugging today , The model is stored in Path of Chinese Directory Next , An error is reported directly after running for a time , Generated ccs The program also Unable to open . In the future, we must pay attention to placing it in Execute under the English directory .

边栏推荐
- 逆变器simulink模型——处理器在环测试(PIL)
- 【UE5】动画重定向:如何将幻塔人物导入进游戏玩耍
- Cmake command - Official Document
- 2837xd 代码生成——StateFlow(1)
- 每天睡前30分钟阅读Day6_Day6_Date_Calendar_LocalDate_TimeStamp_LocalTime
- YOLO物体识别,生成数据用到的工具
- Off grid control of three-phase inverter - PR control
- Mysql索引
- 2837xd 代码生成——StateFlow(2)
- kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)
猜你喜欢

Inverter Simulink model -- processor in the loop test (PIL)

图像识别-数据清洗

2837xd Code Generation - Supplement (1)

Creation and jump of activity

QT QLabel样式设置

Navicat 远程连接Mysql报错1045 - Access denied for user ‘root‘@‘222.173.220.236‘ (using password: YES)

Tinyxml2 reading and modifying files

每天睡觉前30分钟阅读_day4_Files

2837xd code generation module learning (4) -- idle_ task、Simulink Coder

web安全与防御
随机推荐
Summary of demand R & D process nodes and key outputs
2837xd code generation - stateflow (3)
Read Day5 30 minutes before going to bed every day_ All key values in the map, how to obtain all value values
一次聊天勾起的回忆
道阻且长,行则将至
Personal experience & blog status
2837xd code generation - Supplement (2)
Minimum number of C language
The road is blocked and long, and the line is coming
2837xd 代码生成——StateFlow(4)
滲透測試的介紹和防範
PI control of grid connected inverter (grid connected mode)
Int to string, int to qstring
JDBC review
cmake的命令-官方文档
Junit4运行mvn test 测试套件升级方案
高考那些事
Thinkphp5 how to determine whether a table exists
c语言编程题
2837xd 代码生成——StateFlow(3)