-->

ADC Interfacing 0804 (with 8051)

By
ADC Interfacing 0804  (with 8051)
Download here the datasheet download 

The easiest way to do analog to digital conversion is to use an IC such as the ADC0804 that does the work for you. The analog voltage is applied to pin 6 and the result is available at pins 11 through 18. We will connect pin 1 and 2 (Chip Select and Read) to ground so that the chip is always enabled. (If you wanted to use more than one ADC you could use this pin to control which chip is currently enabled). 
Connect pin 7 (Vin - ) to ground. The ADC0804 includes an internal oscillator which requires an external capacitor and resistor to operate. Connect the 150 pF capacitor from pin 4 (CLOCK IN) to ground and the 10k ohm resistor from pin 4 to pin 19 (CLOCK R).

ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a single channel IC, i.e., it can take only one analog signal as input. The digital outputs vary from 0 to a maximum of 255. The step size can be adjusted by setting the reference voltage at pin9. When this pin is not connected, the default reference voltage is the operating voltage, i.e., Vcc. The step size at 5V is 19.53mV (5V/255), i.e., for every 19.53mV rise in the analog input, the output varies by 1 unit. To set a particular voltage level as the reference value, this pin is connected to half the voltage. For example, to set a reference of 4V (Vref), pin9 is connected to 2V (Vref/2), thereby reducing the step size to 15.62mV (4V/255). 
For getting More information Look Here


Interfacing adc

Circuits

Code 
#include <REGX51.H>
#define output P2
sbit wr = P1 ^ 1;
sbit rd = P1 ^ 0;
sbit intr = P1 ^ 2;
void delay(unsigned int msec)
{
int i, j;
for (i = 0; i < msec; i++)
for (j = 0; j < 1275; j++);
}
 
 
void adc()
{
rd = 1;
wr = 0;
delay(1);
wr = 1;
while (intr == 1);
rd = 0;
delay(1);
intr = 1;
}
 
 
void main()
{
while (1) {
 
adc();
{
delay(100);
}
}
}
 

ADC Interfacing 0804 (with 8051)

By
ADC Interfacing 0804  (with 8051)
Download here the datasheet download 

The easiest way to do analog to digital conversion is to use an IC such as the ADC0804 that does the work for you. The analog voltage is applied to pin 6 and the result is available at pins 11 through 18. We will connect pin 1 and 2 (Chip Select and Read) to ground so that the chip is always enabled. (If you wanted to use more than one ADC you could use this pin to control which chip is currently enabled). 
Connect pin 7 (Vin - ) to ground. The ADC0804 includes an internal oscillator which requires an external capacitor and resistor to operate. Connect the 150 pF capacitor from pin 4 (CLOCK IN) to ground and the 10k ohm resistor from pin 4 to pin 19 (CLOCK R).

ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a single channel IC, i.e., it can take only one analog signal as input. The digital outputs vary from 0 to a maximum of 255. The step size can be adjusted by setting the reference voltage at pin9. When this pin is not connected, the default reference voltage is the operating voltage, i.e., Vcc. The step size at 5V is 19.53mV (5V/255), i.e., for every 19.53mV rise in the analog input, the output varies by 1 unit. To set a particular voltage level as the reference value, this pin is connected to half the voltage. For example, to set a reference of 4V (Vref), pin9 is connected to 2V (Vref/2), thereby reducing the step size to 15.62mV (4V/255). 
For getting More information Look Here


Interfacing adc

Circuits

Code 
#include <REGX51.H>
#define output P2
sbit wr = P1 ^ 1;
sbit rd = P1 ^ 0;
sbit intr = P1 ^ 2;
void delay(unsigned int msec)
{
int i, j;
for (i = 0; i < msec; i++)
for (j = 0; j < 1275; j++);
}
 
 
void adc()
{
rd = 1;
wr = 0;
delay(1);
wr = 1;
while (intr == 1);
rd = 0;
delay(1);
intr = 1;
}
 
 
void main()
{
while (1) {
 
adc();
{
delay(100);
}
}
}
 

8-Bit Mode LCD interfacing with 8051

By
8-Bit Mode LCD interfacing with 8051

As discussed in the previous section look here ]  ,here providing the circuits diagram and the code including Proteus simulation file .
Controller - Atmel 89s52
Copmiler   - Keil U-Version4
Simulator - Proteus 7.6 
Author  - Gireesh Kumar K.S
Email   - thannara123@gamil,com
Mob     - 9447825107


C- Code for 89S52

#include <REGX51.H>
sfr lcd_dat = 0xA0;
sbit rs = P3 ^ 0; //register select pin
sbit en = P3 ^ 1; //enable pin
 
 
void delay(unsigned int msec)
{
int i, j;
for (i = 0; i < msec; i++)
for (j = 0; j < 1275; j++);
}
 
void lcd_strobe()
{
en = 1;
delay(1);
en = 0;
}
 
void lcdcmd(unsigned char gk)
{
lcd_dat = gk;
rs = 0;
lcd_strobe();
}
 
void lcd_Ini()
{
lcdcmd(0x38);
delay(30);
lcdcmd(0x0c);
delay(10);
lcdcmd(0x06);
delay(10);
lcdcmd(0x01);
delay(10);
 
}
 
void lcd_data(unsigned char gk)
{
lcd_dat = gk;
rs = 1;
lcd_strobe();
}
 
void string(const char *q)
{
while (*q) {
lcd_data(*q++);
}
}
 
void main()
{
P2 = 0x00;
P3 = 0x00;
 
 
lcd_ini();
string("Hello world ");
lcdcmd(0xc0);
string("Testing "); // test display
lcdcmd(0xc9);
 
lcd_data(58); // direct entry display
 
while (1) {
} // for endeless  
 
}



Download here the full project including Proteus file
Download



8-Bit Mode LCD interfacing with 8051

By
8-Bit Mode LCD interfacing with 8051

As discussed in the previous section look here ]  ,here providing the circuits diagram and the code including Proteus simulation file .
Controller - Atmel 89s52
Copmiler   - Keil U-Version4
Simulator - Proteus 7.6 
Author  - Gireesh Kumar K.S
Email   - thannara123@gamil,com
Mob     - 9447825107


C- Code for 89S52

#include <REGX51.H>
sfr lcd_dat = 0xA0;
sbit rs = P3 ^ 0; //register select pin
sbit en = P3 ^ 1; //enable pin
 
 
void delay(unsigned int msec)
{
int i, j;
for (i = 0; i < msec; i++)
for (j = 0; j < 1275; j++);
}
 
void lcd_strobe()
{
en = 1;
delay(1);
en = 0;
}
 
void lcdcmd(unsigned char gk)
{
lcd_dat = gk;
rs = 0;
lcd_strobe();
}
 
void lcd_Ini()
{
lcdcmd(0x38);
delay(30);
lcdcmd(0x0c);
delay(10);
lcdcmd(0x06);
delay(10);
lcdcmd(0x01);
delay(10);
 
}
 
void lcd_data(unsigned char gk)
{
lcd_dat = gk;
rs = 1;
lcd_strobe();
}
 
void string(const char *q)
{
while (*q) {
lcd_data(*q++);
}
}
 
void main()
{
P2 = 0x00;
P3 = 0x00;
 
 
lcd_ini();
string("Hello world ");
lcdcmd(0xc0);
string("Testing "); // test display
lcdcmd(0xc9);
 
lcd_data(58); // direct entry display
 
while (1) {
} // for endeless  
 
}



Download here the full project including Proteus file
Download



More Posts

gElectron. Powered by Blogger.

Contributors

16x2 LCD Interfacing with STM32,STM32F103C6

 16x2 LCD  Interfacing with STM32,STM32F103C6 lcd_init(); LCD_LINE1; lcd_String(" GeElectron"); LCD_LINE2; lc...

Contact Form

Name

Email *

Message *

Contact us

Name

Email *

Message *

Follow Us

https://www.facebook.com/gElectron-393939667321867/ FBbox/https://www.facebook.com/IVYthemes

Comments

[blogger]

MKRdezign

Test

Latest

[recent][newsticker]

Technology

Top Ads

RECENT COMMENTS

Subscribe Via Email

Subscribe to our newsletter to get the latest updates to your inbox. ;-)


Your email address is safe with us!

RECENT COMMENTS