avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] interrupt problem with eeprom api, running on atmega128


From: Michael
Subject: [avr-gcc-list] interrupt problem with eeprom api, running on atmega128
Date: Mon, 18 Aug 2008 15:38:43 +1000

Hi, I am finding that I have to disable interrupts when reading the eeprom using eeprom_read_byte().

If I don’t, then the code executes the EE_READY_vect, even though this interrupt is disabled.

 

I have attached the smallest program I can to demonstrate this.

I am running it on an atmega128, loaded into a stk500 using the stk501 addon.

I have PORTC connected to the leds, I am using the led on PC0.

My fuse values are 0xFF, 0xDF, 0x21 (Internal RC 1MHz osc)

 

If you run the code as attached, it will:

Turn on the led on PC0

Read the eeprom

Blink the led on PC0

 

However if you remove the cli(); before the eeprom read, the code will execute the EE_READY isr, and hang with the led off.

 

I have examined the listing output, and I cannot see why this is happening. I know that it did not happen in earlier versions of the compiler, yet I can’t remember which version’s specifically.

I currently have WinAVR-20080512

 

I’d like to get to the bottom of this somehow, as I am having some eeprom reliability problems which may or may not be related.

 

 

Regards, Michael.

 

Attachment: main.c
Description: Text document

Attachment: eepromtest.lss
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]