| Electronic Components Datasheet Search |
|
MAC7200 Datasheet(PDF) 923 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
MAC7200 Datasheet(HTML) 923 Page - Freescale Semiconductor, Inc |
|
923 / 976 page ![]() Initialization/Application Information MAC7200 Microcontroller Family Reference Manual, Rev. 2 Freescale Semiconductor 845 34.8 Initialization/Application Information 34.8.1 Using a Pin in Peripheral Mode To use a pin in Peripheral Mode, follow these steps: 1. Using Table 34-6, determine the Port number(s) for the desired peripheral pin(s). Note that, in most cases, all pins associated with a peripheral should be switched to Peripheral Mode for proper operation of the peripheral. 2. Using Table 34-11, determine the correct CONFIG register(s) for the selected port number(s). 3. Determine whether a pull-up or pull-down is required. 4. Write 0x80, 0x88 or 0x8C to the selected CONFIG register(s). Note that, in Peripheral Mode, the values of all bits except the MODE and PULL[1:0] bits are unused. 5. If required, enable the peripheral. See the documentation for the peripheral for more information on how to do this. Example 34-1. Enable the IIC module 1. For the IIC module, enable both the SDA and SCL pins. Using Table 34-6, determine that these pins are located on Port B0 and B1, respectively. 2. Using Table 34-11, determine the addresses for Port BO and B1 to be ’Base + 0x0040’ and ’Base + 0x0042’, respectively. 3. Write 0x008C to ’Base + 0x0040’ and 0x008C to ’Base + 0x0042’. Alternatively, it is possible to write 0x0080 to both addresses (no Pull-up functionality). 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 = 0x008C; // Pull-up enabled *CONFIG_B1 = 0x008C; // Pull-up enabled 4. If required, enable the IIC module by writing to the appropriate register in the IIC register map. |
|
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 |