PIC18F14K50: Basic Alarm System with sEOS

After reading the “Embedded C” book from Michael J. Pont I built the alarm system where I must integrate all the techniques that the book has. I built the alarm system using the PIC18F14K50 because it has all the peripherals. At first I thought it was going to be easy because most of the libraries I needed I already had them but after moving forward in the project I saw that my libraries were designed for blocking so I could not use them for the sEOS and I had to update them, even added buffer functions to give them optimal functionality.

The software architectures used for this system were sEOS (Simple Embedded Operating System – Time based) with MSS (Multi-State System).

The modules that this system uses are:

  • FIFO buffer.
  • 4×4 Keypad with FIFO buffer.
  • UART with FIFO buffer.
  • sEOS (Time-based).
  • Alarm System.

The alarm system is designed to monitor one main door and five windows and as outputs it has one led and a buzzer speaker. The sensors are simulated with switch buttons.

Alarm functionality:

  • When you turn on the system, the alarm will enter into a DISARM state waiting for the correct password.
  • After entering the correct password the alarm will change to ARMING state where it will wait for 60s before checking the sensors so you can go out the place or if you need it to turn it off.
  • After that the alarm goes into ARMED state where it will start monitoring all the sensors.
  • If the main door is open it is going to change into DISARMING state where you have 60s to insert the correct password and disarm the alarm.
  • In case that the 60s has passed or one of the window sensors are triggered the system will change to INTRUDER state where the led and the buzzer are going to alert of intruder.

After the alarm is in INSTRUDER state it will only be disarmed with the correct password and go to DISARMED state.

Thanks for reading and happy programming.


Michael J. Pont, “Embedded C”, 2002



C18 to XC8 Migration Reference

This document aims to provide a quick reference on the changes that must be considered or performed in the source code when migrating from C18 to XC8. This information is based on the Microchip C18 to XC8 Migration Guide.

To continue reading click on the picture below or the link to open the PDF.

Click this link to open the PDF.

Migración de C18 a XC8

Referencia rápida sobre los cambios que se deben realizar o considerar en el código fuente al migrar un proyecto realizado en C18 a XC8. Toda esta información está basada en la guía de migración de microchip.

Para continuar leyendo da click en el siguiente dibujo o en el link inferior para abrir el PDF.

Da click en la imagen o da click en este link para ver el PDF.