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 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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top