bilalshah
Jul 3 2008, 7:06 AM
Hi
I am working on my final year project. I am using signal generator to generate a sine wave of frequency 50 hz. After this comes the ADC0804 by national semiconductors. ADC is connected to microcontroller c51 (atmel) which is connected to LCD.
Objective is to collect 100 samples from the ADC and display the peak value on LCD. Means adc samples the 0 to 5v sine wave (50hz) and displays the peak value on LCD.
I have written the code in C and tried proteus for simulation but its not working i m posting my code and cct diagram plz help me to find the bug
backup_of_nicro.zip
micro_code_adc_lcd.zip
I am working on my final year project. I am using signal generator to generate a sine wave of frequency 50 hz. After this comes the ADC0804 by national semiconductors. ADC is connected to microcontroller c51 (atmel) which is connected to LCD.
Objective is to collect 100 samples from the ADC and display the peak value on LCD. Means adc samples the 0 to 5v sine wave (50hz) and displays the peak value on LCD.
I have written the code in C and tried proteus for simulation but its not working i m posting my code and cct diagram plz help me to find the bug
backup_of_nicro.zip
micro_code_adc_lcd.zipsashijoseph
Jul 3 2008, 9:07 AM
Don't have proteus installed,so can't comment on your ckt.
My advice would be to try and implement in hardware rather than use proteus.And when you do,remember to use pullups on port0.
The code seems correct except for one small error in the convertanddisplay() routine.
Here the 3rd line should be : x = binbyte/10;
Of course this wouldn't stop from atleast junk values showing up.
What error are you getting? No display?
My advice would be to try and implement in hardware rather than use proteus.And when you do,remember to use pullups on port0.
The code seems correct except for one small error in the convertanddisplay() routine.
Here the 3rd line should be : x = binbyte/10;
Of course this wouldn't stop from atleast junk values showing up.
What error are you getting? No display?
Arun Kumar V
Jul 3 2008, 6:24 PM
hello shah,
you haven't provided Vcc supply to the micro, you have used battery supply, the micro's power supply pins i,e Vcc and GND will be hidden and simulator connects them to supply while it is running.
in the lcd you should use a 10k pot between VCC, VSS and VEE for contrast control
i doubt VSM simulator model for ADC0804( i,e DLL file ) is not available in proteus there's only schematic model, so i guess you cannot simulate this ADC
Arun
you haven't provided Vcc supply to the micro, you have used battery supply, the micro's power supply pins i,e Vcc and GND will be hidden and simulator connects them to supply while it is running.
in the lcd you should use a 10k pot between VCC, VSS and VEE for contrast control
i doubt VSM simulator model for ADC0804( i,e DLL file ) is not available in proteus there's only schematic model, so i guess you cannot simulate this ADC
Arun
Ajay
Jul 3 2008, 11:09 PM
use ADC0808 instead in proteus, just small changes to select channel etc. you can test your code to be working or not.
bilalshah
Jul 3 2008, 11:57 PM
Thanks Sashji joseph and Arun!!!!!
well i havnt implemented it on hardware yet and was trying to simulate on proteus.
I wasnt getting anything on LCD
//you haven't provided Vcc supply to the micro, you have used battery supply, the micro's power supply pins i,e Vcc and GND will be hidden and simulator connects them to supply while it is running.
//
what should i do with pin no 31 then?
//in the lcd you should use a 10k pot between VCC, VSS and VEE for contrast control
//
Can you provide me any example of the above statement......i m confused
thnx
bilal
well i havnt implemented it on hardware yet and was trying to simulate on proteus.
I wasnt getting anything on LCD
//you haven't provided Vcc supply to the micro, you have used battery supply, the micro's power supply pins i,e Vcc and GND will be hidden and simulator connects them to supply while it is running.
//
what should i do with pin no 31 then?
//in the lcd you should use a 10k pot between VCC, VSS and VEE for contrast control
//
Can you provide me any example of the above statement......i m confused
thnx
bilal
Arun Kumar V
Jul 10 2008, 1:58 AM
Hello shah,
here's how i connect a serial ADC0831, 8051,16X2 LCD in proteus :
Arun
you haven't provided Vcc supply to the micro, you have used battery supply, the micro's power supply pins i,e Vcc and GND will be hidden and simulator connects them to supply while it is running.
what should i do with pin no 31 then?
in the lcd you should use a 10k pot between VCC, VSS and VEE for contrast control
here's how i connect a serial ADC0831, 8051,16X2 LCD in proteus :
Arun
Afnan
Nov 28 2008, 8:45 PM
SIR I AM NEW TO THIS WEB BUT I HAVE BEEN WORKING ON BIOMEDICAL PREOJCT>NOW I WANT TO WORK ON BLOODPRESSURE MNONITOR FOR that i have to use ADC0831.Isthis code is ok .nd i would like to get help so please help.
Afnan
Nov 28 2008, 8:51 PM
Can u give the code that is being displayed in the picture of proteus
Ajay
Nov 29 2008, 12:32 AM
Cant see anything... Please create a new thread..
Afnan
Nov 30 2008, 11:02 PM
Sir arun i need the code that is being displayed in above picture.i am unable to write the code to interface adc0831 in c.my code dislays only 0 and 1 when ever the pot connected to V(+) is varied