mcf5407 Freescale Semiconductor, Inc, mcf5407 Datasheet - Page 336
![no-image](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_sml.jpg)
mcf5407
Manufacturer Part Number
mcf5407
Description
Mcf5407 Coldfire Integrated Microprocessor User
Manufacturer
Freescale Semiconductor, Inc
Datasheet
1.MCF5407.pdf
(546 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
mcf5407AI162
Manufacturer:
FREESCALE
Quantity:
201
Company:
Part Number:
mcf5407AI162
Manufacturer:
FREESCAL
Quantity:
132
Company:
Part Number:
mcf5407AI162
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
Company:
Part Number:
mcf5407AI220
Manufacturer:
freescaie
Quantity:
6
Company:
Part Number:
mcf5407AI220
Manufacturer:
Freescale Semiconductor
Quantity:
135
Company:
Part Number:
mcf5407AI220
Manufacturer:
FREESCALE
Quantity:
1 831
Company:
Part Number:
mcf5407AI220
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
Company:
Part Number:
mcf5407CAI162
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
- Current page: 336 of 546
- Download datasheet (7Mb)
Code Example
Table 13-3 describes TERn fields.
13.4 Code Example
The following code provides an example of how to initialize timer 0 and how to use the
timer for counting time-out periods.
MBARx EQU 0x10000 ;Defines the module base address at 0x10000
TMR0 EQU MBARx+0x140;Timer 0 register
TMR1 EQU MBARx+0x180 ;Timer 1 register
TRR0 EQU MBARx+0x144 ;Timer 0 reference register
TRR1 EQU MBARx+0x184 ;Timer 1 reference register
TCR0 EQU MBARx+0x148 ;Timer 0 capture register
TCR1 EQU MBARx+0x188 ;Timer 1 capture register
TCN0 EQU MBARx+0x14C ;Timer 0 counter
TCN1 EQU MBARx+0x18C ;Timer 1 counter
TER0 EQU MBARx+0x151 ;Timer 0 event register
TER1 EQU MBARx+0x191 ;Timer 1 event register
* TMR0 is defined as: *
*[PS]= 0xFF, divide clock by 256
*[CE] = 00disable interrupt
*[OM] = 0 output=active-low pulse
*[ORI] = 0, disable ref.interrupt
*[FRR] = 1, restart mode enabled
*[CLK] = 10, CLKIN/16
*[RST] = 0, timer 0 disabled
The simple example below uses 0 to count time-out loops. A time-out occurs when the
reference value, 0xAFAF, is reached.
timer0_ex
13-6
Bits
7–2
1
0
move.w #0xFF0C,D0
move.w D0,TMR0
move.w #0x0000,D0;writing to the timer counter with any
move.w DO,TCN0 ;value resets it to zero
move.w #AFAF,DO ;set the timer 0 reference to be
move.w #D0,TRR0 ;defined as 0xAFAF
clr.l DO
clr.l D1
clt.l D2
move.w #0x0000,D0
move,w D0,TCN0;reset the counter to 0x0000
move.b #0x03,D0 ;writing ones to TER0[REF,CAP]
move.b D0,TER0 ;clears the event flags
Name
REF
CAP
—
Reserved
Output reference event. The counter has reached the TRRn value. Setting TMRn[ORI] enables the
interrupt request caused by this event. Writing a one to REF clears the event condition.
Capture event. The counter value has been latched into TCRn. Setting TMRn[CE] enables the
interrupt request caused by this event. Writing a 1 to CAP clears the event condition.
Table 13-3. TERn Field Descriptions
MCF5407 User’s Manual
Description
Related parts for mcf5407
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![MC14560BCP](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC12034AP](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MPIC2112P](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC14520BCP](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC12026AP](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC145152P2](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC68HC11A0P](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MCM6726DWJ10](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC44355](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC13282AP](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC14519BCP](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC14495P1](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![SN74LS796N](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC142100CP](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet:
![MC34014P](/images/manufacturer_photos/0/2/263/freescale_semiconductor__inc_tmb.jpg)
Part Number:
Description:
Manufacturer:
Freescale Semiconductor, Inc
Datasheet: