View previous topic :: View next topic |
Author |
Message |
mariosm
Joined: 12 Oct 2005 Posts: 50 Location: Thessaloniki

|
Posted: Fri Feb 01, 2008 11:52 pm Post subject: $eeprom problem |
|
|
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 |
|
 |
i.dobson
Joined: 05 Jan 2006 Posts: 1571 Location: Basel, Switzerland

|
Posted: Sat Feb 02, 2008 10:34 am Post subject: |
|
|
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 |
|
 |
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy

|
Posted: Sat Feb 02, 2008 2:01 pm Post subject: |
|
|
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 |
|
 |
JohnCannon
Joined: 04 Jan 2006 Posts: 162

|
Posted: Sat Feb 02, 2008 10:23 pm Post subject: |
|
|
Nice Post, Luciano,
Where, within Bascom, is this information? I didn't find it in HELP.
JC |
|
Back to top |
|
 |
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy

|
Posted: Sat Feb 02, 2008 10:45 pm Post subject: |
|
|
Hi John,
See help file DATA.
Best regards,
Luciano |
|
Back to top |
|
 |
mariosm
Joined: 12 Oct 2005 Posts: 50 Location: Thessaloniki

|
Posted: Sun Feb 03, 2008 1:28 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
|