22.07.2014 Views

to get the file - OCW UPM

to get the file - OCW UPM

to get the file - OCW UPM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

unsigned char tic_1s;<br />

void main (void)<br />

{<br />

tic_1s = 0;<br />

IniciaRecursos();<br />

while (1)<br />

{<br />

if (tic_1s)<br />

{<br />

LeerVariables();<br />

GuardarVariables();<br />

GenerarPWM0();<br />

GenerarPWM1();<br />

GenerarPWM2();<br />

tic_1s = 0;<br />

}<br />

}<br />

}<br />

Teniendo en cuenta <strong>to</strong>do lo expues<strong>to</strong> responda a las cuestiones que se plantean.<br />

Nota: En <strong>to</strong>dos los apartados en los que escriba código, éste deberá ir suficientemente<br />

comentado.<br />

a) Indique qué recursos del microcontrolador va a utilizar para cada una de los cometidos<br />

propues<strong>to</strong>s, teniendo en cuenta que el sistema sólo utilizará una interrupción, la<br />

correspondiente al Timer 0, que se encarga de temporizar un segundo y que la<br />

frecuencia del PWM2 es de 14 Hz. aproximadamente.<br />

b) Dibuje sobre la figura 2 las conexiones necesarias para poder conseguir el sistema<br />

propues<strong>to</strong> en la figura 1 y justifique como conectará la tensión de referencia.<br />

Figura 2<br />

20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!