| Electronic Components Datasheet Search |
|
MAC7200 Datasheet(PDF) 930 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
MAC7200 Datasheet(HTML) 930 Page - Freescale Semiconductor, Inc |
|
930 / 976 page ![]() Initialization/Application Information MAC7200 Microcontroller Family Reference Manual, Rev. 2 852 Freescale Semiconductor 6. When receiving an interrupt, determine if the interrupt was generated by the Port Integration Module. In this case read and clear the PORTIFR registers for each port to determine which interrupts are pending. The following example code illustrates this assuming all pins on all ports are used as external interrupts: In File registers.h: #define PIM_BASE_ADDRESS 0xFC0E8000/* Example only ! */ /* Following example assumes short is 16-bits */ volatile unsigned short *PORTIFR_A = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0020); volatile unsigned short *PORTIFR_B = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0060); volatile unsigned short *PORTIFR_C = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x00A0); volatile unsigned short *PORTIFR_D = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x00E0); volatile unsigned short *PORTIFR_F = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0160); volatile unsigned short *PORTIFR_G = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x01A0); In File main.c: #include "registers.h" : : unsigned short ifr_port_a; unsigned short ifr_port_b; unsigned short ifr_port_c; unsigned short ifr_port_d; unsigned short ifr_port_f; unsigned short ifr_port_g; ifr_port_a = *PORTIFR_A;/* Determine which interrupt sources are pending on Port A*/ *PORTIFR_A = 0xFFFF;/* Clear all pending interrupts on Port A */ ifr_port_b = *PORTIFR_B;/* Determine which interrupt sources are pending on Port B*/ *PORTIFR_B = 0xFFFF;/* Clear all pending interrupts on Port B */ ifr_port_c = *PORTIFR_C;/* Determine which interrupt sources are pending on Port C*/ *PORTIFR_C = 0xFFFF;/* Clear all pending interrupts on Port C */ ifr_port_d = *PORTIFR_D;/* Determine which interrupt sources are pending on Port D*/ *PORTIFR_D = 0xFFFF;/* Clear all pending interrupts on Port D */ ifr_port_f = *PORTIFR_F;/* Determine which interrupt sources are pending on Port F*/ *PORTIFR_F = 0xFFFF;/* Clear all pending interrupts on Port F */ ifr_port_g = *PORTIFR_G;/* Determine which interrupt sources are pending on Port G*/ *PORTIFR_G = 0xFFFF;/* Clear all pending interrupts on Port G */ 34.8.3 Using the PD2 pad (CLKOUT) 34.8.3.1 Enabling the CLKOUT output To enable the CLKOUT clock on pad PD2, do the following: 1. Put pin PD2 into Peripheral Mode (Set the MODE bit in the CONFIG2 register for Port D) or Put pin PD2 into General Purpose Output (GPO) Mode (Clear the MODE bit and set the DDR bit in the CONFIG2 register for Port D) |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |