INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC
-
Upload
georgeguitar -
Category
Documents
-
view
485 -
download
4
description
Transcript of INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC
![Page 1: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/1.jpg)
INTRODUCCIÓN A LAS INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux HERRAMIENTAS LIBRES GNU/Linux
PARA LA PROGRAMACIÓN DE PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PICMICROCONTROLADORES PIC
Ing. Juan Dirceu Navarro A.Ing. Juan Dirceu Navarro A.20062006
![Page 2: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/2.jpg)
●¿Que es un Microcontrolador?●Diferencia entre un microprocesador y un microcontrolador.
●Diagrama de bloques y terminales.●Mapa de la memoria.●Manejo de los puertos.●Herramientas Libres.●Ejemplos de programación.●Conclusiones.
ContenidoContenido
![Page 3: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/3.jpg)
“Un Microcontrolador es un circuito integrado que contiene todos los componentes de un
computador”
¿Que es un Microcontrolador?¿Que es un Microcontrolador?
[MI99]
Un microcontrolador es una computadora de baja prestación, que está gobernada por un programa que convierte al microcontrolador en una computadora dedicada.
![Page 4: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/4.jpg)
Diferencia entre un microprocesador Diferencia entre un microprocesador y un microcontroladory un microcontrolador
Microprocesador o CPU
Un microprocesador es un sistema abierto con el que puede construirse un computador con las características que se desee, acoplándose los módulos necesarios.
[MI99]
![Page 5: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/5.jpg)
Diferencia entre un microprocesador Diferencia entre un microprocesador y un microcontrolador (cont. 1)y un microcontrolador (cont. 1)
Microcontrolador
Un microcontrolador es un sistema cerrado que contiene un computador completo y de prestaciones limitadas que no se pueden modificar. [MI99]
![Page 6: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/6.jpg)
Diferencia entre un microprocesador Diferencia entre un microprocesador y un microcontrolador (cont. 2)y un microcontrolador (cont. 2)
MicrocontroladorMicroprocesador o CPU
![Page 7: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/7.jpg)
Diagrama de bloques y terminalesDiagrama de bloques y terminales
![Page 8: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/8.jpg)
Diagrama de bloques y terminalesDiagrama de bloques y terminales(cont. 1)(cont. 1)
![Page 9: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/9.jpg)
Mapa de la memoriaMapa de la memoria
![Page 10: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/10.jpg)
Manejo de los puertosManejo de los puertos
Generalmente los puertos de un PIC se pueden configurar como entradas o salidas, analógicas o digitales.
Ejemplo:Configurar los puertos A y B del PIC 16F84 con las siguientes especificaciones:
Puerto ARA0 Entrada RA3 EntradaRA1 Salida RA4 EntradaRA2 Salida
Puerto BRB0 Entrada RB3 SalidaRB1 Salida RB4 EntradaRB2 Entrada RB5 SalidaRB6 Entrada RB7 Entrada
![Page 11: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/11.jpg)
Manejo de los puertos Manejo de los puertos (cont. 1)(cont. 1)
Solución:
Todas las Salidas = 0 (Binario)Todas las Entradas = 1 (Binario)
En Hexadecimal:Asignar al Registro TRISA = 0x13 ò asignar a 0x5 <= 0x13Asignar al Registro TRISB = 0xB5 ò asignar a 0x6 <= 0xB5
En Octal:Asignar al Registro TRISA = 0'19' ò asignar a 0'5' <= 0'19'Asignar al Registro TRISB = 0'265' ò asignar a 0'6' <= 0'265'
![Page 12: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/12.jpg)
Manejo de los puertos Manejo de los puertos (cont. 2)(cont. 2)
Pregunta: ¿Y cómo programo?Respuesta: Cambiando de banco de memoria, el registro STATUS permite cambiar de banco de memoria.
Registro STATUS (0x3):
![Page 13: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/13.jpg)
Manejo de los puertos Manejo de los puertos (cont. 3)(cont. 3);Ejemplo 1. Configuración de puertos;Juan Dirceu Navarro Arias
LIST P=PIC16F84INCLUDE "p16f84.inc"
; Declaración de Variables
; STATUS equ 0x3; PORTA equ 0x5; TRISA equ 0x85; PORTB equ 0x6; TRISB equ 0x86; RP0 equ 0x5
; Programa
beginORG 0 ; Iniciamos el programa en la posición 0 de la memoriaBSF STATUS,RP0 ; Cambiamos al banco de memoria 1MOVLW 0x13 ; Movemos 10011 al registro de trabajo W.MOVWF TRISA ; Configuramos el puerto A como salida, moviendo W -> f(registro).MOVLW 0xB5 ; Movemos 10110101 al registro de trabajo W.MOVWF TRISB ; Configuramos el puerto B como salida, moviendo W -> f(registro).BCF STATUS,RP0 ; Salimos del banco de memoria 1 al banco 0.
END
![Page 14: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/14.jpg)
Herramientas Libres GNU/Linux.Herramientas Libres GNU/Linux.
¿Que necesito para programar un Microcontrolador?
●Editor de textos: Emacs, vi, vim, gedit, kedit, kate, etc.●Compilador, assembler: gpasm, tpasm, Jal, Pyastra, etc.●Simulador: gpsim, miSim, SxSim, etc.●Programador:
➢Software:Odyssey, prog84, PP06, picprg, MIPI, etc.➢Hardware: EPIC, El Cheapo, Tait, JDM, Propic2, etc.
Adicionales: GUIs, IDEs.
![Page 15: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/15.jpg)
Herramientas Libres GNU/Linux. Herramientas Libres GNU/Linux. (cont. 1)(cont. 1)
Existen muchas herramientas libres GNU/Linux para programar PICs: http://www.gnupic.org/
GPUTILSConjunto de herramientas para compilar el coligo fuente en ensamblador: GPASM (GNU/Linux) => MPAMS MS Windows
GPSIMSimulador de GPASM.
XGPASMInterfaz de usuario gráfica (GUI) de GPASM
![Page 16: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/16.jpg)
Herramientas Libres GNU/Linux. Herramientas Libres GNU/Linux. (cont. 2)(cont. 2)PIKDEVEntorno de desarrollo Integrado (IDE) para GPASM.
Programadores:Software:Odyssey (Puerto paralelo)odyssey PIC16F877 write /home/user/PICs/Programas/suma.hexPicprog 1.7 (Puerto serial)picprog --burn --device=pic16f84 --input suma.hex --pic /dev/ttyS1Hardware:El Cheapo (Puerto paralelo)EPIC Programmer (Puerto paralelo)YAP-II (Puerto serial)PICFun (Puerto serial)
![Page 17: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/17.jpg)
Ejemplos de programaciónEjemplos de programación
Ejemplo 2Se desea encender 8 LEDs en forma secuencial, utilizando el PIC 16f877. Utilizando el puerto B
Ejemplo 3Se desea encender 8 LEDs en forma secuencial, utilizando el PIC 16f877. Utilizando el puerto B (Otro método)
![Page 18: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/18.jpg)
EPIC ProgrammerEPIC Programmer
Cortesía Ing. Ramiro Astete
![Page 19: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/19.jpg)
Referencias BibliográficasReferencias Bibliográficas
[WI05]Wikipedia La enciclopedia Libre, Procesador, http://es.wikipedia.org/wiki/Procesador
[MI99] José M. Angulo Usategui, Ignacio Angulo Martinez, Microcontroladores PIC Diseño Práctico de Aplicaciones, Segunda Edición, Mc Graw Hill, 1999
[MK00] Myke Predko, Programing and Customizing PICmicro Microcontrollers, Second Edition, Mc Graw Hill, 2000
![Page 20: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/20.jpg)
Recursos WEBRecursos WEB
● Compilador GPASM http://gputils.sourceforge.net/
● Simulador GPSIM para GPAMS http://www.dattalo.com/gnupic/gpsim.html
● Interfaz de Usuario Gráfica (GUI) para GPASM http://xizard.free.fr/logiciels/xgpasm/xgpasm.html
● Entorno de Desarrollo Integrado (IDE) para GPAMS http://pikdev.free.fr/
![Page 21: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/21.jpg)
Recursos WEB Recursos WEB (cont. 1)(cont. 1)
Software● Programador Odyssey
http://www.desert.cx/odyssey/● Programador Picprog
http://hyvatti.iki.fi/~jaakko/pic/picprog.html● Programador Prog84
http://home3.inet.tele.dk/frda/picasm/prog.html● Programador PP06 http://pp06.sourceforge.net/● Trivial LVP programmer
http://www.finitesite.com/d3jsys/
![Page 22: INTRODUCCIÓN A LAS HERRAMIENTAS LIBRES GNU/Linux PARA LA PROGRAMACIÓN DE MICROCONTROLADORES PIC](https://reader033.fdocuments.es/reader033/viewer/2022052311/5572066b497959fc0b8b9032/html5/thumbnails/22.jpg)
Recursos WEB (cont. 2)Recursos WEB (cont. 2)
HardwareEl Cheapo http://www.myke.com/elcheapo.htmEPIC Programmer
http://www.melabs.com/products/epic.htmYAP-II http://books.mcgraw-
hill.com/engineering/updatezone/predko/html/yap-ii.htm
PICFun http://www.alanmacek.com/robot/programmer.html