Presentation is loading. Please wait.

Presentation is loading. Please wait.

TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names.

Similar presentations


Presentation on theme: "TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names."— Presentation transcript:

1 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Lab 4 – Timers and Polling Fall, 2010 MPC8360 Micro Controllers 371-1-2403

2 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Objectives ► Getting familiar with the MPC8360 Timers Block. ► Getting to know the Polling mechanism

3 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. IMMRBAR - I nternal M emory M ap R egisters B ase A ddress R egister

4 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. QUICC Engine Timers (GTM) ► The global timer module in the QUICC Engine (GTM) includes four identical 16-bit general-purpose timers. E300 Core QUICC Engine Timers 0x10_0000 0x0440

5 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Timers Block Diagram

6 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Configuration Register (GTCFR1) Offset 0x00 01234567 RWRW PCASBCMSTP2RST2GM2GM1STP1RST1 ResetAll Zeros The Actual Address Of any Register in the timers block is: IMMRBAR QUICC Engine Offset Timers Offset Register Offset For Example the actual address of GTCFR: +0x0010_00000xE000_0000+0x0000_0440+ 0x0000_0000 = 0xE010_0440

7 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Configuration Register (GTCFR1) Offset 0x00 01234567 RWRW PCASBCMSTP2RST2GM2GM1STP1RST1 ResetAll Zeros RST1 Reset timer 1 0 Reset the timer 1, including GTMDR1, GTRFR1, GTCNR1, GTCPR1 and GTEVR1 (a software reset is identical to an external reset). 1Enable the corresponding timer if the STP1 bit is cleared

8 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Configuration Register (GTCFR1) Offset 0x00 01234567 RWRW PCASBCMSTP2RST2GM2GM1STP1RST1 ResetAll Zeros STP1 Stop timer 1 0Normal operation 1Reduce power consumption of the corresponding timer. This bit stops all clocks to the timer 1 ….

9 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Counter Register (GTCNR1) Offset 0x1C 015 RWRW CNV ResetAll Zeros

10 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Counter Register (GTCNR1) Offset 0x1C 015 RWRW CNV ResetAll Zeros CNV Counter Value Corresponding timer’s 16-bit read/write up-counter value.

11 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Reference Register (GTRFR1) Offset 0x14 015 RWRW TRV ResetAll Ones

12 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Reference Register (GTRFR1) Offset 0x14 015 RWRW TRV ResetAll Ones TRV Timeout Reference Value 16-bit timeout reference value for the corresponding timer. Set to all ones by reset.

13 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Event Register (GTEVR1) Offset 0x30 01415 RWRW REFCAP ResetAll Zeros

14 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Event Register (GTEVR1) Offset 0x30 01415 RWRW REFCAP ResetAll Zeros REF Output Reference Event 0No event 1The counter has reached the GTRFRx[TRV] value.

15 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Prescale Register (GTPSR1) Offset 0x38 0781415 RWRW PPS ResetAll Zeros

16 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Prescale Register (GTPSR1) Offset 0x38 0781415 RWRW PPS ResetAll Zeros PPS Primary Prescaler Bits The primary prescaler is programmed to divide the clock input to corresponding timer by values from 1 to 256. The value 0x00 divides the clock by 1 and 0xFF divides the clock by 256.

17 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Mode Registers (GTMDR1) Offset 0x10 0789101112131415 RWRW SPSCE OMORIFRRICLKGE ResetAll Zeros

18 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Mode Registers (GTMDR1) Offset 0x10 0789101112131415 RWRW SPSCE OMORIFRRICLKGE ResetAll Zeros SPS Secondary Prescaler Value The secondary prescaler is programmed to divide the clock input to corresponding timer by values from 1 to 256. The value 0x00 divides the clock by 1 and 0xFF divides the clock by 256.

19 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Mode Registers (GTMDR1) Offset 0x10 0789101112131415 RWRW SPSCE OMORIFRRICLKGE ResetAll Zeros FRR Free run/restart mode 0 Free run. The timer count continues to increment after the reference value is reached 1Restart. The timer count is reset immediately after the reference value is reached.

20 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Global Timers Mode Registers (GTMDR1) Offset 0x10 0789101112131415 RWRW SPSCE OMORIFRRICLKGE ResetAll Zeros ICLK Input clock source for the timer 01Internal QUICC Engine reference clock. 10Internal “slow go” clock (divided by 16 QUICC Engine reference clock).

21 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. The LED ► On the MPC8360 board we have a LED (small red light), that is controlled via a register which is located at address 0xF800_0008. ► To Turn the LED on write ‘0’ to bit number 14. ► To Turn the LED off write ‘1’ to bit number 14. ► There is a second LED which controlled by bit number 13

22 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. I/O  I/O is how humans interact with computers  I/O gives computers long-term memory. External devices I/O

23 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Polling  actively sampling the status of an external or internal device by a client program.  CPU does nothing other than check the status of the device until it is ready (Busy Waiting)  Polling can be scheduled between several devices. E300 CORE Mouse Printer Timers External device Internal device Polling

24 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Polling why we need it?  A way to connect many types of devices to the Microcontroller.  A way to control external and internal devices, respond to them and transfer data in the exact time and speed.

25 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Polling Example : void asm Timers_Polling { whlie (1) { if (Timer_Counter_Value==0x5) { Action; } Busy waiting Device is ready

26 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. General Notes ► Make sure to bring the codes you have written in previous labs. ► Please READ the exercise before you start working on it !! ► The High-Score table has nothing to do with your grades

27 TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. Quick Overview


Download ppt "TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names."

Similar presentations


Ads by Google