Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

$eeprom problem

 
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
mariosm

Bascom Member



Joined: 12 Oct 2005
Posts: 50
Location: Thessaloniki

greece.gif
PostPosted: Fri Feb 01, 2008 11:52 pm    Post subject: $eeprom problem Reply with quote

Hi All

I try to write seven numbers in eeprom with these code lines
Code:

$eeprom
Data 600 , 1200 , 2400 , 6000 , 12000 , 24000 , 60000
$data
 

After compiling the program i try to write the .eep file in the eeprom of a microcontroller (ATmega8515) with my ISP programmer.
I see on my screen a label with this :" Error at line 1!. Line must begin with ":" character!".
Who is the problem?

Marios


..( My programmer is USB AVRprog with AVRFLASH Programmer 2.10 software from Microelectronica)
Back to top
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1571
Location: Basel, Switzerland

switzerland.gif
PostPosted: Sat Feb 02, 2008 10:34 am    Post subject: Reply with quote

Hi,

You need o define a label for your data. The example in the help text is:-
Code:

'-------------------------------------------------------------------------------
'copyright                : (c) 1995-2005, MCS Electronics
'micro                    : AT90S2313
'suited for demo          : yes
'commercial addon needed  : no
'purpose                  : demonstrates $DATA directive
'-------------------------------------------------------------------------------
$regfile = "2313def.dat"
$baud = 19200
$crystal = 4000000                                          ' 4 MHz crystal
Dim B As Byte
Readeeprom B , 0                                            'now B will be 1
End

Dta:
$eeprom
Data 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8
$data
End
 


Note the Dta: line.

Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Sat Feb 02, 2008 2:01 pm    Post subject: Reply with quote

Hi,

Integer and Word constants must end with the %-sign.
Long constants must end with the &-sign.
Single constants must end with the !-sign.
Double constants must end with the #-sign.

Example:

Code:
Dta:
$eeprom

Data 1 , 20 , 255  'these are bytes, each value will use 1 byte of EEPROM.
Data 1%, 20%, 255%, 32767%  'these are integers, each value will use 2 bytes of EEPROM.
Data 1%, 20%, 255%, 65535%  'these are words, each value will use 2 bytes of EEPROM.
Data 1&, 20&, 255&, 65535&, 2147483647&   'these are longs, each value will use 4 bytes of EEPROM.
Data 1.123!, 123.456! 'these are singles, each value will use 4 bytes of EEPROM.
Data 1.123#, 123.456# 'these are doubles, each value will use 8 bytes of EEPROM.

$data
 


Best regards,

Luciano
Back to top
View user's profile
JohnCannon

Bascom Member



Joined: 04 Jan 2006
Posts: 162

usa.gif
PostPosted: Sat Feb 02, 2008 10:23 pm    Post subject: Reply with quote

Nice Post, Luciano,
Where, within Bascom, is this information? I didn't find it in HELP.
JC
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Sat Feb 02, 2008 10:45 pm    Post subject: Reply with quote

Hi John,

See help file DATA.

Best regards,

Luciano
Back to top
View user's profile
mariosm

Bascom Member



Joined: 12 Oct 2005
Posts: 50
Location: Thessaloniki

greece.gif
PostPosted: Sun Feb 03, 2008 1:28 pm    Post subject: Reply with quote

Hi

Thank you for your answers i.dobson and Luciano.

I find the problem. I should have used $eepromhex command
because my programmer need the hex format of .eep file.

Thanks for all

Marios
Back to top
View user's profile
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