BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Sun Oct 21, 2018 4:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: EEPROM loosing data when chip moved
PostPosted: Sun Apr 10, 2016 1:21 am 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
I thought the EEPROM kept data even when power is turned off.
When I write and read data in the programming board it works perfectly.
Then I remove the chip and write data to EEPROM in my user circuit. To examine
what data is written I plug the chip back into the programming board, read the data
and display it using the Debug command.
The byte data is 255 and the word data is 65535. I am expecting a decimal 1 in the byte data
and a number like decimal 200 to 900 in the word data.
It is always powered down normally before being removed from the socket.
Any idea why?


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Sun Apr 10, 2016 3:23 am 
Offline
Master

Joined: Wed Oct 19, 2011 2:28 am
Posts: 123
Hi,
Which Atom Nano are you using? Just in case Nano 8 does not have eeprom.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Sun Apr 10, 2016 2:31 pm 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
No, I am using a Nano18. Thanks.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Sun Apr 10, 2016 5:23 pm 
Offline
Master

Joined: Wed Oct 19, 2011 2:28 am
Posts: 123
Hi,

Try using the writedm 0,[0] command, try it to see if it works for you. I think I ran into same problem in one of my projects and by doing writedm command instead the write I was able to save the data in eeprom.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Sun Apr 10, 2016 6:29 pm 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
Thanks, I will try when I have time and report back. Seems odd that
the WRITE command would not work. This is quite a mature system.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Wed Apr 20, 2016 2:19 am 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
I tried WRITEDM and it seems to do nothing. In fact it hung the program.
I wish someone would tell me why the very straightforward write command does not actually save the data
after power is removed. Here is my simple program.

Flag var byte
Flag = 1
WRITE 4, Flag ; Write 00000001 to EEPROM location 4
Flag = 0 ; Clear the variable
READ 4, Flag
DEBUG ["Flag is ", DEC Flag, 13] ; On the screen this correctly displays Flag is 1

Now cycle the power and load and run the following program:
Flag var byte
Flag = 0
READ 4, Flag
DEBUG ["Flag is ", DEC Flag, 13] ; On the screen this displays Flag is 255 /not correct!

Please let me know what is wrong here.
Thanks.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Wed Apr 20, 2016 4:21 am 
Offline
Master

Joined: Wed Oct 19, 2011 2:28 am
Posts: 123
Hi,
Try this program. Just program the file and turn off the power and see what happened. I will print out the memory data in the terminal
'****************** variable definition ***************
Flag var byte
loop_1 var byte

'*******************************************************
Main

flag = 0
READ 4,flag
if ( flag = 1) then
goto bypass_write
endif
gosub write_data
bypass_write:

gosub read_data
goto main
'******************* Write data ***************************
write_data

Flag = 1
WRITE 4 , Flag ; Write 00000001 to EEPROM location 4
Flag = 0 ; Clear the variable
READ 4, Flag
Serout s_out, i9600,["writtene data = ",dec flag,13]
return
'******************** Read dta ****************************
read_data

pause 1000
'Now cycle the power and load and run the following program:

READ 4, Flag
Serout s_out, i9600,["Data loc 4 = ",dec flag,13]
return
'*************************************************************


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Tue Apr 26, 2016 6:22 pm 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
Well, now my Nano18 chip no longer runs a program. I can compile, link and upload any program to it
and then nothing happens. I even wrote a simple program to blink an LED on pin 16 and it will not run.
The chip must have quit.
I will have to wait until I get a new one. This project is in it's 3rd year, in part due to all the problems
I've had with the Nano (see my other posts). If I was smart I would give up on this and switch to
some other chip. Maybe a picaxe? Or are those just as difficult to work with?


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Tue Apr 26, 2016 9:44 pm 
Offline
Master

Joined: Wed Oct 19, 2011 2:28 am
Posts: 123
Hi,
Belief me one of the best micro chips it is the AtomNano series and the Zbasic micros. I tried the Picaxe but their variable assignment are the worst. Also the commands are limited. Depending of the project I used one of the two. Now I am learning the Arduino but their instructions set are limited also. I would check the voltage to make sure it is clean and it close to 5.0 volts. . Also make sure that you have a .1 uf capacitor as close as possible to the Vcc pin and ground.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Tue Apr 26, 2016 9:59 pm 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
Nothing has changed. It just has just stopped working.
It was working normally for months.
I ordered a new chip for $15 including shipping from UK.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Wed Apr 27, 2016 9:16 pm 
Offline
Site Admin
User avatar

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

I have your order and the new IC has been sent out to you today,

I think looking at how you are doing this testing that the original write command was working fine BUT when you load the new program into the Nano-18 to try and read the stored contents the action of writing the new program into the Nano causes the EEPROM data to be erased so you will never see the data you saved,

Make a small program with 2 sections, read an IO pin like P0 to see if its low or high state, if its low just go to the part of the program where you write the data to the data memory location and print a message to say its been done and then stop, if the P0 pin is high then go to the section of the program where you read the location and output it to the serial port every second, set the pin by connecting it to 0V and then power up the circuit, the data will then be written and a serial output will confirm this then power off and tie the P0 line to +5V and apply the power and it will then print the value out that you saved in the first part of the program and you should then find everything is working as expected,

As for the dead NANO-18 I can not think why this is the case that its failed after so long BUT as advised do check the +5V supply value is within range and 0.1uF decoupling capacitor is fitted close to the IC's power lines, also check the state of the RESET and SER lines as if these are left to float that can cause a hang at run time, when you use the programmer that takes control of these lines so everything seems to be working fine but when you unplug the programmer these lines may float and may be causing the problems you describe, use a 10K resistor from the RESET line(Pin 4) and one from the SER line(Pin 3) to +5V on your circuit, I am sure this will get that IC up and running again,

If all this fails and its still dead then if you return it to us we will test and reprogram it for you,

The Nano range is a fantastic device and once your used to programming it you will wonder how you managed without it and the support you can get from the other forum members and ourselves is extremely and good we plan to support the Nano Range for many years to come,

I hope this helps,

Many thanks
Dave

BasicMicroUK


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Wed Apr 27, 2016 11:59 pm 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
If reloading a program clears the EEPROM then that would explain why the values read OK when initially written but fail to carry over after loading the new program. I will keep this in mind. My 5 Volt supply is 4.95V at the chip power pin and there is a .1uf cap on it. I will investigate the SER and RESET lines further when I have time. However the chip does not work in the programming board even though it loads and verifies OK.
Thanks.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Thu Apr 28, 2016 6:44 am 
Offline
Master

Joined: Wed Oct 19, 2011 2:28 am
Posts: 123
Hi,

Normally when I had a problem with one of the chip the first problem it is that it will not program. Also it will give you an error that it is unable to find the chip. If you are able to compiled and down load the program means that it is possible that you may have a bug in your program. Try to load the Hello message program to see if it work, if not them the chip lost the system.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Thu Apr 28, 2016 3:45 pm 
Offline
Citizen

Joined: Sun Apr 22, 2012 10:22 pm
Posts: 26
I have tried 3 or 4 simple programs, some new and some that worked previously. No luck.


Top
 Profile  
 
 Post subject: Re: EEPROM loosing data when chip moved
PostPosted: Wed May 11, 2016 8:52 pm 
Offline
Site Admin
User avatar

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

Has the order for the new Nano-IC arrived now ?,

Is all going well with it ?,

Thanks
Dave
BasicMicroUK


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

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

phpBB SEO