Mission 10X

download Mission 10X

of 2

description

mission 10x sample program

Transcript of Mission 10X

Processor UART

The following sections provide an overview of the main components and features of the Universal Asynchronous Receiver/Transmitter (UART) peripheral. It is an alternative to the FIFO, stores upto 16 bytes including 3 aditional bits of error status per byte for thr receiver FIFO. The UART performs serial-to-parallel conversions on data received from a peripheral device and parallel-to-serial conversion on data received from the CPU.

A Baud Rate represents the number of bits that are actually being sent over the media, not the amount of data that is actually moved from one DTE(Receiver) device to the other. The Baud count includes the overhead bits Start, Stop and Parity that are generated by the sending UART and removed by the receiving UART. This means that seven-bit words of data actually take 10 bits to be completely transmitted.

TI OMAP 3530 to UART Rs 232 connection are explained in this chaptor. It requirs following headdrd files

ulk_base_types.h

ulk_proc_uart.h

ulk_io.h

ulk.error.h

base address 0x49020000

1. ulk_proc_uart_init

Syntax : int ulk_proc_uart_init(uint8 port, int baudrate) initialiazes the the UARTInput Argument : 1. uint8 port, 2. int baudrate port number to initialize the UART. Ex : 1, 2, 3, 4 are accepting

baud rate 9600, 19200, 38400, 57600, 115200 only

Return value: inteager type 0- Success1-Failure

2. ulk_proc_uart_getc

Syntax : uint8 ulk_proc_uart_getc(uint8 port) get a charactor from the UART, entered fron keyboardInput Argument : uint8 port Return Value : Always Return 0

3. uint8 ulk_proc_uart_putc

Syntax : uint8 ulk_proc_uart_putc(uint8 port, uint8 val) Put a character to the UART taken from the KeyboardInput Arguments : uint8 port, uint8 val port number to initialize the UART. Ex : 1, 2, 3, 4 are accepting

inteager type data variable name

Return Value : 0 Success 1 Failure4. ulk_proc_uart_gets Syntax : uint8 ulk_proc_uart_gets(uint8 port, uint8 *buff_p) reading a string from UART or reading a charactor repeadely using ulk_proc_uart_getc function repeatedly. Input Argument : uint8 port, uint8 *buff_p port number to initialize the UART. Ex : 1, 2, 3, 4 are accepting

a piinter variable which accepts a string

Return Value : Always return 0

5. ulk_proc_uart_puts

Syntax : uint8 ulk_proc_uart_puts(uint8 port, uint8 *buff_p) put a string to the UART or dumping a character buffer using the ulk_uart_putc function repeatedly. Input Argument : uint8 port, uint8 *buff_p port number to initialize the UART. Ex : 1, 2, 3, 4 are accepting

pointer that holds the string which is being transmitted.

Return Value : 0 SUCCESS 1 FAILURE

6. _serial_setbrg Syntax : int _serial_setbrg (const int port, int baudrate, int val) The purpose of this function is to re initialize the UART interface with different baud rate. Input Argument : const int port , int baudrate , int val port number

baud rate same or different

Return Value :0-SUCCESS 1-FAILURE