Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

EEProm Problem in new Bascom Version ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
chr-mt

Bascom Member



Joined: 25 Feb 2005
Posts: 128

blank.gif
PostPosted: Fri Jun 05, 2009 11:32 am    Post subject: EEProm Problem in new Bascom Version ? Reply with quote

Hi,
just compiled an older Program with the new Version 1.11.9.4
I found that EEprom Data is sometimes not correct, i get 255 as Value when i read out the Variable from the EEprom.
Chip is Mega32
I tried several times using 1.11.9.4 and 1.11.9.3 and the problem only occured using 1.11.9.4.
Using 1.11.9.3 everything is OK.

Can someone confirm this ?


The program is something like this:

Code:
Dim memory as eram Byte
Dim Value As Byte

'Store
Value = 55
Memory = Value

'Recall
Value = Memory

'Value is 255 instead of 55

 


Regards
Christopher
Back to top
View user's profile
KrasserMann

Bascom Member



Joined: 24 Sep 2007
Posts: 48

blank.gif
PostPosted: Fri Jun 05, 2009 12:35 pm    Post subject: Reply with quote

i can confirm this on atmega 128l

since my update to .4 eeprom reading does not work right.

after reinstalling .3 erverything is fine!

Martin
Back to top
View user's profile
chr-mt

Bascom Member



Joined: 25 Feb 2005
Posts: 128

blank.gif
PostPosted: Fri Jun 05, 2009 3:03 pm    Post subject: Reply with quote

Hi KrasserMann,
thank you for confirming this.
I will send a Bugreport to MCS.

Regards
Christopher
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6031
Location: Holland

blank.gif
PostPosted: Sat Jun 06, 2009 10:59 am    Post subject: Reply with quote

I tried it but it works as expected.

$regfile = "m162def.dat"
$crystal = 4000000

$baud = 19200
Dim memory as eram Byte
Dim Value As Byte
Dim V2 As Byte

'Store
Value = 55
Memory = Value

'Recall
Do
V2 = Memory
Loop Until V2 <> Value
Print "ERROR " ; V2
'Print Value
End


Can somebody send a small program that demonstates the problem?

_________________
Mark
Back to top
View user's profile Visit poster's website
chr-mt

Bascom Member



Joined: 25 Feb 2005
Posts: 128

blank.gif
PostPosted: Mon Jun 08, 2009 10:56 am    Post subject: Reply with quote

Hi,
i tried again this morning for many times.
I used the same hardware, the same program but the problem was gone!
Very strange.

I also wrote some testprograms, all in Version 1.11.9.4, but also these programs did run for hours writing and reading the EEprom on the same hardware and also on a STK500 with a Mega2561 without any problems.

I have no idea what caused the problems on last friday.

Regards
Christopher
Back to top
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2483
Location: Queensland

australia.gif
PostPosted: Mon Jun 08, 2009 10:52 pm    Post subject: Reply with quote

You are aware that eeprom address 0 can have corruption problems ? AFAIK Atmel has never fixed this. And since they dont say anything about it on newer chips, nobody knows what chips or processes it still applies to.
_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
chr-mt

Bascom Member



Joined: 25 Feb 2005
Posts: 128

blank.gif
PostPosted: Tue Jun 09, 2009 11:01 am    Post subject: Reply with quote

Hi AdrianJ
Quote:
You are aware that eeprom address 0 can have corruption problems ?

Yes, i know about that.
I tried again today and still there is no problem any more.
@KrasserMann:
Could you check that also again ?

Regards
Christopher
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1173
Location: France

france.gif
PostPosted: Tue Jun 09, 2009 11:46 am    Post subject: Reply with quote

I try the problem and ...I have no problem
I try to a program using EEPROM
my program use 1/2 of the EEProm space of a M32

all values was good.
JP

Ps
I use the lines :
Dim Memoryzero As Eram Byte At 0 ' bug Atmel
' in fist line of dim for EEPROM variable
' Then

Jbyte = 1
If Memoryzero <> Jbyte Then 'Note however that address 0 can be trashed during reset or start up. This is a fault in the AVR design
Memoryzero = Jbyte
End If
Back to top
View user's profile Visit poster's website
KrasserMann

Bascom Member



Joined: 24 Sep 2007
Posts: 48

blank.gif
PostPosted: Tue Jun 09, 2009 3:42 pm    Post subject: Reply with quote

I can try again tomorrow!

Martin
Back to top
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2483
Location: Queensland

australia.gif
PostPosted: Tue Jun 09, 2009 11:03 pm    Post subject: Reply with quote

I may have struck the same problem. I sent a small test program to a customer, which had several constants read from eeprom and used in a conversion from ADC count to human readable numbers, worked fine on my bench setup, but he said the numbers were garbage after loading the hex and eep files, even after a reload. Brought the unit here, and I verified that the output he had was definitely wrong. Fired up AVR Studio, and set up for debugging, but the program worked perfectly after reloading the hex and eep files in the debugger.
Code:

'********************** SRAM variables

dim wADCControlIn as word
dim wControlIn as word

dim btemp as byte
dim wtemp as word


'*********************** ERAM constants
$eepromhex 'hex file for AVR studio
$eeprom
dim eDummy as eram byte
data &h55

dim eControlScale as eram word
data 8%
dim eControlOffset as eram word
data 112%

'setup stuff deleted

main:
'read the pot
wADCControlIn = getadc(0)          'ADC in range 0-1023
wtemp = eControlScale 'Control scale = 8 from eeprom
wControlIn = wADCControlIn / wtemp 'in range 0-128
wtemp = eControlOffset 'controloffset = 112 from eeprom
wControlIn = wControlIn + wtemp   'add offset to get in range 120 - 250

wait 1
goto main
 

And yet we were reading 100 to 118 for the value of wControlIn when the ADC value went from 0-1023.

Still dont know what went wrong. And cannot reproduce the problem.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
Ingo

Bascom Member



Joined: 28 Jan 2005
Posts: 46
Location: Germany

germany.gif
PostPosted: Thu Jun 11, 2009 4:23 pm    Post subject: Reply with quote

Hi guys,

concerning the EEPROM byte 0 issue: I guess that this has been solved for the current parts. A chip manufacturer like Atmel can not afford to fool their customers (biggest volumes go to the industry) and to hide a bug like this. Anyway I have sent this question as a service request to Atmel to be sure. Usually they are responding very quickly.

Reply from Atmel can be found here: http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=7499

_________________
Best regards,

Ingo


Last edited by Ingo on Tue Jun 23, 2009 9:52 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6031
Location: Holland

blank.gif
PostPosted: Mon Jun 22, 2009 9:13 pm    Post subject: Reply with quote

When you look in the errata, you can see what is fixed and what not.
For some bugs they simple say ' do not use it' Smile

eeprom can be corrupted when you do not have a brown out.
I found that the only 100% reliable way is using i2c eeprom.
But i also do use eeprom. In fact i use it a lot in production.

Until somebody can send me some more info (by email) and possible, a way to duplicate, i close this 'case'.
The eeprom code was not changed anyway between .3 and .4.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum