Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Control is not returning from ISR(USART_RXC_vect) in atmega32 ??

Status
Not open for further replies.

sgugan

Member level 1
Joined
Mar 26, 2010
Messages
35
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
bangalore
Activity points
1,483
Hi i am using mega32.
once the RXC interrupt set the control jumps to ISR routine. but it is not coming from out of ISR, its keeps on looping there.
how to come out of that.
PLS CHECK CODE

#include <avr/io.h>
#include <stdio.h>
#include <avr/interrupt.h>
#include <util/delay.h>

ISR(USART_RXC_vect)
{
// UCSRA=0x00;
// while((UCSRA & 0x80)==0x00);
// data=UDR;
// UDR=data;

// UDR='K';
// _delay_ms(100);
// while((UCSRA & 0x20)==0x00);
// asm("RETI");
// return 0;
PORTA=0xFF;
_delay_ms(400);
PORTA=0x00;
_delay_ms(400);

// UCSRA=0x00;

}


int i; char data;

int main(void)
{

DDRA=0xFF;
DDRD=0x02;

UCSRA=0x00;
UCSRB=0x98;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=25; //set baud rate
asm("SEI");



while(1)
{
// PORTA=0xFF;
// _delay_ms(400);
PORTA=0x00;
// _delay_ms(400);
// while((UCSRA & 0x80)==0x00);
// data=UDR;
// data='H';
// UDR=data;
// while((UCSRA & 0x20)==0x00);
// UCSRA=0x00;
}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top