Upload
ali-ahmad
View
215
Download
0
Embed Size (px)
Citation preview
7/27/2019 DSP_AU_12
1/9
Digital Signal Processing
with DSK6713
EE433Session 12
4th
May 2009
Department of Electrical Engineering
Air University
7/27/2019 DSP_AU_12
2/9
Todays Agenda
Introduction to timer / counter
Using the timer on DSP C6713
7/27/2019 DSP_AU_12
3/9
Timer / Counter
Most of the embedded systems (microcontrollers, DSPs, etc.)
have built-in timers / counters.
These are hardware modules usually comprised of T flip flops. These modules can take clock frequency from outside or inside
of the chip.
When clock frequency is fed from outside, it is called counter.
When the clock is given from inside, it is timer.
7/27/2019 DSP_AU_12
4/9
Timer / Counter When you like to run a certain function after a specific time
interval, you configure this module as timer.
It is very much similar to a timer in a washing machine. You set
the timer at a value after which you like to stop the machine
automatically.
If you like to count the number of pulses generated by some
external hardware, you configure the same module as counter
and it counts the number of pulses received at a particular pin
of the chip.
It is very much similar to the counter in ATM machine. If you
enter your PIN wrong three times, it captures your card. There
is a counter inside, that counts your wrong entries for PIN.
7/27/2019 DSP_AU_12
5/9
Timer / Counter Apparently a T flip flop behaves as counter. If you cascade 4 flip
flops you can count from 0 to 15. If 6 flip flops are cascaded you
can count up to 26 -1 (=63).
Then how a counter becomes a timer when clock is generated
internally?
Its just an interpretation. When the clock is generated internally you know the frequency.
When you set counter / timer for a certain target value you can
easily determine, how long will it take to reach that target value.
7/27/2019 DSP_AU_12
6/9
Timer Example We like to light a LED after 10 ms. The timer is 16-bit (16 flip flops
cascaded) and the internal clock frequency is 1 MHz.
The real problem is that how the processor or controller will know
that 10 milliseconds have passed away.
If we set the target count as 10000, the timer will generate an
interrupt when its value equals 10000.
The time taken to count up to 10000 =
= 10 ms
If we have configured the timer to generate an interrupt when it
reaches the target count, it will generate interrupt after exact 10 ms.
At the interrupt, the processor will know that now its time to light the
LED.
6101
10000ValueCount
=
CLKf
7/27/2019 DSP_AU_12
7/9
Timer Module on DSP C6713
DSP TMS320C6713 has two timer modules, each 32-bits,
Timer 0 and Timer 1.
Timer 0 is reserved for the processor itself.
Timer 1 is available to the system designer.
Timer module can be configured to take clock internally or
externally. C6713 operates on clock frequency 225 MHz. Timer module
can be configured to take one-fourth or one-eighth of this
frequency as input. The target values of timer can be set from 1 to 232-1( 4.3 x
109).
7/27/2019 DSP_AU_12
8/9
Example Problem
How will you configure timer 1 of the DSP
C6713 if you want to generate interrupt after100 ms.
fCLK
= ________ (options: 225/4 MHz, 225/8 MHz)
Target count = _________ (options: 1 to 232-1)
7/27/2019 DSP_AU_12
9/9
Announcements
Next Monday you may have a quiz.
Final viva has been scheduled next week. Date and time
will be announced shortly. The last two assignments are due on 12th May 2009 (FIR
filter assignment and todays assignment).
Distribution of marks for DSP lab is as under.
Assignments: 10
Quiz: 2.5
Practical Exam: 2.5
Final Viva: 5