| Electronic Components Datasheet Search |
|
MAC7200 Datasheet(PDF) 925 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
MAC7200 Datasheet(HTML) 925 Page - Freescale Semiconductor, Inc |
|
925 / 976 page ![]() Initialization/Application Information MAC7200 Microcontroller Family Reference Manual, Rev. 2 Freescale Semiconductor 847 This gives a CONFIG register value of 0x0040 5. Intended use for Port B1: an input interrupt/wakeup signal with the following characteristics: — Active high interrupt with pull-down This gives us a CONFIG register value of 0x000B (Write ’1’ to the PIFR register to ensure that any pending interrupts are cleared) 6. Write 0x0040 to ’Base + 0x040’ and 0x000B to ’Base + 0x042’. Use the following example code to do this: In File registers.h: #define PIM_BASE_ADDRESS 0xFC0E8000/* Example only ! */ /* Following example assumes short is 16-bits */ volatile unsigned short *CONFIG_B0 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0040); volatile unsigned short *CONFIG_B1 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0042); In File main.c: #include "registers.h" : : *CONFIG_B0 = 0x0040; *CONFIG_B1 = 0x000B; 34.8.2.2 Accessing Data For maximum flexibility, the value of signals may be driven or sampled both on a pin basis and a port (16-pin) basis, by the processor core or via a DMA. This section details how to drive and sample pins, as well as several examples. 34.8.2.2.1 Driving/Sampling an Entire Port To drive or sample and entire port (16 pins), you must first configure the pins, following the steps outlined in Section 34.8.2.1, “Initialization.” Once this is done, you may drive a value onto the pins (output mode) or sample values from the pins (input mode) by writing or reading the appropriate PORTDATA register. Note that writing to pins that are specified as inputs will have no effect. Conversely, reading from pins that are specified as outputs will simply return the last value written into the PORTDATA register. In this manner, it is possible to use the PORTDATA register to drive or sample less than the full 16 pins in a port. The following example illustrates this point. Example 34-3. Configure Port B to use the IIC Module, 10 outputs and 4 inputs. Sample the 4 inputs and drive 0x3FF onto the 10 outputs. In File registers.h: #define PIM_BASE_ADDRESS 0xFC0E8000/* Example only ! */ /* Following example assumes short is 16-bits */ volatile unsigned short *CONFIG_B0 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0040); volatile unsigned short *CONFIG_B1 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0042); volatile unsigned short *CONFIG_B2 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0044); volatile unsigned short *CONFIG_B3 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0046); volatile unsigned short *CONFIG_B4 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x0048); volatile unsigned short *CONFIG_B5 = (volatile unsigned short *) (PIM_BASE_ADDRESS+0x004A); |
|
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 |