Attachment 'capitulo1d.sgml'

Download

        <sect1 id="pinio" xreflabel="pinio">
                <title>M&oacute;dulo IO y manipulaci&oacute;n de pines</title>
                <para> Muestra las funciones para poder trabajar con los pines del PIC.</para>  
                <para>
                <screen>
        #include &lt;pinio.h&gt;
                </screen>
                </para>

                <sect2 id="outputhighslow" xreflabel="output_high_slow">
                <title>output_high_slow</title>
                <para>
                        Establece un PIN a un estado alto de voltaje. Verifica el estado del <keycap>tris</keycap>.
                </para>
                <screen>
        void output_high_slow(  BYTE puerto, 
                                BYTE pin);
        ejemplo:
        output_high_slow(PIN_B0);

                </screen>
                </sect2>

                <sect2 id="outputhighfast" xreflabel="output_high_fast">
                <title>output_high_fast</title>
                <para>
                        Establece un PIN a un estado alto de voltaje. No verifica el estado del <keycap>tris</keycap>.
                </para>
                <screen>
        void output_high_fast(  BYTE puerto, 
                                BYTE pin);
        ejemplo:
        output_high_fast(PIN_B0);

                </screen>
                </sect2>

                <sect2 id="outputhigh" xreflabel="output_high">
                <title>output_high</title>
                <para>
                        Establece un PIN a un estado alto de voltaje. La verificaci&oacute;n del estado del <keycap>tris</keycap> depende de habilitar el macro SLOW_IO como TRUE o FALSE.
                </para>
                <para>
                        Por defecto, si no se escribe <keycap>#define SLOW_IO TRUE</keycap> , SLOW_IO tiene el valor de TRUE.
                </para>
                <screen>
        #define SLOW_IO TRUE

        void output_high(       BYTE puerto, 
                                BYTE pin);
        ejemplo:
        output_high(PIN_B0);

                </screen>
                </sect2>

                <sect2 id="outputlowslow" xreflabel="output_low_slow">
                <title>output_low_slow</title>
                <para>
                        Establece un PIN a un estado bajo de voltaje. Verifica el estado del <keycap>tris</keycap>.
                </para>
                <screen>
        void output_low_slow(   BYTE puerto, 
                                BYTE pin);
        ejemplo:
        output_low_slow(PIN_B0);

                </screen>
                </sect2>

                <sect2 id="outputlowfast" xreflabel="output_low_fast">
                <title>output_low_fast</title>
                <para>
                        Establece un PIN a un estado bajo de voltaje. No verifica el estado del <keycap>tris</keycap>.
                </para>
                <screen>
        void output_low_fast(   BYTE puerto, 
                                BYTE pin);
        ejemplo:
        output_low_fast(PIN_B0);

                </screen>
                </sect2>

                <sect2 id="outputlow" xreflabel="output_low">
                <title>output_low</title>
                <para>
                        Establece un PIN a un estado bajo de voltaje. La verificaci&oacute;n del estado del <keycap>tris</keycap> depende de habilitar el macro SLOW_IO como TRUE o FALSE.
                </para>
                <para>
                        Por defecto, si no se escribe <keycap>#define SLOW_IO TRUE</keycap> , SLOW_IO tiene el valor de TRUE.
                </para>
                <screen>
        #define SLOW_IO TRUE

        void output_low(        BYTE puerto, 
                                BYTE pin);
        ejemplo:
        output_low(PIN_B0);

                </screen>
                </sect2>

                <sect2 id="inputslow" xreflabel="input_slow">
                <title>input_slow</title>
                <para>
                        Devuelve el estado de un pin. puede ser <keycap>1</keycap> o <keycap>0</keycap>. Verifica el estado del <keycap>tris</keycap>.
                </para>
                <screen>
        BYTE input_slow(        BYTE puerto, 
                                BYTE pin);
        ejemplo:
        input_slow(PIN_B1);

                </screen>
                </sect2>

                <sect2 id="inputfast" xreflabel="input_fast">
                <title>input_fast</title>
                <para>
                        Devuelve el estado de un pin. puede ser <keycap>1</keycap> o <keycap>0</keycap>. No verifica el estado del <keycap>tris</keycap>.
                </para>
                <screen>
        BYTE input_fast(        BYTE puerto, 
                                BYTE pin);
        ejemplo:
        input_fast(PIN_B1);

                </screen>
                </sect2>

                <sect2 id="input" xreflabel="input">
                <title>input</title>
                <para>
                        Devuelve el estado de un pin. puede ser <keycap>1</keycap> o <keycap>0</keycap>. La verificaci&oacute;n del estado del <keycap>tris</keycap> depende de habilitar el macro SLOW_IO como TRUE o FALSE.
                </para>
                <para>
                        Por defecto, si no se escribe <keycap>#define SLOW_IO TRUE</keycap> , SLOW_IO tiene el valor de TRUE.
                </para>
                <screen>
        #define SLOW_IO TRUE

        BYTE input(     BYTE puerto, 
                        BYTE pin);
        ejemplo:
        input(PIN_B1);

                </screen>
                </sect2>

                <sect2 id="setpintoslow" xreflabel="set_pin_to_slow">
                <title>set_pin_to_slow</title>
                <para>Establece el estado de un pin a <keycap>1</keycap> o <keycap>0</keycap>. Verifica el estado del <keycap>tris</keycap>.</para>
                <screen>
        void set_pin_to_slow(   BYTE puerto, 
                                BYTE pin,
                                BYTE X);

        ejemplo:
        set_pin_to_slow(PIN_C1,1);//el pin C1 ahora tiene un estado alto
        set_pin_to_slow(PIN_C1,0);//el pin C1 ahora tiene un estado bajo
                </screen>
                </sect2>

                <sect2 id="setpintofast" xreflabel="set_pin_to_fast">
                <title>set_pin_to_fast</title>
                <para>Establece el estado de un pin a <keycap>1</keycap> o <keycap>0</keycap>. No verifica el estado del <keycap>tris</keycap>.</para>
                <screen>
        void set_pin_to_fast(   BYTE puerto, 
                                BYTE pin,
                                BYTE X);

        ejemplo:
        set_pin_to_fast(PIN_C1,1);//el pin C1 ahora tiene un estado alto
        set_pin_to_fast(PIN_C1,0);//el pin C1 ahora tiene un estado bajo
                </screen>
                </sect2>

                <sect2 id="setpinto" xreflabel="set_pin_to">
                <title>set_pin_to</title>
                <para>
                        Establece el estado de un pin a <keycap>1</keycap> o <keycap>0</keycap>.
                </para> 
                <para>
                        La verificaci&oacute;n del estado del <keycap>tris</keycap> depende de habilitar el macro SLOW_IO como TRUE o FALSE.
                </para>
                <para>
                        Por defecto, si no se escribe <keycap>#define SLOW_IO TRUE</keycap> , SLOW_IO tiene el valor de TRUE.
                </para>
                <screen>
        #define SLOW_IO TRUE

        void set_pin_to(        BYTE puerto, 
                                BYTE pin,
                                BYTE X);

        ejemplo:
        set_pin_to(PIN_C1,1);//el pin C1 ahora tiene un estado alto
        set_pin_to(PIN_C1,0);//el pin C1 ahora tiene un estado bajo
                </screen>
                </sect2>

                <sect2 id="setpintristo" xreflabel="set_pin_tris_to">
                <title>set_pin_tris_to</title>
                <para>Establece el TRIS de un pin a <keycap>1</keycap> o <keycap>0</keycap>.</para>
                <screen>
        void set_pin_tris_to(   BYTE puerto, 
                                BYTE pin,
                                BYTE X);

        ejemplo:
        set_pin_tris_to(PIN_C1,1);//el TRIS C1 ahora tiene un estado alto
        set_pin_tris_to(PIN_C1,0);//el TRIS C1 ahora tiene un estado bajo
                </screen>
                </sect2>

                <sect2 id="setportaasdigital" xreflabel="set_porta_as_digital">
                <title>set_porta_as_digital</title>
                <para>Establece el puerto A como DIGITAL.</para>
                <screen>
        #define set_porta_as_digital() ADCON1=0x06

        ejemplo:
        set_porta_as_digital();
                </screen>
                </sect2>

                <sect2 id="setpullupportb" xreflabel="set_pullup_portb">
                <title>set_pullup_portb</title>
                <para>Habilita o deshabilita las resistencias de pull-up del puerto B.</para>
                <para>Para habilitar    las resistencias de pull-up X= 1 o TRUE.</para>
                <para>Para deshabilitar las resistencias de pull-up X= 0 o FALSE.</para>
                <screen>
        void set_pullup_portb(BYTE X);
                </screen>
                </sect2>

                <sect2 id="ejemplopinio" xreflabel="Ejemplo PinIO">
                <title>Ejemplo de PinIO</title>
                <para>
                Para compilar necesitas los siguientes comandos.
                </para>
                <para>
                <screen>
Ejemplo de compilacion : ./compila.sh ej_pinio 16f877a
                </screen>
                </para>
                <para>
                ej_pinio.c
                </para>
                <screen>
#include &lt;pic/p16f877a.h&gt;

#define FOSC_HZ 20000000

#include &lt;pinio.h&gt;
#include &lt;delayms.h&gt;

int main (void)
{
        delayms(100);

        while(TRUE)
        {
                delayms(50);
                output_high(PIN_C2);
                delayms(50);
                output_low(PIN_C2);

                if(input(PIN_A4)==1) output_high(PIN_B7);
                else                 output_low (PIN_B7); 
        }
        return 0;
}
                </screen>
                </sect2>
        </sect1>

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-03-02 21:07:01, 0.5 KB) [[attachment:GenerarDoc.sh]]
  • [get | view] (2009-03-02 21:49:40, 642.0 KB) [[attachment:GtkPicGccAbout.eps]]
  • [get | view] (2009-03-02 21:50:10, 28.2 KB) [[attachment:GtkPicGccAbout.png]]
  • [get | view] (2009-03-02 21:47:10, 4.9 KB) [[attachment:adc.eps]]
  • [get | view] (2009-03-02 21:47:24, 0.9 KB) [[attachment:adc.png]]
  • [get | view] (2009-03-02 21:00:02, 0.1 KB) [[attachment:capitulo1.sgml]]
  • [get | view] (2009-03-02 21:00:35, 1.7 KB) [[attachment:capitulo1a.sgml]]
  • [get | view] (2009-03-02 21:00:50, 1.7 KB) [[attachment:capitulo1b.sgml]]
  • [get | view] (2009-03-02 21:01:15, 2.8 KB) [[attachment:capitulo1c.sgml]]
  • [get | view] (2009-03-02 21:01:25, 7.0 KB) [[attachment:capitulo1d.sgml]]
  • [get | view] (2009-03-02 21:01:33, 5.0 KB) [[attachment:capitulo1e.sgml]]
  • [get | view] (2009-03-02 21:01:41, 4.9 KB) [[attachment:capitulo1f.sgml]]
  • [get | view] (2009-03-02 21:02:02, 5.7 KB) [[attachment:capitulo1g.sgml]]
  • [get | view] (2009-03-02 21:02:26, 12.8 KB) [[attachment:capitulo1h.sgml]]
  • [get | view] (2009-03-02 21:02:37, 4.4 KB) [[attachment:capitulo1i.sgml]]
  • [get | view] (2009-03-02 21:02:46, 6.3 KB) [[attachment:capitulo1j.sgml]]
  • [get | view] (2009-03-02 21:02:54, 4.3 KB) [[attachment:capitulo1k.sgml]]
  • [get | view] (2009-03-02 21:03:01, 1.6 KB) [[attachment:capitulo1l.sgml]]
  • [get | view] (2009-03-02 21:03:14, 0.2 KB) [[attachment:capitulo2.sgml]]
  • [get | view] (2009-03-02 21:03:32, 2.6 KB) [[attachment:capitulo2a.sgml]]
  • [get | view] (2009-03-02 21:03:44, 2.8 KB) [[attachment:capitulo2b.sgml]]
  • [get | view] (2009-03-02 21:04:00, 22.0 KB) [[attachment:capitulo2c.sgml]]
  • [get | view] (2009-03-02 21:04:22, 0.3 KB) [[attachment:capitulo3.sgml]]
  • [get | view] (2009-03-02 21:04:59, 0.9 KB) [[attachment:capitulo3a.sgml]]
  • [get | view] (2009-03-02 21:05:11, 0.2 KB) [[attachment:capitulo4.sgml]]
  • [get | view] (2009-03-02 21:05:21, 1.4 KB) [[attachment:capitulo4a.sgml]]
  • [get | view] (2009-03-02 21:05:33, 2.7 KB) [[attachment:capitulo4b.sgml]]
  • [get | view] (2009-03-02 21:05:51, 5.6 KB) [[attachment:capitulo4c.sgml]]
  • [get | view] (2009-03-02 21:06:00, 0.2 KB) [[attachment:capitulo5.sgml]]
  • [get | view] (2009-03-02 21:06:20, 9.1 KB) [[attachment:capitulo5a.sgml]]
  • [get | view] (2009-03-02 21:49:04, 5.6 KB) [[attachment:compare.eps]]
  • [get | view] (2009-03-02 21:46:31, 1.1 KB) [[attachment:compare.png]]
  • [get | view] (2009-03-02 21:49:17, 7.6 KB) [[attachment:eeprom.eps]]
  • [get | view] (2009-03-02 21:48:01, 1.2 KB) [[attachment:eeprom.png]]
  • [get | view] (2009-03-02 21:06:33, 0.8 KB) [[attachment:ejemplos.sgml]]
  • [get | view] (2009-03-02 21:06:48, 1.7 KB) [[attachment:faq.sgml]]
  • [get | view] (2009-03-02 21:48:51, 6.3 KB) [[attachment:flash.eps]]
  • [get | view] (2009-03-02 21:50:20, 1.0 KB) [[attachment:flash.png]]
  • [get | view] (2009-03-02 21:50:40, 5.0 KB) [[attachment:i2c.eps]]
  • [get | view] (2009-03-02 21:50:50, 0.9 KB) [[attachment:i2c.png]]
  • [get | view] (2009-03-02 21:50:59, 8.8 KB) [[attachment:interrupt.eps]]
  • [get | view] (2009-03-02 21:51:09, 1.2 KB) [[attachment:interrupt.png]]
  • [get | view] (2009-03-02 21:07:16, 0.6 KB) [[attachment:introduccion.sgml]]
  • [get | view] (2009-03-02 21:07:33, 1.8 KB) [[attachment:introducciona.sgml]]
  • [get | view] (2009-03-02 21:07:43, 1.1 KB) [[attachment:introduccionb.sgml]]
  • [get | view] (2009-03-02 21:08:06, 1.6 KB) [[attachment:introduccionc.sgml]]
  • [get | view] (2009-03-02 21:08:17, 27.5 KB) [[attachment:introducciond.sgml]]
  • [get | view] (2009-03-02 21:08:29, 1.0 KB) [[attachment:introduccione.sgml]]
  • [get | view] (2009-03-02 21:08:42, 64.9 KB) [[attachment:introduccionf.sgml]]
  • [get | view] (2009-03-02 21:51:21, 6.1 KB) [[attachment:pinio.eps]]
  • [get | view] (2009-03-02 21:51:39, 1.0 KB) [[attachment:pinio.png]]
  • [get | view] (2009-03-02 21:51:54, 4.8 KB) [[attachment:pwm.eps]]
  • [get | view] (2009-03-02 21:52:03, 0.9 KB) [[attachment:pwm.png]]
  • [get | view] (2009-03-02 21:09:06, 1.1 KB) [[attachment:referencias.sgml]]
  • [get | view] (2009-03-02 22:26:32, 4.8 KB) [[attachment:spi.eps]]
  • [get | view] (2009-03-02 22:26:54, 0.8 KB) [[attachment:spi.png]]
  • [get | view] (2009-03-02 22:27:21, 7.6 KB) [[attachment:system.eps]]
  • [get | view] (2009-03-02 22:27:31, 1.2 KB) [[attachment:system.png]]
  • [get | view] (2009-03-02 22:27:42, 7.3 KB) [[attachment:timer0.eps]]
  • [get | view] (2009-03-02 22:28:00, 1.1 KB) [[attachment:timer0.png]]
  • [get | view] (2009-03-02 22:28:32, 7.1 KB) [[attachment:timer1.eps]]
  • [get | view] (2009-03-02 22:28:12, 1.0 KB) [[attachment:timer1.png]]
  • [get | view] (2009-03-02 22:28:45, 7.4 KB) [[attachment:timer2.eps]]
  • [get | view] (2009-03-02 22:28:55, 1.1 KB) [[attachment:timer2.png]]
  • [get | view] (2009-03-02 22:26:07, 587.2 KB) [[attachment:tutorial.pdf]]
  • [get | view] (2009-03-02 22:25:35, 2215.3 KB) [[attachment:tutorial.ps]]
  • [get | view] (2009-03-02 21:09:56, 4.4 KB) [[attachment:tutorial.sgml]]
  • [get | view] (2009-03-02 22:29:05, 5.3 KB) [[attachment:uart.eps]]
  • [get | view] (2009-03-02 22:29:16, 0.9 KB) [[attachment:uart.png]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

Heberge par Ikoula