Keil Logo Arm Logo

Discussion Forum

reading a memory address

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Jinen Dedhia
Posted
19-Jun-2006 16:27 GMT
Toolset
None
New! reading a memory address
Hi,

I am trying to write a constant value into a particular memory address, say for instance I am trying to write decimal value 8235 into a memory location by converting it into an appropriate hex file.

But when I read the data, at the same address where the value was written, back onto my LCD,I get some another value.

Is there a problem with the data format (little endian, big endian)? How would i verify the data format? Are there any tools available for the same?
Read-Only
Author
Dan Henry
Posted
19-Jun-2006 16:50 GMT
Toolset
None
New! RE: reading a memory address
"... write decimal value ..."

Are you writing the value as ASCII decimal characters for eventual output to your LCD?
Read-Only
Author
Andy Neil
Posted
19-Jun-2006 17:00 GMT
Toolset
None
New! RE: reading a memory address
"Is there a problem with the data format (little endian, big endian)?"

There will be if it's wrong!

But, as you haven't said what chip you're using, what compiler you're using, how you're writing the value, how you're reading the value, or how you're displaying the value, how is anybody supposed to even guess what your problem might be?!
Read-Only
Author
Andy Neil
Posted
19-Jun-2006 17:04 GMT
Toolset
None
New! RE: reading a memory address
"I get some another value."

What other value?

Have you checked to see if it is just byte-reversed, or printing as a numeric value instead of ASCII-coded characters, or wrong signed/unsigned, or at the wrong addres, or any other possibilities...??

If you don't supply any information to allow others to help with this, you will have to do it all yourself!
Read-Only
Author
Jinen Dedhia
Posted
19-Jun-2006 17:19 GMT
Toolset
None
New! RE: reading a memory address
"Have you checked to see if it is just byte-reversed, or printing as a numeric value instead of ASCII-coded characters, or wrong"

Yes, it is printing some numeric value.

Let me give values.

Input Number: 8236
Hex file's output:
address values
00400 00 2c 00 00 00 20 00 00 00
Read on LCD: 0215
Read-Only
Author
Andy Neil
Posted
19-Jun-2006 18:58 GMT
Toolset
None
New! Think about it
"Input Number: 8236
Hex file's output:
address values
00400 00 2c 00 00 00 20 00 00 00
Read on LCD: 0215"


Well, 8236 = 0x202C, doesn't it? So there's a clue!

Since internal data representations, and the way the compiler handles reading data from code space, are entirely implementation-defined you really need to go to the appropriate forum!
Read-Only
Author
Jinen Dedhia
Posted
19-Jun-2006 17:09 GMT
Toolset
None
New! RE: reading a memory address
I am using an Atmel AT90s2313, compiler as CodeVision.

"how you're writing the value, how you're reading the value"

I am using a .C file which helps me generate a hex file for the decimal value. I program the chip with my standard code & later i write this newly created hex file into a particular memory address. In the code, I am reading the value from the same memory address into an integer variable & type casting it into int.

"how you're displaying the value"

there is no issue with the display, as I have a seperate routine for the same. But yes, I need to give ascii for the display. My routine takes care of the same.

Regards,
Jinen
Read-Only
Author
Andy Neil
Posted
19-Jun-2006 18:09 GMT
Toolset
None
New! Off-Topic!
"I am using an Atmel AT90s2313, compiler as CodeVision."

CodeVision is not a Keil product, and the AT90s2313 is an AVR - not supported bt any Keil product:

http://www.keil.com/product/default.asp
http://www.keil.com/forum/

You need to go to an AVR/CodeVision forum.

eg, http://www.avrfreaks.net/

Next Thread | Thread List | Previous Thread Start a Thread | Settings

arm-logo-small

Keil logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.