hello, i m making one screen in which i m doing increment and decrement and shifting key operation but while doing so, i get '?' when i change the values and if 2 values are present then while changing the values other values shows '?' but if i proceed further i regain the lost values i m using pointer for increment, decrement,shift operation r my values getting lost?
As can be seen from this text. Definitely haunted...
"I hav a system in which i m using LCD."
What LCD? How is it connected to your 8051?
"In that i hav a screen in which i m setting the values say temperature, volume, time."
How are you "setting the values"? Maybe there's a bug in it?
"My problem is that if i try to change the any one of the value eg. temperature with increment, decrement, shifting keys then my other values are affected."
So there's a bug somewhere - it could be in your displaying the values, or storing the data, or doing the changes.
You need to debug your code to find out exactly where it's going wrong; Once you know exactly where it's going wrong, you can find out what is going wrong; Once you know what is going wrong, then you can fix it!
Nobody else can do this for you - certainly not on the information you've provided!
"some times it gives '?' instead of values."
What is "it"?
Think about the code - where could the '?' come from?
Does your display driver insert '?' when you give it an invalid value? etc?
"same for shift key"
What shift key?
"I m using pointers for it"
That's got to be the first place to look - if you mess-up your pointers, you can cause all sorts of bizarre effects!
You should prove that your basic functions are working in the Simulator...
thanx Andy, i think i hav solved the problem
i m using a routine which converts hex to bcd
i m using unsigned long int variable for the operation but for displaying i m using only 1st 4 digits of the variable
variable used for the operation is xdata and counter to separate the digits is unsigned char and internal memory, i mean to say i m using a for loop to separate each digit
so i made that counter as xdata, till now i didnot get the missing value problem on display but i m still looking for it
Where do you get hex data from? You have an input routine taking the characters '0'..'9','A'..'F' ('a'..'f') as input? Or do you have an array of bytes - each containing the values 0..15?
There is nothing haxadecimal about the integers your processor works with - they are just numbers. It isn't until you format them for printing that they may be formatted for base-10, base-16 or whatever you require.