Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to display signed analog values in lcd

Status
Not open for further replies.

anoop kr

Member level 4
Joined
Aug 6, 2010
Messages
69
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
kerala
Activity points
1,885
Hi

For my new project i have to display signed analog values on LCD. ie both positive and negative values i have to display on LCD. The ADC i am using is AD7714 and the MCU is ATmega8. I configured the ADC inputs in the differential input form and i set a constant voltage(+1V) at one of the ADC inputs as reference input and the value at next input is changing.

my plan is when the varying analog value is higher than the reference voltage set at one of the inputs, its considered as positive and when the value is lower than the set value its considered as negative.The range of values i have display is from -15 to +15 for the analog inputs 0V to 2V with +1V as reference. I can display the values from 0 to +15 ie for the analog input from 1V to 2V. but whenever i am trying to display the negative values its showing 295 on LCD. when i check i realize that -1 is showing as 295. but i have to display the value as -1. what i have to do...
 

Are you sure that you are seeing 295 AND not 255? Because 255 in the 8-bit 2-complement notation is -1.

If it is so, then your case is simply a formatting error. If it is not, you need to debug deeper.
 

Hi
i am really sorry for the late reply.
Yes it is showing as 295. I could see this when i am simply subtract the constant value(here i put 127) i am getting 295. And i am getting 0,+1,+2... values simply when the input values are greater than 127 like 127-127=0,128-127=+1....
 

Hi,

post your schematic and your code.

Klaus
 

hello

here i put 127) i am getting 295.

so you put 0x127 hexadecimal not 127 decimal
0x127= 295.

How do you store your ADC value ?
into a byte, a word (16bits) , signed , unsigned ...
How do you scale the result -15 0 +15 value only with 2 digits ?
so post your code ...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top