how to interface dac0800 with 8051

Status
Not open for further replies.

srivatsava

Newbie level 1
Joined
Oct 16, 2007
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
how to use dac0800 with microcontroller

hi i want to interface dac0800 with 8051
 

dac0800 interface with 8051

hi
#include "REG52.H"
sbit INT = P3^3;
sbit RW = P3^2; //edge L->H (canh len) cho phep analog signal vao ADC _bat dau chuyen doi//allow analog input
sbit READ = P3^1;//doc data tu ADC0804 edge H->L (tac dong canh xuong)// read data convertion
sbit CS = P3^0;//chipselect

void delay(unsigned char i);
//+++++++++++++++++++++++++

void main(void)
{
IE=0x84;//cho phep ngat ngoai 1 o chan P3.3//enable interrupt
IT1=1;//fall edge int cho phep ngat canh xuong
P0=0xFF;
P2=0xFF;
P3=0xFF;
//cho phep ADC hoat dong
CS=0;
//RW tac dong canh len => bat dau cuyen doi
//start convert
RW=0;
RW=1;


while(1);
}
//============interupt================
void ADC_READY(void) interrupt 2
{unsigned char temp;
EX1=0;//cam ngat ngoài 1
//Read tac dong canh xuong cho phep doc digital
READ=1;
READ=0;
temp=P2;
P0=temp;
EX1=1;//cho phep ngat
//bat dau chuyen doi
RW=0;
RW=1;
}

// ==========sub================
void delay(unsigned char i)
{
while(i--)
{ unsigned char k=121;
while(k--);
}
}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…