Download Examen de control

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mains electricity wikipedia , lookup

Rectifier wikipedia , lookup

Transmission line loudspeaker wikipedia , lookup

Buck converter wikipedia , lookup

Islanding wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Regenerative circuit wikipedia , lookup

Power inverter wikipedia , lookup

Tektronix analog oscilloscopes wikipedia , lookup

Chirp spectrum wikipedia , lookup

Heterodyne wikipedia , lookup

Power electronics wikipedia , lookup

Rectiverter wikipedia , lookup

Opto-isolator wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Transcript
E. T. TELECOMUNICACIONS
2AT4
-
Sistemes Electrònics Digitals
Profs. Francesc J. Sànchez / Josep Conesa
19/12/2006
Control de mínims.
Consultes sobre l’examen:
Publicació de les qualificacions: 27 de desembre
Francesc: DT: 15:00 – 17:00; DV: 11:00 – 12:00, 16:00-19:00
Josep: DT: 15:00-17:00; 19:00-21:00; DC: 15:00-17:00
Mínim 5
Task description
We want to design a function generator to produce sinusoidal, triangular and TTL
waveforms programming a PIC16F84A in assembler and using additional external
interface circuitry. Fig. 1 shows the proposal which includes a 8-bit digital to analogue
converter (see a commercial device type DAC08) to produce the desired outputs. The
VREF block produces stabilized reference voltages of 5.00 V and 2.50 V. The AMP
block subtracts the DC level VREF/2 from the DAC output to generate a bipolar signal.
RESET
8-BIT DAC(VOUT)
V=0
MICROCONTROLLER
AMP(Vout)
V=-2.4988
MCLR_L
AMP
8-BIT DAC
TRI
TTL
SIN
D0
D1
D2
D3
D4
D5
D6
D7
TRI
TTL
D0
D1
D2
D3
D4
D5
D6
D7
LE
SIN
VOUT
VREF+
VREF-
Vin
Vout
VREF
AMPL
DAC_8
VCC
V=5
U-D_L
FREQ
VREF
U-D_L
VR1
V=5.00102
VREF(VR1)
V=2.50042
VREF(VR2)
VCC
VR2
FREQ
VREF
PIC_CIRCUIT
Fig. 1 Function generator to be designed
Top-down design steps
The analogue interface circuitry
1- Explain the function of the DAC08 and the analogue output circuit. Deduce the output
voltage equation and justify the value of the resistors of the circuit represented in Fig. 2.
Explain the circuit of the voltage reference in Fig. 3 and gather the function of the output
OPAMP’s.
R10
R9
VREF
50k
50k
VP
4
Vn
VN
U4
2
VN
V=-9
6
3
Vout
AD8631AS
7
VP
V=9
Vin
R12
50k
Vp
R11
50k
Fig. 2 Internal structure of the proposed output amplifier
Vp
AD8631AS: rail to rail Op Amp
Vp
R13
7
3
RV1
Vn
4
97%
D5
VR2
6
2
10k
560
VR2
V=2.50042
U2
AD8631AS
BZX284C2V5
R15
R14
10k
10k
Vp
7
VR1
V=5.00102
VP
VN
U3
3
6
VN
V=-9
VR1
2
AD8631AS
Vn
4
VP
V=9
Fig. 3 Internal structure of the dual voltage reference circuit
The microcontroller
2- Explain the main characteristics of the proposed PIC circuit in Fig. 4 and how the ports
have to be programmed. How many instructions can the PIC execute per second?
X1
C7
C6
10p
10p
U1
4MHz
16
15
4
MCLR_L
OSC1/CLKIN
OSC2/CLKOUT
MCLR
R6
4.7k
VCC
RA0
RA1
RA2
RA3
RA4/T0CKI
RB0/INT
RB1
RB2
RB3
RB4
RB5
RB6
RB7
C5
100nF
R7
10k
17
18
1
2
3
6
7
8
9
10
11
12
13
D0
D1
D2
D3
D4
D5
D6
D7
PIC16F84A
FREQ
U-D_L
TRI
TTL
SIN
Fig. 4 Connecting the PIC microcontroller
The internal EEPROM peripheral
3- The sinusoidal waveform will be stored in the internal PIC 64 byte EEPROM. Search in
books and datasheets the main characteristics of that peripheral and explain through
which registers is programmed and accessed in the read and write cycles.
4- Deduce the value of the 64 8-bit waveform samples that will be stored in the EEPROM
to generate the sinusoidal signal of 5 V range. Use a spreadsheet to produce the values
as in the attached file “SED_Funct_gen_sinusoidal.xls”. How will the waveform period
and frequency be calculated? How can the waveform frequency be adjusted?
The linear and TTL waves
5- Explain the way the linear triangular waveform will be produced and why the EEPROM
is not needed. Answer the same question for the TTL signal. Explain the differences if
the waveforms are produced using only 64 points or the whole range of 255 points.
6- How can be synthesized a pulse width modulated (PWM) TTL signal with a duty cycle
(DC) ranging from 1% to 99%?
D[7..0]
7- Which way can be even more effective to store different waveforms or data permanently
in memory and without having the EEPROM restriction of 64 bytes? How can be stored
and retrieved data blocks in program memory?
Programming the application in assembler
8- Assume the EEPROM has been written previously in the programming process, so that
when the main program starts after a reset (MCLR_L) the EEPROM is already loaded.
Propose the flux diagram for the main assembler program that will configure the ports
and control the waveform selection pushbuttons. Write the assembler code. Use an
initial sample MPLAB project and the Proteus-VSM initial project for starting the
software development (look at the web page where this task is posted).
Fig. 5 Flux diagram for the main program
9- Use the MPLAB and the virtual laboratory Proteus-VSM to simulate and verify your
designs. Repeat this step after each one of the following sections to build a robust and
error free code.
10- Propose the flux diagram and write de code for the sinusoidal subroutine.
11- Explain how to produce a TS delay. Propose the flux diagram and write de code of the
subroutine.
12- Propose the flux diagram and write de code for the triangular subroutine
13- Propose the flux diagram and write de code for the TTL subroutine
Programming the waveform frequency
14- How can be adjusted the frequency of the output signals using simply a pair of
pushbuttons? Perhaps using the TIMER0 peripheral?
15- Can be replaced the Ts delay routines by the TIMER0? Can be improved the design
using interruptions?
Take this task description as an example of
how can you
organize
application project
and
develop your