TWR-K60N512-KEIL Freescale Semiconductor, TWR-K60N512-KEIL Datasheet - Page 102

no-image

TWR-K60N512-KEIL

Manufacturer Part Number
TWR-K60N512-KEIL
Description
K60N512 Keil Tower Kit
Manufacturer
Freescale Semiconductor
Series
Kinetisr
Type
MCUr

Specifications of TWR-K60N512-KEIL

Rohs Compliant
YES
Contents
4 Boards, Documentation, DVD
Peak Reflow Compatible (260 C)
Yes
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
Freescale Tower System, K60N512
Configuration example
11.3 Configuration example
The following sections give a software example for using a UART as an RS-232
communication port to an 8-N-1 PC terminal. The software is broken up into
initialization, transmit, and receive sections. The example uses the UART in a simple
polled configuration, but a description is provided to discuss how the UART could be
used in interrupt mode or in conjunction with the DMA to help decrease CPU loading.
11.3.1 UART initialization example
The initialization code below can be used to configure the UART for 8-N-1 operation
(eight data bits, no parity, and one stop bit) with interrupts and hardware flow-control
disabled. The parameters passed in to this function are the UART channel to initialize
(uartch), the module clock frequency for the UART in kHz (sysclk), and the desired baud
rate for communication (baud).
void uart_init (UART_MemMapPtr uartch, int sysclk, int baud)
{
102
register uint16 ubd, brfa;
uint8 temp;
/* Enable the clock to the selected UART */
if(uartch == UART0_BASE_PTR)
else
SIM_SCGC4 |= SIM_SCGC4_UART0_MASK;
if (uartch == UART1_BASE_PTR)
else
SIM_SCGC4 |= SIM_SCGC4_UART1_MASK;
if (uartch == UART2_BASE_PTR)
else
The table above describes the UART instantiations on the
Kinetis family devices available as of the writing of this
document. As new Kinetis devices become available the UART
instantiations could change. Please refer to the "Chip
Configuration" chapter of the device-specific reference manual
to verify the UART instantiation information for your device.
The UART modules are pinned out in multiple locations, so the
initialization function below doesn't know which UART pins to
enable. The desired UART pins should be enabled before
calling this initialization function.
SIM_SCGC4 |= SIM_SCGC4_UART2_MASK;
if(uartch == UART3_BASE_PTR)
SIM_SCGC4 |= SIM_SCGC4_UART3_MASK;
Kinetis Quick Reference User Guide, Rev. 0, 11/2010
NOTE
NOTE
Freescale Semiconductor

Related parts for TWR-K60N512-KEIL