RadioLocman.com Electronics ru
Advanced Search +
  
Go Back   RadioLocman Forum > Electronics and ... > Microcontrollers (MCU)

Microcontrollers (MCU) Application and programming of MCUs, Evaluation Kits and Demonstration Boards, Programmers.

Reply
 
Thread Tools Search this Thread
Old 05-17-2015, 02:57 PM   #1
Jon
Junior Member
 
Join Date: Oct 2013
Posts: 20
Jon is on a distinguished road
Default How to write data to the Eeprom segment ?

How to write data to the Eeprom segment in ATmega8 ? Doing the program in AVR Studio. Inclined to Assembly programming.
It is advisable to write a subroutine...
Jon is offline   Reply With Quote
Old 05-18-2015, 05:10 PM   #2
symbol
Senior Member
 
Join Date: Oct 2013
Posts: 128
symbol is on a distinguished road
Default

Quote:
Originally Posted by Jon View Post
How to write data to the Eeprom segment in ATmega8 ? Doing the program in AVR Studio. Inclined to Assembly programming.
It is advisable to write a subroutine...
Nothing tricky about it. You can use the standard library.
Code:
EEWrite:	
	SBIC	EECR,EEWE		; 
	RJMP	EEWrite 		
 
	CLI			
	OUT 	EEARL,R16 		;
	OUT 	EEARH,R17  		; 
	OUT 	EEDR,R21 		
 
	SBI 	EECR,EEMWE		
	SBI 	EECR,EEWE		; 
 
	SEI 				; 
	RET
and

Code:
EERead:	
	SBIC 	EECR,EEWE		; 
	RJMP	EERead			; 
	OUT 	EEARL, R16		;
	OUT  	EEARH, R17 		; 
	SBI 	EECR,EERE 		; 
	IN 	R21, EEDR 		; 
	RET
symbol is offline   Reply With Quote
Old 05-25-2015, 04:34 PM   #3
Jon
Junior Member
 
Join Date: Oct 2013
Posts: 20
Jon is on a distinguished road
Default

Thanks
Where is the address ?
Jon is offline   Reply With Quote
Old 05-27-2015, 10:54 AM   #4
symbol
Senior Member
 
Join Date: Oct 2013
Posts: 128
symbol is on a distinguished road
Default

In the register R21 the data is written.
Address R17, R16
symbol is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Discussion: One wire brings power & data to LCD module Radiolocman Robot Projects and Advices 1 04-19-2015 06:12 PM
EEPROM data corruption Atmega32a rapid Microcontrollers (MCU) 3 03-27-2015 09:16 PM
Discussion: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays Radiolocman Robot Projects and Advices 2 09-20-2014 08:01 PM
Connect LEDs to the 220V mark Beginners 3 11-30-2013 11:08 AM
Discussion: How to Charge Any USB Device by Riding Your Bike Radiolocman Robot Projects and Advices 1 12-01-2011 02:20 PM

All times are GMT. The time now is 01:38 PM.




Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Slices ↓
Radiolocman facebook Radiolocman twitter Radiolocman google plus