Multiplexing Traffic Lights easily in a PIC microcontroller
Multiplexing is a important tool for improving the maneuverability of sequential hardware (such as traffic lights) and for reducing the number of pins required in a PIC microcontroller. In a…
Timer 1, how to make a reliable Real Time Clock in 8-bit PIC
Measuring seconds comes really handy in many circuits. Executing tasks with demanding precision, such as a real time clock, requires an external oscillator (often called 'crystal') of 32,768Hz. Such procedure…
Timer 0 as External Counter in 8-bit PIC microcontroller
In the previous post, Timer 0 as an Internal Counter was explained and configured to use the internal clock (i.e. the oscillator) to count a defined quantity of time. However,…
Timer 0, a simple Counter in 8-bit PIC you need to know
Instead of creating software to count seconds or pulses, a specific hardware was created to deal with this necessity called 'timers'. There is a bunch of different kinds of timers…
Interrupt sources in 8-bit PIC and how to quickly attend them
Interruption by hardware takes care of emergent situations that requires attention as soon as possible. The code is interrupted, the situation is attended, and finally is taken back to previous…
While loop in C language, the ‘ask first’ of Control Flow
'While loop' in C let's you control the loops and cycles that a program executes. At the beginning of the loop, a condition is checked whenever it's true; if it's…
Code Template, an easy guide for PIC Microcontrollers in C
As your programs get more complex and advanced, the necessity for order comes urgently. Classifying the whole code into sections according to topic and purpose is essential to maintain it…
If in C language, the simplest of Control Flow
It is the simplest decision instruction of all. Is true (1) or false (0)? The use of if is widespread and it's the best way to start with decision making,…
Hello World with 8-bit PIC microcontroller
For the purpose of this post, I'm going to write a very simple code for the demonstration, which will just light an LED. It could be considered a "Hello World"…