Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Converter - Embedded System Design - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Embedded System Design which includes Hardware Design, Elevator Controller, Simple Elevator Controller, Try Capturing, Unit Control, Request Resolver, Sequential Program Model, Partial English Description, System Interface etc. Key important points are: Converter, Equations, Outputs, Analog Value, Large Currents, Appropriate Values, Construct Circuit, Connect Circuit, Verify and Document, Outine Delay

Typology: Slides

2012/2013

Uploaded on 03/22/2013

dhritiman
dhritiman 🇮🇳

4.7

(6)

107 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
1
Lab 4: D/A Converter
2
1000
Lab 4: D/A Converter
This is a simple resistive network for a D/A converter
Port 1, Port 0 are digital inputs ==> 00 (minimum), 01,
10, 11 (maximum)
You need to design the resistive network to generate
proper outputs.
For ECE5430 students, a four-bit D/A with an Op-amp is
recommended.
1000 ohms
3
Lab4: D/A Converter
ATMEGA16
PB1
PB0
ADC0
(PA0)
VTG
RXD
TXD
To Computer Serial Port AREF
STK500
357
833
1000 R1
R2
R3 VA
STK500 reads the analog value from VA using ADC channel 0 4
Lab 4: D/A Converter
Equations for D/A Outputs:
B’00: 0.0 VS = (R1 || R2 || R3 ) * (0 Volts)
B’01: 0.3 VS = (R1 || R3 ) * (5 volts) / ((R1 || R3 ) +
R2 )
B’10: 0.7 VS = (R1 || R2 ) * (5 volts) / ((R1 || R2 ) +
R3 )
B’11: 1.0 VS = R1 * (5 volts) / ((R2 || R3 ) + R1 )
Given: VS = 4 Volts, R1 = 1000
Find R2 and R3 by solving 2 equations with 2 variables
using the equations for B’01 and B’11.
Here we choose R1 = 1000 ohms.
You can choose any proper value you want for R1.
If R1 is too small, it may require large currents resulting in
overheat problem.
Docsity.com
pf3
pf4

Partial preview of the text

Download Converter - Embedded System Design - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

1

Lab 4: D/A Converter

2

1000

Lab 4: D/A Converter

This is a simple resistive network for a D/A converterPort 1, Port 0 are digital inputs ==> 00 (minimum), 01,10, 11 (maximum)You need to design the resistive network to generateproper outputs.For ECE5430 students, a four-bit D/A with an Op-amp isrecommended.

1000 ohms

3

Lab4: D/A Converter

ATMEGA

PB1 PB0 ADC0(PA0)

VTG

RXDTXD

To Computer Serial Port

AREF

STK

357 833 1000

R

R3^ R

VA

STK500 reads the analog value from VA using ADC channel 0

4

Lab 4: D/A Converter

•^

Equations for D/A Outputs:

-^

B’00:

0.0 VS = (R1 || R2 || R3 ) * (0 Volts)

•^

B’01:

0.3 VS = (R1 || R3 ) * (5 volts) / ((R1 || R3 ) +R2 )

•^

B’10:

0.7 VS = (R1 || R2 ) * (5 volts) / ((R1 || R2 ) +R3 )

•^

B’11:

1.0 VS = R1 * (5 volts) / ((R2 || R3 ) + R1 )

•^

Given: VS = 4 Volts, R1 = 1000

-^

Find R2 and R3 by solving 2 equations with 2 variablesusing the equations for B’01 and B’11.

Here we choose R1 = 1000 ohms.You can choose any proper value you want for R1.If R1 is too small, it may require large currents resulting inoverheat problem.

Docsity.com

5

Lab 4: D/A Converter

Theoretical vs Actual DAC

5.04.5 4.03.53.0 2.52.01.5 1.00.5 0.

0

1

2

3

4

Binary Output

DAC Output (V)

Theoretical DACActual DAC

6

Lab 4: D/A Converter

5.000V

5.000V

0V

0V

R2 833

1.200V 0V

R5 833

R11k 2.800V

R3 357

B'

V 5Vdc

R9 357

0V^0

0

B'

V 5Vdc

0

R12 357

0

0V R71k

R6 357 R11 833

B'

0 0

R8 833

B'

R41k 4.000V 0

0

V 5Vdc

R101k

7

Lab 4: D/A Converter

•^

In-Lab Tasks

-^

Construct Circuit 4-1 with appropriate values ofresistance. Do NOT connect Circuit 4-1 to the AVR mcu.

-^

Given your computed values of R2 and R3, verify thevoltage of VA for the four possible port values.

-^

Connect Circuit to the AVR mcu.

-^

Write software for the AVR mcu that sets analogvoltages at VA. Have the software loop through thevoltages from 0.0VS, 0.30VS, xVS, , .. ,1.0VS and stepback down to 0.0VS. Include a delay between eachvalue. Use the C-routine delay_ms() in <delay.h> togenerate the delay.

-^

Verify and document the resulting voltages of VA.

8

Lab 4: D/A Converter

Initialize peripherals in ATMEGA

μP:

•Port x : Output to LED’s • Port x : DAC output on pins 0 & 1 • Port D : UART on pins 0 & 1 • UART : 9600 baud, 8-N-

Display opening marqueeStart counter at 0

Start

Port x = counter (to DAC)Port x = ~ counter (to LED’s)Increment counter so it runs: 1, 2, 3, 4, 1, 2 …Delay 2.5 seconds for voltage measurement

Sample of Software flowchart

Docsity.com

13

Lab 4: D/A Converter

-^

while (1)

-^

{

-^

// Loop from b00, b01, b10, b11.

-^

for( i = 0; i < 4; i++ )

-^

{

-^

// Change to the next D to A step.

-^

PORTB = i;

-^

// Delay for 2 seconds

-^

delay_ms( 2000 );

  • •^

// Print the voltage to the screen.

-^

value = read_adc( 0x0 );

-^

voltage = value * 5 / 1023;

-^

??????

-^

??????

14

Lab 4: D/A Converter

• Terminal need to display:

  • Binary Output (first column)– ADC Reading (second column)– Voltmeter Reading (third column) 00

0.00 Volts

0.0012 Volts

01

1.20 Volts

1.194 Volts

10

2.75 Volts

2.710 Volts

11

3.96 Volts

3.906 Volts

Docsity.com