• hi, i having a problem to display adc reading on the lcd display .i m using atmega32 and connected an analog voltage to ch0 of it.i m using avcc as a refrence
Message 1 of 8 , Sep 2, 2009
View Source
• 0 Attachment
hi,
i having a problem to display adc reading on the lcd display .i m using atmega32 and connected an analog voltage to ch0 of it.i m using avcc as a refrence ,the adc resolution is 10 bit ,i don,t understanding how to display the fractional part of adc reading for example i m inputing (5/1023=.0048v)and i read 0x01,so how i can display it on the display .plz help me with a simple code with comments for better understanding .
thanking all of u ,
dany
Message 2 of 8 , Sep 4, 2009
View Source
• 0 Attachment
 for reading values <1, multioly them by 10 or 100 or 1000 to make it large...To display them in to lcd, convert these numbers into character..Say you want to display 42 (z).take first digit  x=z%2;             now x=2; take any char (char d='0').run a for loop (i) from 0 to 9in each iteration   compare i with x;                          if it not matches increment d by 1; and if matches send d to lcd...ex: we have x=2 and d='0'loop beginsi=0x is not equal to i hence do nothingd=d+1; i.e. d='1'(character 1);i=1same and d='2';i=2  here x==i so print d to lcd and break i.e.2 which is easy since d is a character not integernow z=z/10;x=z%2; i.e. x=1;again d='0' and so on...

Love Cricket? Check out live scores, photos, video highlights and more. Click here.
• display a 0 and then a point and then the rest of the data :) Please add a better description of your problem. Mihai G.
Message 3 of 8 , Sep 4, 2009
View Source
• 0 Attachment
display a 0 and then a point and then the rest of the data :)

Mihai G.

--- In booksbybibin@yahoogroups.com, "danial_1000" <danial_1000@...> wrote:
>
> hi,
> i having a problem to display adc reading on the lcd display .i m using atmega32 and connected an analog voltage to ch0 of it.i m using avcc as a refrence ,the adc resolution is 10 bit ,i don,t understanding how to display the fractional part of adc reading for example i m inputing (5/1023=.0048v)and i read 0x01,so how i can display it on the display .plz help me with a simple code with comments for better understanding .
> thanking all of u ,
> dany
>
• I will suggest you to upload the detailed program you are using and also the header file of the lcd which you are using. So that it can be observed for the
Message 4 of 8 , Sep 4, 2009
View Source
• 0 Attachment
I will suggest you to upload the detailed program you are using and also the header file of the lcd which you are using. So that it can be observed for the bug.
Many time there a smal basic mistake and you end up in the big mess

--- In booksbybibin@yahoogroups.com, "mihaigalos" <mihaigalos@...> wrote:
>
> display a 0 and then a point and then the rest of the data :)
>
> Mihai G.
>
> --- In booksbybibin@yahoogroups.com, "danial_1000" <danial_1000@> wrote:
> >
> > hi,
> > i having a problem to display adc reading on the lcd display .i m using atmega32 and connected an analog voltage to ch0 of it.i m using avcc as a refrence ,the adc resolution is 10 bit ,i don,t understanding how to display the fractional part of adc reading for example i m inputing (5/1023=.0048v)and i read 0x01,so how i can display it on the display .plz help me with a simple code with comments for better understanding .
> > thanking all of u ,
> > dany
> >
>
• If you use 10 bits them use this formula: 5*N/65535. The value from ADc is in 16 bits, but you use only 10 MSB. The uC have register in 8 bits, so for 10 bits
Message 5 of 8 , Sep 8, 2009
View Source
• 0 Attachment
If you use 10 bits them use this formula: 5*N/65535. The value from ADc is in 16 bits, but you use only 10 MSB. The uC have register in 8 bits, so for 10 bits he will use 16.

From: shamsher_saleem <shamsher_saleem@...>
To: booksbybibin@yahoogroups.com
Sent: Saturday, September 5, 2009 1:18:25 AM
Subject: [booksbybibin,www.booksbybibin.tk] Re: help needed

I will suggest you to upload the detailed program you are using and also the header file of the lcd which you are using. So that it can be observed for the bug.
Many time there a smal basic mistake and you end up in the big mess

--- In booksbybibin@ yahoogroups. com, "mihaigalos" <mihaigalos@ ...> wrote:
>
> display a 0 and then a point and then the rest of the data :)
>
> Mihai G.
>
> --- In booksbybibin@ yahoogroups. com, "danial_1000" <danial_1000@ > wrote:
> >
> > hi,
> > i having a problem to display adc reading on the lcd display .i m using atmega32 and connected an analog voltage to ch0 of it.i m using avcc as a refrence ,the adc resolution is 10 bit ,i don,t understanding how to display the fractional part of adc reading for example i m inputing (5/1023=.0048v) and i read 0x01,so how i can display it on the display .plz help me with a simple code with comments for better understanding .
> > thanking all of u ,
> > dany
> >
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
• hi, i m working on a project where i does switching upon multiple adc readings.the problem is when i vary the the pot and enter that region where i want to
Message 6 of 8 , Oct 21, 2009
View Source
• 0 Attachment
hi,
i m working on a project where i does switching upon multiple adc readings.the problem is when i vary the the pot and enter that region where i want to switch the controller outputs starts dancing (blinking) means there is no solid switching as '1' or '0' and its also increasing the voltages on the output pins linearly as i varying the pot and approaching that region.plz help me.
regards
dany
/*************my code is here*************/
#include <avr/io.h>
#include <util/delay. h>
#define F_CPU 8000000ul
volatile unsigned int ch;
{
//select reference voltage
}
{
unsigned int channel=ch & 0b00000111;
//Start conversion with Interupt
}
int main(void)
{

DDRB=0XFF; // OUT PUTS
sei(); //inite globle interrupt
while(1)
{
_delay_ms(30) ; //WAIT FOR 30 MILLISECOND

_delay_ms(30) ; //WAIT FOR 30 MILLISECOND
}
return 0;
}
{

{
PORTB |=(1<<PB0) ;
PORTB &=~(1<< PB1);
PORTB &=~(1<< PB2);
PORTB |=(1<<PB3) ;
PORTB &=~(1<< PB4);
PORTB |=(1<<PB5) ;
}
{
PORTB |=(1<<PB0) ;
PORTB &=~(1<< PB1);
PORTB &=~(1<< PB2);
PORTB &=~(1<< PB3);
PORTB &=~(1<< PB4);
PORTB &=~(1<<PB5) ;
}
else
{
PORTB=0X00;

}

}
Your message has been successfully submitted and would be delivered to recipients shortly.