Download TMS320F/C240 DSP Controller
Transcript
Capture Units Example 6–8. Initialization Routine for Capture Units ;********************************************************** ; Initialize counter registers * ;********************************************************** LDP #232 SPLK #00000H,T1CNT ; GP Timer 1 counter SPLK #00000H,T2CNT ; GP Timer 2 counter SPLK #00000H,T3CNT ; GP Timer 3 counter ;********************************************************** ; Initialize period registers * ;********************************************************** SPLK #00011H,T1PR ; GP Timer 1 period SPLK #07fffH,T2PR ; GP Timer 2 period SPLK #00011H,T3PR ; GP Timer 3 period ;********************************************************** ; Initialize compare registers * ;********************************************************** SPLK #00004H,T1CMPR; GP Timer 1 Comp Value SPLK #00006H,T2CMPR; GP Timer 2 Comp Value SPLK #00008H,T3CMPR; GP Timer 3 Comp Value ;********************************************************** ; Configure GPTCON * ;********************************************************** SPLK #0000000001010101b,GPTCON ; Set GP Timer control * bits 12–11 00: No GP Timer 3 event starts ADC * bits 10–9 00: No GP Timer 2 event starts ADC * bits 8–7 00: No GP Timer 1 event starts ADC * bit 6 1: Enable GP Timer Compare outputs * bits 5–4 01: GP Timer 3 comp output active low * bits 3–2 01: GP Timer 2 comp output active low * bits 1–0 01: GP Timer 1 comp output active low ;********************************************************** ; Clear all EV interrupts before operation starts * ;********************************************************** SPLK #0ffffh,EVIFRA ; Clear all Group A interrupt flags SPLK #0ffffh,EVIFRB ; Clear all Group B interrupt flags SPLK #0ffffh,EVIFRC ; Clear all Group C interrupt flags ;********************************************************** ; Configure T2CON and start GP Timer 2 * ;********************************************************** SPLK #1001000001000010b,T2CON ; Set GP Timer 2 control * bit 15 1: FREE = 1 * bit 14 0: SOFT = 0 * bits 13–11 010: continuous–up count mode * bits 10–8 000: Prescaler = /1 * bit 7 0: Use own Timer ENABLE * bit 6 1: Timer (counting operation) enabled * bits 5–4 00: Select internal CLK 6-88
Related documents
TMS320LF/LC240xA DSP Controllers System and Peripherals RG
Simplicity 7018H Specifications
取扱説明書 - Bose ボーズ
full paper - e-JST
Harsh Environment Acquisition Terminal (H.E.A.T.) System
Electrical Specifications and Pin Assignments for 240
Serial Peripheral Interface (SPI) for KeyStone Devices User`s Guide
Harsh Environment Acquisition Terminal (H.E.A.T.) System EVM
SN32F100 Spec.
RDIM16 ACPM750E User Manual
Spice Line - User's Guide
Texas Instruments TMS320F20x/F24x User's Manual