英飞凌单片机例程tc1767_taskingv33r2_pwm_ltc

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

confidential
Page 17
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Local Timer Cell /LTC4/LTC4:
Enable LTC4 after initialization. Mode: Compare with Last Timer. LTC4 register value : 0x05DB. Reset the LTC4 output by a local event or copy previous cell action. LTC4mode control: Enable high level of „Select Line Input‟.
Page 19
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Output Pins:
Click on “OUT1”.
confidential
Page 20
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
confidential
Page 4
Exercise GPTA_LTC_PWM PWM Signal Update (Coherent)
Timer
0 Compare_0(Period) 0 1 Compare_1(Period) 0 1
Reset timer
-1
Compare_0(Duty) Compare_1(Duty)
Select “GPTA0_vInit”.
confidential
Page 22
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
confidential
Page 8
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA Clock Timer Clock Control:
Enable GPTA0 Timer clock.
confidential
Page 9
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
confidential
Page 12
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Local Timer Cell /LTC0/LTC0:
Enable LTC0 after initialization. Mode selection: Timer with reset from adjacent LTC with higher order. Connect the input line to LTC0. Enable rising edge of selected input signal.
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Clock Generation / CDU / Clock Bus 7-6:
Select Divided GPTA0 clock. Select divide factor 2^1.
Open this file File Open and browse for gpta_pwm.dav.
confidential
Page 6
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
Project Settings (cont.) GPTA:
confidential
Page 7
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA Clock Module clock:
Enable GPTA Module Select fractional divider mode Set the required module clock to 40MHz
Some of the work done in the previous exercise ASC_1 can be reused in this exercise. Copy and rename the file asc_1.dav into
d:\hot\tc1767\gpta_ltc_pwm\gpta_ltc_pwm.dav
Page 14
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Local Timer Cell /LTC1/LTC1:
Enable LTC1 after initialization. Mode: Compare with Last Timer. LTC1 register value : 0x03E7. Output Control Mode: Set the LTC1 output by a local event only. LTC1 mode control: Enable low level of „Select Line Input‟.
General Purpose Timer Array Exercise GPTA_LTC_PWM
Exercise GPTA_LTC_PWM Objective
Using 5 Local Timer Cells (LTC), generate a PWM signal with switchable duty cycle and period (Signal 0 and Signal 1). Signal 0 has a period of 100us and a duty cycle of 20%,signal 1 has a period of 200us and a duty cycle of 75%. Every time the user strikes a key on its keyboard (using MTTY), the signal toggles from one duty cycle / period configuration to the other. The character is also echoed back to the PC. The update of the duty cycle / period is fully coherent and is observed on a scope.
confidential
Page 15
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Local Timer Cell /LTC2/LTC2:
Enable LTC2 after initialization. Mode: Compare with Last Timer. LTC2 register value : 0x07CF. Set the LTC2 output by a local event or copy previous cell action. LTC2 mode control: Enable high level of „Select Line Input‟.
Software Control
Pin 0.1 Channel
Pin 5.0 Trigger
Scope
confidential
Page 3
Exercise GPTA_LTC_PWM Application of 5 LTC cells
LTC0 is used as a reset timer cell and is the time base for the other cells. LTC1 defines Period 0, LTC3 Duty cycle 0. They are active when their input signal “SI” is set to 0.
Let‟s get started now!
confidential
Page 2
Exercise GPTA_LTC_PWM Block diagram
RS 232
TC1767
TxD
PC
Receive ASC Buffer
Interrupt Routine
Priority 1
GPTA TxD
Signal 0 Signal 1
Click on the GPTA0 module:
confidential
Page 10
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Clock Generation:
Click on “CDU”.
confidential
Page 11
confidential
Page 16
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Local Timer Cell /LTC3/LTC3:
Enable LTC3 after initialization. Mode: Compare with Last Timer. LTC3 register value : 0x0C7. Reset the LTC3 output by a local event or copy previous cell action. LTC3mode control: Enable low level of „Select Line Input‟.
Select Si Output High/Low Coherent_Update_Enable_Flag Toggle Si Line Output
Coherent update of the Period and of the Duty Cycle
confidential
Page 5
Exercise GPTA_LTC_PWM DAvE Configurations
LTC2 defines Period 1, LTC4 Duty cycle 1. They are active when their input signal “SI” is set to 1.
Toggling the output “SO” of LTC0 activates either one pair of cells or the other. As a result, either Signal 0 or Signal 1 can be observed at the output of LTC4.
confidential
Page 13
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Local Timer Cell /LTC0/Data Input:
Internal input: Select Clock 7.
confidential
GPTA0 Output Pins / Out1:
Use pin P0.1 as GPTA output signal (GPTA_OUT1).
confidential
Page 21
Exercise.)
GPTA0 Functions:
confidential
Page 18
Exercise GPTA_LTC_PWM DAvE Configurations (cont.)
GPTA0 Local Timer Cell /LTC4/Output Selection:
Connect Output GPTA_OUT1.
confidential
相关文档
最新文档