Presentation is loading. Please wait.

Presentation is loading. Please wait.

第七章 MSP430時脈計時器A模組.

Similar presentations


Presentation on theme: "第七章 MSP430時脈計時器A模組."— Presentation transcript:

1 第七章 MSP430時脈計時器A模組

2 MSP430計時器A簡介

3 MSP430計時器A簡介

4 計時器A Continuous Mode TA_00.C
在中斷程式中設定breakpoint 觀察S2鍵被按下後的time(TAR)變數值

5 計時器A Continuous Mode TA_00_1.C
在中斷程式中設定breakpoint 觀察S2鍵被按下後的time(TAR)變數值 P1.1 P1.3(S2) 9519*(1/12k) = ms 試執行程式後8秒按下按鍵,觀察time的值及TACTL暫存器中TAIFG的變化。 試執行程式後3秒按下按鍵,觀察time的值。

6 計時器A Continuous Mode TA_00_2.C
在中斷程式中設定breakpoint 觀察S2鍵被按下後的time(TAR)變數值 試執行程式後十數秒按下按鍵,觀察time的值及TACTL暫存器中TAIFG及count的變化。

7 計時器A Continuous Mode TA_01.C
以示波器量測P1.1 設定中斷點,觀察TAR及TACCR0的變化

8 計時器A的Continuous Mode

9 計時器A Continuous Mode TA_01.C
以示波器量測P1.1訊號 dT=1/ (SMCLK =1MHz) dT*1000= 1000/ =1 E-3  1ms 試著修改增加至TACCR0的值,精確算出時間間隔,並以示波器量測P1.1訊號驗証之。 例如:精確產生下列訊號

10 計時器A的Up Mode TA_02.C 以示波器量測P1.1訊號

11 計時器A的Up Mode

12 計時器A的Up Mode TA_021.C 在中斷程式中設定breakpoint 並觀察S2被按下後的count及time變數值
精準的時間計算 經過時間(ms) = count* (time+1)

13 計時器A的Up Mode TA_03.C 輸出PWM訊號至P Duty cycle = 75%

14 計時器A的Up Mode TA_03.C

15 計時器A的Up Mode TA_03_1.C 輸出PWM訊號至P1.6 試改變輸出PWM訊號至P 使LED燈產生漸亮、漸暗之 循環變化

16 計時器A的Up Mode TA_03_1.C Pulse-width modulation (PWM)
An example of PWM in an AC motor drive: the phase-to-phase voltage (blue) is modulated as a series of pulses that results in a sine-like flux density waveform (red) in the magnetic circuit of the motor. The smoothness of the resultant waveform can be controlled by the width and number of modulated impulses (per given cycle)

17 計時器A的Capture Mode TA_04.C
輸入3.3V,1kHz的方波至P 觀察buffer[i]的值

18 計時器A的Capture Mode TA_04.C

19 計時器A的Capture Mode


Download ppt "第七章 MSP430時脈計時器A模組."

Similar presentations


Ads by Google