Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

How to implement the Serial IrDA on LM3S6965

Posted by Bill Yang on October 30, 2008
Hi, I am not familiar to SIR IrDA and have a question regarding the Serial (or Slow) IrDA implementation over the LM3S6965 or any Cortex-M3 architecture. Current I worked on a project that has two infrared serial devices to connect to the UART1 and UART2 (or the IrDA port 1 & 2) on the LM3S6965, but I could not get them to Tx/Rx through a interrupt service routine. If someone has an idea how to configure and implement this UART port and can share a sample code with me, it will be greatly appreciated. The following code is configuration of SIR1 and SIR2.
/* Enable the UART and IrDA. GPIOA has already been initialised. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2);

/* Set GPIO A0 and A1 as peripheral function. They are used to output the
UART signals. D2/D3 and G0/G1 for IrDA */
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_2 | GPIO_PIN_3);
GPIOPinTypeUART(GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1);
/* Configure the UART to 115200 for 8-N-1 operation. */
UARTConfigSet( UART0_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE );
UARTConfigSet( UART1_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE );
UARTConfigSet( UART2_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE );
/* We dont want to use the fifo. */
HWREG( UART0_BASE + UART_O_LCR_H ) &= ~mainFIFO_SET;
/* Enable the SIR1 and SIR2 */
UARTEnableSIR(UART1_BASE, (tBoolean) false);
UARTEnableSIR(UART2_BASE, (tBoolean) false);

/* Enable both Rx and Tx interrupts. */
HWREG( UART0_BASE + UART_O_IM ) |= ( /*UART_INT_TX |*/ UART_INT_RX );
IntEnable( INT_UART0 );
/* Enable IrDA1 and IrDA2 interrupt */
HWREG( UART1_BASE + UART_O_IM ) |= ( /*UART_INT_TX |*/ UART_INT_RX );
IntEnable( INT_UART1 );
HWREG( UART2_BASE + UART_O_IM ) |= ( /*UART_INT_TX |*/ UART_INT_RX );
IntEnable( INT_UART2 );

thanks,
Byang

RE: How to implement the Serial IrDA on LM3S6965

Posted by Dave on October 30, 2008
Try the Luminary Micro driver library, or the Luminary Micro support desk. Please keep to FreeRTOS questions here.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner