Welcome to IDI Electronica!!!



Welcome!!! IDI Electronica is a blog for my personal projects and articles to help electronics enthusiasts like me.

Bienvenidos!!! IDI Electronica es un blog con mis proyectos personales y artículos con el fin de ayudar a entusiastas de la electrónica como yo.

Tuesday, April 7, 2015

Microprocessor vs Microcontroller vs FPGA

Whenever we talk about digital systems, we hear about logic devices like CPUs, microprocessors, microcontrollers, PLDs, ASICs, FPGAs, among others. But, what is the difference between them?

This article will attempt to explain their main differences without getting too technical.


CPU vs Microprocessor

The CPU (Central Processing Unit) is the part of a system that sequences and executes instructions by performing basic arithmetic, logic, control, as well as input and output operations. It is the part of the system that does all the processing.

Back in the day, the CPU was a combination of vacuum tubes wired together and were housed in multiple cabinets. We are talking about computers that occupied entire rooms. Later on, the transistor made an appearance and the CPUs became much smaller. However, these CPUs still occupied lots of space.

When the integrated circuit was invented, scientists were able to put the entire processing unit in a small silicon chip. This is what we know as the microprocessor.

Technically, a CPU refers to the main processor in the system. Therefore, not all microprocessors are CPUs. A good example of this situation would be the Sega Genesis video-game console. It contains 2 microprocessors, the Motorolla 68K to handle most instructions, video processing, etc. and the Zilog H80 for sound processing. In this case, only the 68K would be the CPU. Nonetheless, for most people, both terms are interchangeable.


Fig 1. Photo of U of Pennsylvania's ENIAC. The system used 18,000 vacuum tubes and dissipated 174KW of power


Fig 2. The Intel 8086 microprocessor


Microprocessor vs Microcontroller

A microprocessor unit (aka MPU or µprocessor) usually won't have I/O pins, memory or other peripherals. Instead, it uses its pins as a bus to interface with external components such as digital and analog I/O, RAM, ROM, serial ports, etc.

A microcontroller unit (aka MCU or µcontroller) integrates a CPU core (microprocessor), ROM and RAM memory, I/O pins, as well as other peripherals like serial ports, counters, clocks, etc. in one chip.

Microcontrollers are convenient because they put a full system in one chip without having to worry about compatibility issues or voltage level differences. They are also cheaper than using a microprocessor system. Their main disadvantage, is that they are limited by the amount of built-in peripherals.

Microprocessors are capable of performing more extensive calculations and because of the use of external components, they can be expanded to very complex systems at the board-level. A good example of a microprocessor system would be a personal computer.

Fig 3. Diagram comparing a microprocessor and a microcontroller


ASIC vs PLD vs FPGA

An Application Specific Integrated Circuit (ASIC) is a chip customized to perform a specific task rather than general-purpose applications.

A Programmable Logic Device (PLD) and a Field Programmable Gate Array (FPGA) are devices that can be reconfigured to create different digital circuits.

Simply put, PLDs and FPGAs are reprogrammable while ASICs aren't.

The 3 devices could potentially perform the same tasks, however ASICs are optimized for them. This means, they use less power and can process signals in less time. In some high speed applications, this difference in efficiency can make an ASIC the only option available. On the downside, ASICs are very expensive, take a long time to be designed and validated, and making any changes requires making a new device. They are only feasible if the chip needs to be mass produced. A good example of ASICs would be the Bitcoin miners.


PLD vs FPGA

The original PLDs were designed to replace a few dozen 7400-series chips (AND, OR, NOT gates). They are made of macrocells with combinatorial logic (AND, OR) and flip-flops. The most common type of PLD is the Complex Programmable Logic Device (CPLD), which is basically multiple PLDs connected in one chip. They are non-volatile, which means you don't need to reconfigure them after turning off the power.

A FPGA is made of logic blocks, interconnects and I/O. To create circuits, FPGAs configures an array of logic gates following Look-up tables (LUTs). They are volatile, so they need to be reconfigured every time they are powered up. The configuration file is usually stored in a EEPROM or NAND memory.

Because of their simple structure, CPLDs can be used to perform faster tasks than FPGAs. However, because of the size of the macrocells, CPLDs are usually limited to have less than 500 flip-flops. FPGAs on the other hand, can be used for larger and more complex designs since they can contain more than 150,000 flip-flops.


Microcontroller vs FPGA

We already described the difference between those two, but when should we pick one over the other?

In simple terms, a microcontroller is a processor with different circuits (peripherals) already built for you. All you need to do is program it and it will be ready to use. They are usually programmed using assembly, C or C++.

A FPGA is a blank chip with a bunch of logic gates for you to build whatever you want. In fact, you could technically build a small microprocessor with a FPGA. To configure them, you need to code them using a Hardware Description Language (HDL) like Verilog or VHDL.

For most applications, a microcontroller will be the simplest solution. They are cheap, easy to program and consume less power.

Microcontrollers do sequential processing (run one task at a time) while FPGAs can run multiple processes in parallel. This makes FPGAs better suited for high-speed or real-time applications like DSP.

Thursday, April 2, 2015

Parpadeando un LED con el Tiva C Series LaunchPad y Keil µVision v4

Una de las mayores dificultades para aquellos que empiezan a usar microcontroladores es crear y configurar un proyecto nuevo desde cero. Esto se debe a que, a diferencia de la plataforma de Arduino, normalmente debemos de instalar y configurar distintos controladores de dispositivos (drivers) y archivos con código específico para cada tipo de microcontrolador. Arduino normalmente incluye todos estos archivos en su propia plataforma, por lo que es un excelente microcontrolador para principiantes y entusiastas.

El objetivo de este artículo es el de introducir la placa Tiva C Series Launchpad y el programa de desarrollo embebido (IDE)  Keil µVision, y utilizarlos para hacer parpadear un LED.

Este artículo muestra los pasos para instalar el IDE, crear un proyecto y cargar el programa al LaunchPad. Debido a que no hay una versión en español de Keil, se necesitará un conocimiento básico del inglés para utilizar el programa.

TIVA C SERIES LAUNCHPAD & KEIL µVISION

Los Tiva C Series LaunchPad son una  familia de microcontroladores de bajo costo desarrollados por Texas Instruments. Para este proyecto, usaremos el LaunchPad TM4C (EK-TM4C123GXL). Esta placa lleva un CPU ARM Cortex-M4 con 32 bits, reloj de 80MHz, punto flotante, 256kB de memoria flash con 100,000 ciclos de escritura y borrado, además de sistemas periféricos como PWM, 1-MSPS ADC, 8 UARTs, 4 SPI, 4 I2C, USB y hasta 27 relojes. La placa también incluye para la interfaz de usuario 2 botones de uso general, un botón de reinicio, un LED de poder y un LED RGB programable.

Para más detalles sobre el Tiva C Launchpad, visita la página de Texas Instruments 


Fig 1.  Tiva C Series Placa de Evaluación

µVision es una plataforma de desarrollo embebido para procesadores ARM creada por Keil. La plataforma provee administración de proyectos, edición de código, compilador, depuración (debugging) y simulación. Para este proyecto usaremos la versión 4 de µVision, ya que es más estable, cuenta con más soporte en línea que la reciente versión 5 y sobretodo, es la versión con la que tengo más experiencia.

Para más información sobre µVision, visita la página de Keil.

Fig 2. Imagen de inicio de Keil µVision 4


2. INSTALACION DEL SOFTWARE (IDE)

a. Primero, necesitamos instalar Keil µVision v4. Visita https://www.keil.com/demo/eval/armv4.htm, ingresa tu información de contacto y descarga el archivo MDK474.exe para instalar el IDE. El tamaño del archivo es de aproximadamente 590MB.

b. Ejecuta el instalador de MDK-ARM v4. En las siguientes ventanas acepta los Términos de Uso, elige donde quieres instalar el programar, ingresa tu información de contacto y espera que el IDE se instale. Después, marca la casilla “Add example projects…” y en la última ventana remueve la marca en la casilla “Launch Driver Installation” y presiona Finalizar.

c. Después de instalar Keil, necesitamos instalar los controladores (drivers) para nuestro microcontrolador. Para este paso, vamos a necesitar el LaunchPad. Primero, visita http://www.ti.com/tool/stellaris_icdi_drivers y descarga el archivo Stellaris ICDI Drivers.
Puedes usar las instrucciones de Texas Instruments siguiendo este vínculo.

3. CREANDO UN PROYECTO NUEVO

Después de instalar Keil y los controladores podremos comenzar nuestro proyecto nuevo.

a. Abre Keil µVision v4, haz click en el menú Project >> New µVision Project y escribe el nombre del proyecto nuevo.

b. En la siguiente ventana, tienes que elegir el microcontrolador que será usado en este proyecto. Para nuestra placa, selecciona de la lista Texas Instruments y el dispositivo TM4C123GH6PM.


Fig 3. Seleccionando microcontrolador para el proyecto

c. Luego acepta te pregunten si deseas copiar el archivo de inicio (startup) del microcontrolador a tu proyecto. 

Fig 4. Pregunta del sistema para copiar archivo de inicio de microcontrolador


d. Tras aceptar, el archivo de inicio debe de aparecer bajo Target1 >> Source Group en la ventana de proyecto.

Fig 5. Vista de Keil con archivo de inicio


e. Para el siguiente paso, tenemos que copiar el archivo system_TM4C123.c a nuestra carpeta de proyecto. Este archivo contiene código para configurar los relojes para nuestro modelo microcontrolador y puede ser encontrado en la carpeta de instalación de Keil. En mi caso, el archivo se encuentra en C:\Keil\ARM\Startup\TI\TM4C123\system_TM4C123.c

f. Después copiar el archivo a tu carpeta de proyecto, haz click con el botón derecho en Source Group 1 en la ventana Project y luego haz click en Add existing files to Group ‘Source Group 1’ y selecciona el archivo system_TM4C123.c. Esto nos permite agregar archivos con código en diferentes formatos a nuestro proyecto.

Fig 6. Agregando archivos a proyecto en Keil 


g. Finalmente, haz click con el botón derecho a Source Group 1 nuevamente y selecciona Add New Item to Group ‘Source Group 1’ para agregar un archivo nuevo al proyecto. Selecciona C File(.c), dale un nombre a tu archivo y haz click en Add para crear el archivo. Este va a ser tu archivo principal para el código de programación.

f. El IDE debe mostrar ahora el archivo startup, system y el archivo en blanco que acabas de crear bajo Source Group 1.

Fig 7. Imagen de Keil después de agregar los archivos necesarios


4. PROGRAMACION

a. Visita https://github.com/sphanlung/TivaC/blob/master/LedBlink.c y copia el código en esa página al archivo en C que creaste. El vínculo te llevará a mi repositorio en Github.

b. Luego, haz click en el menú Project y en Build Target. Este comando hará que Keil compile el código para el microcontrolador. En la parte de abajo también podremos ver el resultado de la compilación, errores y advertencias en la ventana Build Output.

Fig 8. Compilando el código en Keil


c. Ahora, necesitamos configurar Keil para poder cargar el programa en el microcontrolador. Haz click en Project y luego Options for Target ‘Target 1’. Cuando se abra la ventana de opciones, busca la pestaña Utilities y bajo Configure Flash Menu Command, y desmarca la casilla Use Debug Driver. Luego, bajo Use Target Driver for Flash Programming selecciona el controlador Stellaris ICDI y presiona OK.


Fig 9. Configuración del controlador para el LaunchPad


d. Finalmente, haz click en Flash y luego Download para cargar el programa en el microcontrolador 

5. PRUEBA EN LA PLACA

a. Cuando el código termina de cargar, presiona el botón Reset en el LaunchPad para iniciar el programa.

b. Cuando ningún botón es presionado, el LED azul estará encendido. Si presionas el botón SW1, los LEDs azul y verde parpadearán. Si presionas el botón SW2, los LEDs rojo y azul parpadearán.


Fig 10. Prueba del código en el LauchPad 

Wednesday, April 1, 2015

Blinking an LED Using the Tiva C LaunchPad and Keil µVision 4

One of the most frustrating things for people new to microcontrollers is starting a new project from scratch. The main reason being that, unlike the Arduino platform, you have to install and configure different drivers and configuration files before you can even start your project. Arduino already includes all these files and settings in its platform, which is why it is so appealing to hobbyists.

The purpose of this project is to introduce the Tiva C Series LaunchPad and the Keil µVision embedded development tool to make the on-board LED blink.

This article will show you the steps to install the IDE, create a project and load the code to the LaunchPad board. 

TIVA C SERIES LAUNCHPAD AND KEIL µVISION 4

The Tiva C Series LaunchPad is a family of low-cost microcontroller evaluation boards developed by Texas Instruments. For this project, we will be using the TM4C LaunchPad (EK-TM4C123GXL). This board features an 80-MHz, 32-bit ARM Cortex-M4 CPU with floating point, 256 kBytes of 100,000 write-erase cycles of flash memory, and a wide range of peripherals including motion control PWMs, 1-MSPS ADCs, eight UARTs, four SPIs, four I2Cs, USB, and up to 27 timers. The board includes two general purpose switches, a reset switch, a power LED, and user programmable RGB LEDs for user interface.

For more details about the Tiva C Launchpad, you can visit Texas Instruments’ website 


Fig 1.  Tiva C Series Evaluation Board


µVision v4 is an ARM embedded development platform created by Keil that provides project management, code editing, compilation, debugging, and simulation. Even though µVision v5 has recently been released, we’ll be using v4 because it is more stable, you’ll find more online resources to support this version and more importantly, it’s the one I know how to use better.

For more information about Keil µVision 4.0 you can visit Keil’swebsite 

Fig 2. Opening image for Keil µVision 4


2. INSTALLING THE SOFTWARE (IDE)

a. First, we need to install Keil µVision v4. Go to  https://www.keil.com/demo/eval/armv4.htm. Enter your contact information and then download the file MDK474.exe to install the IDE. The download file size is approximately 590MB.

b. Run the MDK-ARM v4 installer, in the next screens accept the License Agreement, select the installation folder, enter your contact information and wait until the IDE installs. Next, check the box to “Add example projects…” and in the last screen, uncheck the “Launch Driver Installation” box.  

c. After installing Keil, we need to install the drivers to be able to interface the microcontroller with our computer. You will need the LaunchPad board for this step. First, go to http://www.ti.com/tool/stellaris_icdi_drivers to download the drivers for the Tiva C LaunchPad. At the bottom of the page you’ll find a PDF file with instructions on how to install the drivers for different operating systems. You can also access the PDF using this link

3. CREATING A NEW PROJECT

After Keil and the drivers are installed, we can start our new project.

a. Open Keil µVision v4. Click on Project >> New µVision Project and enter a name for the project

b. You’ll be asked to select a target microcontroller. For our board, select Texas Instruments and the device number TM4C123GH6PM


Fig 3. Selecting a microcontroller for new project

c. Accept copying the Startup project file when prompted

Fig 4. System prompt to install project startup file


d. Your Project window should now show the startup file under Target1 >> Source Group

Fig 5. Screenshot of Keil with startup file


e. Next, we need to copy the file system_TM4C123.c to our project folder. This file contains microcontroller specific code to enable the system clocks. The file can be found in the Keil installation folder. In my case, I found it in  C:\Keil\ARM\Startup\TI\TM4C123\system_TM4C123.c

f. After the file has been copied to your project folder, right-click on Source Group 1 in the Project window, click on Add existing files to Group ‘Source Group 1’ and select the file system_TM4C123.c

Fig 6. Adding files to Keil project


g. Finally, right-click on Source Group 1 again and click Add New Item to Group ‘Source Group 1’. Then select C File(.c), enter file name at the bottom and click Add. This will be your main program file.

f. The IDE should show the startup, system and main file that you created under Source Group 1

Fig 7. Screenshot of Keil after project files were added


4. PROGRAMMING

a. Go to https://github.com/sphanlung/TivaC/blob/master/LedBlink.c and copy the code to the C file that you created.  The link will take you to my Github repository.

b. Click on Project and Build Target. This command will compile your code and report any errors or warnings in the Build Output window.

Fig 8. Screenshot of Keil with command to compile code


c. Click on Project and Options for Target ‘Target 1’. Find the Utilities tab and under Configure Flash Menu Command, uncheck the Use Debug Driver box. Then, under Use Target Driver for Flash Programming select the Stellaris ICDI driver and hit OK. This will allow us to program the board through USB.

Fig 9. Configuring drivers to load code into LaunchPad


d. Click on Flash and then Download. This will load the compiled code to the microcontroller. The Build Output window will report the status of the process or any errors.

5. BOARD TEST

a. Once the code is loaded, press the reset button in the LaunchPad to start the program.

b. The blue LED should be on. If you hold SW1, the blue and green LEDs will blink. If you hold SW2, the blue and red LEDs will blink.


Fig 10. Testing the code in the LauchPad 


Friday, March 20, 2015

Diseño de Circuito con LEDs

Los LED (del acrónimo Diodo Emisor de Luz en inglés) se han convertido uno de los componentes electrónicos más utilizados en el mundo. Los LED son más baratos que otros tipos de fuente de luz, consumen menos poder, producen menos calor, y su tamaño los hace ideales para un sin fin de aplicaciones.


CONCEPTOS BASICOS

1. Los LEDs son semiconductores. La Ley de Ohm (V=iR) todavía aplica, pero tenemos que considerar la caída de voltaje de conducción (Vf por Forward voltage en inglés) del LED cuando hacemos nuestros cálculos.

2. Los LEDs tienen 2 regiones básicas de operación: De conducción (forward region en inglés) y de corte (reverse region en inglés). En la región de conducción, el LED actúa como un conductor. La corriente fluye de sólamente del ánodo al cátodo y el LED se enciende. En la región de corte, el LED se convierte en un aislante y por lo tanto no hay flujo de corriente. También existe la región de ruptura, causada por el exceso de voltaje en sentido opuesto, donde la corriente fluye de cátodo a ánodo. Sin embargo, esta región normalmente daña el LED.

Fig. 1. Símbolo de esquemática de un LED mostrando el ánodo y el cátodo


3. El LED entra en la región de conducción cuando el voltaje de alimentación (Vs por voltage source en inglés) es mayor a la caída de voltaje de conducción del LED (Vf). Este valor se puede encontrar en la datasheet (hoja de detalles técnicos del producto).

4. En LEDs comunes, el cátodo está normalmente marcado por un contacto más corto y por una ranura plana en el cuerpo del LED.

Fig. 2. Dimensiones físicas de un LED


5. El brillo del LED es proporcional al flujo de corriente directa. Demasiada corriente puede dañar o quemar el LED; poca corriente hará que apenas se vea la luz. Como el LED puede funcionar como un conductor, necesitamos colocar una resistencia en serie para controlar el flujo de corriente.

Fig. 3. Circuito simple con un LED 


6. La ecuación para calcular la resistencia del circuito es simple. Tomamos el voltaje de fuente (Vs) y sustraemos el voltaje de conducción (Vf) del LED, luego dividimos ese número por la corriente directa (If) deseada y el resultado nos da la resistencia que necesitamos.


Eq. 1. Ley de Ohm usada para calcular la resistencia de un circuito con LED

7. Idealmente, queremos usar la corriente directa recomendada por el fabricante en la datasheet del LED. Más corriente nos da más brillo, pero también reduce el tiempo de vida del LED.



Diseño de Circuito de LED

Para este ejemplo, utilizamos un LED blanco fabricado por Vishay [Datasheet].

1. Primero, usamos el datasheet para encontrar el voltaje de conducción (Vf) y la corriente directa recomendada (If). Estos valores se encuentran normalmente en la sección Electrical Characteristics del datasheet.



Fig. 4. Fragmento del datasheet de un LED

Para nuestro LED, Vf tiene un rango de 2.8V a 3.6V. Esto, debido a que los LEDs nunca son perfectamente idénticos a la hora de ser fabricados. La única forma de saber el Vf exacto del LED es midiéndolo con un multimetro una vez que el circuito es construído. En este ejemplo, usaremos Vf=3.2V.

Vf = 3.2V
If = 20mA

2. Encontramos la caída de voltaje de alimentación sobre la resistencia y el LED en serie. Para este ejemplo, usamos una batería de 9V.

Vs = 9V

3. Aplicamos nuestros números en la ecuación eq. 1 y el resultado es el valor de la resistencia.

(Vs – Vf) / If = (9V – 3.2V) / 0.020 = 290Ω

Fig. 5. Ejemplo de circuito con LED



Usando Multiples LED en Serie

Si nuestro circuito usa varios LEDs en series, simplemente sumamos los voltajes de conducción (Vf) de cada LED y los agregamos a nuestra ecuación para calcular la resistencia R.

Para este ejemplo, usamos 3 de los LEDs de Vishay en serie y usamos los valores Vs=12V, Vf= 3.2V, y If=20mA.

La ecuación para calcular la resistencia sería:

 (Vs – Vf – Vf – Vf) / If = (12 – 3.2 – 3.2 – 3.2) / 0.020 = 120Ω

Fig. 6. Circuito con múltiples LEDs en serie



Thursday, March 19, 2015

LED Circuit Design

Light emitting diodes (LED) are one of the most commonly used electronic components in today’s world. They are cheaper than other light sources, use much less power, dissipate less heat and their small form factors makes them ideal for countless applications.

BASIC CONCEPTS

1. LEDs are semiconductors. While Ohm's Law (V=iR) still applies, we must consider the voltage drop of the LED (Vf) first when doing the calculations.

2. LEDs have two states or regions of operation: Forward-bias and reverse-bias. In simple terms, forward-bias makes the LED a conductor (current flows, lights up), and reverse-bias makes it an insulator (no current, no light). In the forward-bias region, current will only flow from Anode to Cathode. In reverse-bias, no current flows. There's also the breakdown region, where applying enough voltage in the opposite direction will create a reverse current. Doing this will usually damage the LEDs so we want to avoid it.


Fig. 1. Schematic symbol for LED showing anode and cathode


3. The LED is forward-biased (turned on) when the source voltage (e.g. power supply) is higher than the forward voltage (Vf) of the LED. The forward voltage can be found in the LED's datasheet. 

4. For standard LEDs, the cathode will usually have a shorter pin and the package will have a flat notch on its side.

Fig. 2. Package dimensions of LED


5. LEDs are current-controlled devices; brightness is proportional to the current flow. Too much current will burn them; too little will dim them. Since a forward-biased LED is a conductor, we need to use a resistor in series to control the current flow.

Fig. 3. Simple LED series circuit


6. The equation to calculate the value of the resistor in the LED circuit is simple. We take the voltage source (Vs), we subtract the LEDs forward voltage (Vf) and divide the result by the LEDs forward current (If). The LEDs forward voltage and current are usually found in the LEDs datasheet and will vary depending on the color and type of LED. This equation is simply Ohm's Law.

Eq. 1. Ohm's Law applied to LED resistor calculation

7. Ideally, we will use the forward-current recommended by the manufacturer in the datasheet. Increasing the current will increase the brightness, but may also reduce the LEDs life span. If we exceed the maximum current rated in the datasheet, the LED might get damaged.

Designing a LED Circuit

For this design example, I’ll be using a white LED manufactured by Vishay [Datasheet].

1. First, we use the datasheet to find the forward voltage (Vf) and the typical forward current (If) of the LED. We will find Vf and the typical If in the Electrical Characteristics section.


Fig. 4. Fragment of LEDs datasheet

For this LED, Vf ranges from 2.8V to 3.6V. This occurs because LEDs will never be identical due to manufacturing imperfections. The only way of finding the actual Vf value, is measuring it with a volt-meter once the circuit is built and running. For this example, we’ll use the average of those values, 3.2 volts. The typical forward current is the value used by the manufacturer for testing.

Vf = 3.2V
If = 20mA

2. Find the voltage drop across both the LED and the resistor. In this example, we’ll be using a 9V battery.

Vs = 9V

3-Substitute the values in eq.1 to calculate the resistor value.

(Vs – Vf) / If = (9V – 3.2V) / 0.020 = 290Ω

Fig. 5. LED series circuit example



Using Multiple LED in Series

To use multiple LEDs in series, we simply need to add the forward voltage (Vf) of each LED in the series into the equation.

For this example, we are using 3 of the Vishay LEDs in series and our values are Vs=12V, Vf= 3.2V, and If=20mA.

The equation to calculate our resistor would be:

 (Vs – Vf – Vf – Vf) / If = (12 – 3.2 – 3.2 – 3.2) / 0.020 = 120Ω

Fig. 6. Multiple LED series circuit example


Wednesday, December 10, 2014

Estás Tratando de Organizar tu Código? Prueba GitHub

Muchos de nosotros hemos pasado por una situación como ésta. Creas un proyecto de códigopara  microcontrolador en diferentes archivos.  A los pocos días, haces varias modificaciones al código y guardas los archivos. Tras unos días más, agregas más modificaciones a tu código y después de compilar te das cuenta que introdujiste un bug a tu proyecto. Como el proyecto ha sido modificado varias veces, encontrar el error puede tomar bastante tiempo y puede ser muy frustrante porque no recuerdas qué cambios pudieron haberlo generado.

Para resolver ese problema se han creados diferentes Sistemas de Control de Versiones (VCS por sus siglas en inglés), los cuales organizan y administran los archivos con código de forma más eficiente. Los VCS proveen repositorios o archivos centralizados, dan seguimiento a las modificaciones, y te dan información sobre quién los hizo, cuándo, e idealmente, por qué. También guardan copias de cada versión de código que hayan existido. Entre los sistemas más conocidos tenemos Subversion (SVN), Git, Mercurial, CVS, LibreSource y Perforce, entre otros. Algunos son gratuitos, otros de código abierto o propietarios.

El sistema del cual quiero hablar en este artículo es Git. Creado por Linus Torvald (creador de Linux), Git es una VCS distribuida. Para este tipo de VCS, los desarrolladores no tienen que compartir un solo repositorio. En lugar de eso, tienen que hacer una copia del repositorio original a sus propios sistemas y si deciden hacer cambios al código original, pueden mandárselo al autor para que lo fusione al repositorio de su proyecto. 




Entonces, ¿qué cosa es Github? Github es un servicio de alojamiento en línea de repositorios basado en el control de versiones Git con una interfaz amigable y simple. Github ofrece una interfaz gráfica, mientras que en su forma original, Git require el uso de línea de comando. Además, Github te permite mantener tu repositorio en sus servidores de forma gratuita, siempre y cuando tu repositorio sea público. Si deseas tener repositorios privados, puedes pagar una cuota mensual, la cual vale la pena pagar si eres un profesional. La mayoría de VCS requieren que tengas tu propio servidor para guardar toda la información. El sistema Github también te permite compartir código y repositorios con otros desarrolladores en cualquier parte del mundo. Esto permite que la colaboración en proyectos sea más eficiente y segura, pues ningún cambio puede ser echo a tu repositorio sin el consentimiento del dueño del repositorio.


Además de ser un VCS, Github también funciona es una red social, ya que te permite entrar en contacto o seguir las actividades de otros desarrolladores. En Github, puedes ver sus repositorios públicos y también puedes colaborar con sus proyectos. Github también es una herramienta para buscar trabajo como freelancer y se puede utilizar para mostrar tu portafolio de desarrollo.

En conclusión, es recomendable utilizar algún tipo de VCS para organizar tus proyectos con código. De todos los sistemas actualmente en el mercado, Github te da acceso a sus servidores de manera gratuita para guardar tus repositorios y ofrece una interfaz gráfica muy fácil de usar.

Trying to Keep Track of Your Code? Try GitHub

Many of us have probably ran into this situation. You write some microcontroller code and save it in different project files. A week later, you make some changes and overwrite the project files. A few days later, you make even more changes and realize that your code is buggy. Since you kept adding more and more changes to the code, figuring out what change caused the bug can be time consuming and frustrating.

To solve that problem, different developers have created Version Control Systems (VCS) which can manage the code more efficiently. A VCS provides repositories for your code and keeps track of  what changes were made, who made them and when. This  makes collaboration between developers more efficient and reliable. Moreover, each version of the code that you commit is saved in case you want to revert your code to a previous stage.  Some of the most popular VCS are Subversion (SVN), Git, CVS, Mercurial, LibreSource and Perforce, among others. They can be free, open-source or proprietary. 

The system I want to talk about is Git. Designed by Linus Torvalds (creator of Linux), Git is a classified as a distributed VCS. This means that the developers don't have to share a common repository to make code changes. Instead, developers have to make a copy of the repository into their own systems and merge it back in order to make the changes effective. 



So, what is Github? Github is an online repository hosting service based on Git with a much friendlier user interface than using Git through command line. The advantage of Github, is that it you can keep your repositories in their servers for free as long as you make them public. Otherwise, you can pay to have private repositories. Github also allows you to share code and collaborate with other developers. And for your protection, no changes can be made to your repository without your approval.


Besides a repository and code sharing site, Github is also a Social Network. It allows you to connect with other developers, follow their work. Github also helps you offering or looking for freelance work, and the repositories make excellent work portfolios for potential employers.

In conclusion, I really encourage you to use some sort of VCS to keep your code organized. Of all the systems currently available, I recommend Github since it is a free, offers a really simple user interface and allows you to collaborate with other developers as long as they are connected to the internet.