Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

AT91SAM7SE512: USART0 RXD interrupt

Posted by nanjooh on October 19, 2007
Dear All,

I am using the Keil uvision3 ARM version(Real view),
In my code i am using UART0 for Transmission and reception.

The transmission has no problem. For reception i am using the RX interrupt.
The problem is, If i type any letter in the keyboard (Hyperterminal),
no receiver interrupt is generated in the controller.

Can you please help me to rectify this problem.

operating system: XP
Operating Tool : Keil Uvision3 ARM view (version 3.53)
Controller: AT91SAM7SE512
For your reference here is the code,

//*----------------------------------------------------------------------------
//* Function Name : Usart_c_irq_handler
//* Object : C handler interrupt function call by the interrupts
//* assembling routine
//*----------------------------------------------------------------------------
void Usart_c_irq_handler(void)
{
AT91PS_USART USART_pt = AT91C_BASE_US0;
unsigned int status;
//* get Usart status register
status = USART_pt->US_CSR;
if ( status & AT91C_US_RXRDY){
//* Get byte and send
AT91F_US_PutChar (USART_pt, AT91F_US_GetChar(USART_pt));
}

if ( status & AT91C_US_OVRE) {
//* clear US_RXRDY
AT91F_US_GetChar(USART_pt);
AT91F_US_PutChar (USART_pt, 'O');
}

//* Check error
if ( status & AT91C_US_PARE) {
AT91F_US_PutChar (USART_pt, 'P');
}

if ( status & AT91C_US_FRAME) {
AT91F_US_PutChar (USART_pt, 'F');
}

if ( status & AT91C_US_TIMEOUT){
USART_pt->US_CR = AT91C_US_STTTO;
AT91F_US_PutChar (USART_pt, 'T');
}

// Reset the satus bit
USART_pt->US_CR = AT91C_US_RSTSTA;

}
//*-------------------------- External Function -------------------------------

//*----------------------------------------------------------------------------
//* Function Name : Usart_init
//* Object : USART initialization
//*----------------------------------------------------------------------------
void Usart_init ( void )
//* Begin
{

AT91PS_USART COM0 = AT91C_BASE_US0;

//* Configure PIO controllers to periph mode
AT91F_PIO_CfgPeriph( AT91C_BASE_PIOA,
((unsigned int) AT91C_PA5_RXD0 ) |
((unsigned int) AT91C_PA6_TXD0 ), 0); // Peripheral B
//((unsigned int) AT91C_PA7_RTS0 ) |
//((unsigned int) AT91C_PA8_CTS0 ), // Peripheral A
//0); // Peripheral B

//* First, enable the clock of the USART
AT91F_PMC_EnablePeriphClock ( AT91C_BASE_PMC, 1 << AT91C_ID_US0 ) ;
//* Usart Configure
AT91F_US_Configure (COM0, AT91B_MCK, AT91C_US_ASYNC_MODE, AT91_BAUD_RATE, 0);

//* Enable usart
COM0->US_CR = AT91C_US_RXEN | AT91C_US_TXEN;

//* Enable USART IT error and RXRDY
AT91F_US_EnableIt(COM0, AT91C_US_TIMEOUT |
AT91C_US_FRAME |
AT91C_US_OVRE |
AT91C_US_RXRDY);

// open Usart 1 interrupt
AT91F_AIC_ConfigureIt ( AT91C_BASE_AIC, AT91C_ID_US0, USART_INTERRUPT_LEVEL,AT91C_AIC_SRCTYPE_HIGH_LEVEL, Usart_c_irq_handler);
AT91F_AIC_EnableIt (AT91C_BASE_AIC, AT91C_ID_US0);

AT91F_US_PutChar (COM0,'X');

AT91F_US_SendFrame(COM0,(char *)display,sizeof(display),0,0);



//* End
}


with regards,
Murthy.R


RE: AT91SAM7SE512: USART0 RXD interrupt

Posted by Allure99 on October 19, 2007
Do you have your interrupt service routine?

serialISR.c ?

void vUART_ISR( void ) __attribute__ ((naked));

void vUART_ISR( void )
{
if( ulStatus & AT91C_US_RXRDY)
{
//---
}
}


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists