Jump to content
Sign in to follow this  
Haluk

Db In Eeprom

Recommended Posts

:unsure:

 

#pragma DATA 0x2100, 0x00, 0x01, 0x02, 0x03

 

this pragma is Equal too :::

 

|ORG 0x00002100

|DW 0x0000

|DW 0x0001

|DW 0x0002

|DW 0x0003

|DW 0x0000

...

 

How can i set, Byte variables into EEPROM on BoostC

 

|ORG 0x00002100

|DB 0x00

|DB 0x01

|DB 0x02

|DB 0x03

|DB 0x00

Share this post


Link to post
Share on other sites
:)

 

#pragma DATA 0x2100, 0x00, 0x01, 0x02, 0x03

 

this pragma is Equal too :::

 

|ORG 0x00002100

|DW 0x0000

|DW 0x0001

|DW 0x0002

|DW 0x0003

|DW 0x0000

...

You are correct, that you will get these DW in the .asm, and .hex file. But when you program it onto the PIC (or even load it into a simulator), you'll find that it actually assignes the values to each byte, as if you had used a DB. So though the result looks odd, it works fine for writing to EEPROM. If you wnat to write to Program memory using '#pragma DATA' you need to write full 14bit words though. For instance, I was doing byte-compression (place 2 ASCII characters into a single 14bit word) similar to the 'DA' directive in MPASM, and I couldn't figure any way to do it through boostC. I ended up writing a perl script to pack strings for me, and just used '#pragma DATA' to get around this.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...