COA Tutorial

Computer Organization and Architecture Tutorial Basic Terminologies Related to COA Digital Number System Computer Organization and Architecture Data Formats Fixed and Floating-Point Number IEEE Standard 754 Floating Point Numbers Control Unit Organization Data Path, ALU and Control Unit Micro-Operations CPU Registers Addressing Modes COA: Interrupt and its types Instruction Cycle: Computer Organization and Architecture Instruction Pipelining and Pipeline Hazards Pipelining: Computer Organization and Architecture Machine Instructions 8085 instructions set 8085 Pin Configuration Addressing mode in 8085 microprocessor Advantages and Disadvantages of Flash Memory BCD to 7 Segment Decoder Biconnectivity in a Graph Bipartite Graph CarryLook Ahead Adder Control Signals in 8155 Microprocessor Convert a number from base 2 to base 6 Ethernet Frame Format Local Broadcast Address and loopback address Microprocessor classification Use Case Diagram for the online bank system 8086 Microprocessor Pin Configurations 8255 Microprocessor Operating Modes Flag Register of 8086 Microprocessor Data Transfer and Manipulation 8085 Arithmetic Instructions Assembly Language Register What is Cache Associativity? Auxiliary Memory in COA Associative Memory in Computer Architecture SCSI Bus in Computer Architecture What are Registers in Microprocessor What is Associative Memory 1 Persistent CSMA What is Floating-Point Representation in Computer Architecture? What is a Serial Port in a Computer? What is Cluster Computing What is Batch Processing in Computer Advantages of Client Server Architecture Spooling Meaning in Computer System Magnetic Core Memory Magnetic Ink Card Reader Decision Making Tools and Techniques Digital Electronics using Semiconductor Memory What is Internal Chip Organization in Computer Architecture? What is Hardwired Control Unit? Definition of Diodes in Electronics Advantages of FSK Web Server Architecture How the OS interfaces between the user, apps, hardware? Discuss the I/O Interface in Computer Architecture Difference between Internal Fragmentation and External Fragmentation MDR in Computer Architecture What is ESS? What is Gray code What is Parity Check? Firewall in E-Commerce Fragmentation in Computer Diskette Controller Handshaking in Computer Architecture

Interfacing DAC with the 8051 Microcontroller

A wide range of applications calls for microcontrollers, including measuring and controlling physical quantities like temperature, pressure, speed, and distance.

In these systems, the microcontroller creates digital output, but the controlling system only accepts analogue signals, necessitating the usage of DACs, which can translate digital data into a corresponding analogue voltage.

A typical device for converting pulses to analogue signals is the digital to analogue converter (DAC). Analogue signals can be created from digital signals using two different techniques, which are the binary-weighted approach and the R/2R ladder method.

The MC1408 (DAC0808) Digital to Analog Converter will be used in this article. This chip employs the R/2R ladder technique. This approach is capable of far greater precision. By its resolution, DACs are evaluated.

The quantity of binary inputs affects resolution. The most frequent numbers of inputs are 8, 10, 12, etc. The number of information determines the DAC's resolution. As a result, there are 2n analogue levels for every n digital input pins. Two hundred fifty-six(256) distinct voltage levels are available in an 8-input DAC.

The MC1408 DAC (or DAC0808)

The digital inputs are transformed into the current in this chip. By attaching a resistor to the output to change the current into voltage, Iout, the output current is identified. The reference current Iref and the binary integers at DAC0808's input pins D0 through D7, where D0 is the LSB and D7 is the MSB, essentially determine the total current given by the Iout pin. The role of  Iout is demonstrated in the following formula.

Iout =   Iref  (D7/2 +D6/4 +D5/8 +D4/16 +D3/32+D2/64+D1/128+D0/256)

The input current is Iref. Pin 14 must be attached to this. Iref is often used as 2.0 mA.

We attach the Iout pin to the resistor to convert the current to voltage. However, as the input resistance of the load would also influence the output voltage in practice, it can lead to inaccuracies. As a result, the Iref current input is essentially isolated by coupling it to an Op-Amp with a 5K=Rf feedback resistor. You can adjust the feedback resistor's value to suit your needs.

Sine Wave generation with DAC and an 8051 microcontroller

We first need a look-up database to describe the magnitude of the sinusoidal value of an angle between 0° and 360° to generate sine waves. From -1 to +1, the sine function is variable. Only integer values are usable for DAC input in the table. In this example, we'll determine the values from degree to DAC input in steps of 30 degrees. For the DAC output, a full-scale voltage of 10V is assumed. The voltage ranges can be calculated using this formula.

Vout = 5V + (5 ×sinθ)
Angle (in θ )sinθVout (Voltage Magnitude)Values sent to DAC
005128
300.57.5192
600.8669.33238
901.010255
1200.8669.33238
1500.57.5192
18005128
210-0.52.564
240-0.8660.66917
270-1.000
300-0.8660.66917
330-0.52.564
36005128
Interfacing DAC with the 8051 Microcontroller

SOURCE CODE

#include<reg51.h>
sfr DAC = 0x80; //Port P0 address
void main(){
   int sin_value[12] = {128,192,238,255,238,192,128,64,17,0,17,64};
   int i;
   while(1){
      //infinite loop for LED blinking
      for(i = 0; i<12; i++){
         DAC = sin_value[i];
      }
   }
}
Interfacing DAC with the 8051 Microcontroller