BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 12:39 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Reading eeprom to an array?
PostPosted: Sat Nov 26, 2011 12:11 pm 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
I am using a nano 28 and storing 90 bytes of variable data on eeprom and I need to access particular bytes of data. Can I use readdm to retrieve all 90 bytes to an array and then store a pair of bytes to a word variable?

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Reading eeprom to an array?
PostPosted: Sun Nov 27, 2011 2:47 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
As long as your store the data to the eeprom in the correct order you should be able to do this:

;read an array of word size values from eeprom.
myarray var word(45)

;.byte0 modifier accesses the word array as a byte array
readdm 0,[str myarray.byte0\90]

If you just want to read 90 bytes into a byte array:

myarray var byte(90)
readdom 0,[str myarray\90]

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Reading eeprom to an array?
PostPosted: Sun Nov 27, 2011 5:11 pm 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
Thanks, that looks like what I need. Will try shortly.

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Reading eeprom to an array?
PostPosted: Mon Nov 28, 2011 9:27 am 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
Worked perfectly!

_________________
Harley


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO