Attachment 'capitulo4b.sgml'
Download<sect1 id="memory" xreflabel="memory"> <title>Módulo Memory RAM</title> <para> Esta biblioteca sirve para averiguar la memoria RAM libre en el PIC. Las funciones nos ayudarán a conocer la memoria libre en cada banco.</para> <para> <screen> #include <memory.h> </screen> </para> <sect2 id="memorybank0" xreflabel="memory_bank0"> <title>memory_bank0</title> <para> La función devuelve la cantidad de bytes (RAM) libres en el BANCO 0. </para> <para> Por defecto esta función se habilita, debido a la macro I_HAVE_BANK0. </para> <screen> BYTE memory_bank0(void); </screen> </sect2> <sect2 id="memorybank1" xreflabel="memory_bank1"> <title>memory_bank1</title> <para> La función devuelve la cantidad de bytes (RAM) libres en el BANCO 1. </para> <para> La funcion debe ser habilitada con la macro I_HAVE_BANK1. </para> <screen> BYTE memory_bank1(void); </screen> </sect2> <sect2 id="memorybank2" xreflabel="memory_bank2"> <title>memory_bank2</title> <para> La función devuelve la cantidad de bytes (RAM) libres en el BANCO 2. </para> <para> La funcion debe ser habilitada con la macro I_HAVE_BANK2. </para> <screen> BYTE memory_bank2(void); </screen> </sect2> <sect2 id="memorybank3" xreflabel="memory_bank3"> <title>memory_bank3</title> <para> La función devuelve la cantidad de bytes (RAM) libres en el BANCO 3. </para> <para> La funcion debe ser habilitada con la macro I_HAVE_BANK3. </para> <screen> BYTE memory_bank3(void); </screen> </sect2> <sect2 id="memorybankall" xreflabel="memory_bank_all"> <title>memory_bank_all</title> <para> La función devuelve la cantidad de bytes (RAM) libres en todos los BANCOS. </para> <para> La función necesita que se habilite con la macro I_HAVE_BANK0,I_HAVE_BANK1, etc. Los bancos que se usen. </para> <screen> BYTE memory_bank_all(void); </screen> </sect2> <sect2 id="ejemplomemory" xreflabel="Ejemplo Memory"> <title>Ejemplo de Memory</title> <para> para compilar necesitas los siguientes comandos </para> <para> <screen> Ejemplo de compilación : ./compila.sh ej_memory 16f877a </screen> </para> <para> ej_memory.c </para> <screen> #include <pic/p16f877a.h> #define FOSC_HZ 20000000 #include <uart.h> #include <delayms.h> #define I_HAVE_BANK0 #define I_HAVE_BANK1 #include <memory.h> int main (void) { BYTE x; delayms(250); uart_open(SET_9600_8N1); x=memory_bank0(); //bytes libres en el Banco 0 uart_putc(x); x=memory_bank1(); //bytes libres en el Banco 1 uart_putc(x); delayms(100);//retardo para dar tiempo a que se envie el ultimo caracter uart_close(); 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.You are not allowed to attach a file to this page.