BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Tue Jan 23, 2018 8:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: read/write EEPROM
PostPosted: Wed Mar 05, 2014 4:15 pm 
Offline
Guru

Joined: Mon Dec 21, 2009 6:52 am
Posts: 92
Hi,

I am trying to write and read on EEPROM with the nano8.
I tried both programs below and none of them seems to work since I don't get feedback on the terminal?

Code:
index var byte
char var byte
write 0,”H”
write 1,”e”
write 2,”l”
write 3,”l”
write 4,”o”
for index = 0 to 10
     read index,char
next
serout s_out,i9600,[char]
end



Code:
index var byte
string var byte(11)
    writedm 0,[“Hello world”]
     readdm index,[str string\11]
     serout s_out,i9600,[str string\11]
end


thanks

Chris


Top
 Profile  
 
 Post subject: Re: read/write EEPROM
PostPosted: Thu Mar 06, 2014 12:02 am 
Offline
Site Admin
User avatar

Joined: Fri Apr 12, 2013 8:38 pm
Posts: 87
Location: Nottingham, England, UK
HI,

Well in the first example program you posted using the READ command the problem here is that the serout command is outside the FOR NEXT loop and so this example would not work on any Nano IC BUT the main problem here with your plan is that the Nano-8 IC your looking at using does not have any internal EEPROM capacity at all, you will need to go up to the Nano-18 IC as that has a 256 Byte EEPROM or use an external EEPROM on the Nano-8 however with the limited IO capacity of the Nano-8 as this option would be needing 3 IO lines this may not be practical,

Code:
index var byte
char var byte

write 0,”H”
write 1,”e”
write 2,”l”
write 3,”l”
write 4,”o”

for index = 0 to 4
     read index,char
     serout s_out,i9600,[char]
next
 
end


The above example will work on the Nano-18 on,

I hope this helps,

Dave
BasicMicroUK
http://www.basicmicro.co.uk


Top
 Profile  
 
 Post subject: Re: read/write EEPROM
PostPosted: Thu Mar 06, 2014 8:51 am 
Offline
Guru

Joined: Mon Dec 21, 2009 6:52 am
Posts: 92
Thanks Dave,

I didn't see the nano8 didn't have EEPROM.
For the exemples they are all from Studio manual V 2.1
It would be good to correct them

Chris


Top
 Profile  
 
 Post subject: Re: read/write EEPROM
PostPosted: Sun Mar 09, 2014 6:22 pm 
Offline
Master

Joined: Wed Oct 19, 2011 2:28 am
Posts: 123
Hi,
If you have an extra spare port you can use a 1-Wire EEPROM. It use only one wire to read/write to the memory.


Top
 Profile  
 
 Post subject: Re: read/write EEPROM
PostPosted: Tue Sep 16, 2014 7:02 am 
Offline
New User

Joined: Tue Sep 16, 2014 6:27 am
Posts: 2
An indexing error could be more devastating in a byte(or larger sized) array. In a bit array there may be some extra bits of padding because a multiple of 8 bits was not defined leaving the extra bits unused.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO