free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Rickey's World :: Discussion Forums :: Project Development :: Project Help
 
<< Previous thread | Next thread >>
Lead compensator for 8051
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
shawn
Thu Jan 28 2010, 02:18PM
 User Offline
Registered Member #4312
Joined: Sun Oct 07 2007, 11:48PM

Posts: 22
Thanked 0 times in 0 posts
Hi,
I'm trying to implement a digital design of a lead compensator (s+1)/(s+10) using the 8051 microprocessor AT89C51RD2. I have the hardware and most of the conversion and only have an idea of the steps, but don't know how I can implement it with 8051. Any help would be greatly appreciated. Also,
1) For the ADC0804LCN chip, does anyone know if Vcc (pin 20) can be attached to 9V instead of 5V?
2) For the DAC0800 chip, if my output is going into an op-amp, do I just short V- (pin 3) directly to ground and V+ (pin 13) to the input of op-amp?
Thank you,

code:
// Lead compensator (s+1)/(s+10)
#include <REGX51.H>
#define adc_port P2 //ADC Port
#define rd P3_0 //Read signal P1.0
#define wr P3_1 //Write signal P1.1
#define cs P3_2 //Chip Select P1.2
#define intr P3_3 //INTR signal P1.3
//-------------------- Global variables -----------------------------------------
unsigned char e = 0; // array for the error signal
unsigned int c = 0; // array for the compensated signal
unsigned char input = 0;
void conv(); //Start of conversion function
void read(); //Read ADC function

unsigned char adc_val;

void main() {
while(1){ //Forever loop
conv(); //Start conversion
read(); //Read ADC

// Compensator


P1 = c; //Move compensated signal to D/A

}
}
//ADC Code
void conv() {
cs = 0; //Make CS low
wr = 0; //Make WR low
wr = 1; //Make WR high
cs = 1; //Make CS high
while(intr); //Wait for INTR (P1.3) to go low
}

void read() {
cs = 0; //Make CS low
rd = 0; //Make RD low
input=adc_port;
e=adc_port; //Read as feedback
rd = 1; //Make RD high
cs = 1; //Make CS high
}
circuit.pdf

Back to top

 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems