We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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?
"... write decimal value ..." Are you writing the value as ASCII decimal characters for eventual output to your LCD?
"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?!
"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!
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
"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
"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/
"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!