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.

CodeVisionAVR EEPROM busy wait

Status
Not open for further replies.

azadfalah

Full Member level 2
Joined
Aug 13, 2016
Messages
145
Helped
1
Reputation
2
Reaction score
2
Trophy points
1,298
Activity points
2,423
Hello everyone

i want read and write from EEPROM but i don't want use delay i want use EEPROM busy flag check


x= EEPROM_x

EEPROM busy flag while

y=EEPROM_y

EEPROM busy flag while

i don't know how check eeprom busy flag in CodeVisionAVR

Thank
 

Hi,

did you read the AVR datasheet?

Usually there are ASM as well as C examples for EEPROM read/write, including busy_flag_check.

Klaus
 
Code:
C Code Example
unsigned char EEPROM_read(unsigned int uiAddress)
{
/* Wait for completion of previous write */
while(EECR & (1<<EEWE))
;
/* Set up address register */
EEAR = uiAddress;
/* Start eeprom read by writing EERE */
EECR |= (1<<EERE);
/* Return data from data register */
return EEDR;
}

so i should only use while(EECR & (1<<EEWE)) /* Wait for completion of previous write */ it's true ?
 

Hi,

Yes.

What else did you expect?
--> trust the datasheet.

Klaus
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top