HOME

PROJECTS

TUTORIALS

C FUNCTIONS

PROGRAMS

PRODUCTS

VIDEOS

COMPANY

SPANISH

                 

tutorial: timer 0 interrupt handling in ANSI C to generate a 1 second time base, for 18F2550 microcontroller

 

 

mini_c2.jpg (64880 bytes)

 

Background:

In a tutorial section on assembly language programming, we explain the mechanism of interruptions made ​​by the 18F2550 to manage several of its internal devices.

Description: In this tutorial, we explain the capabilities that have the ANSI C language (C18 compiler) for interrupt handling and use thereof in the case of the 18F2550 microcontroller.

When compared with assembly language, using interrupts from C represents considerable savings in time, due to the great simplification in the handling of bit registers and variables.

The simple program explained below was used to generate a 1 high precision 1 second interrupt, flashing LED0 each second.

This simple program explained below was used to generate a high precision 1 second interrupt. You may load .hex file in Bolt 18F2550 system and watch de RB0 led flashing at 1 second frequency.

C18-BOLT-TIMER-0-INTERRUPT.c

C18-BOLT-TIMER-0-INTERRUPT.hex

A full high precision Real Time Clock program for Bolt 18F2550 system is provided in this files:

C18-BOLT-REAL-TIME-CLOCK-LCD-KEYPAD.c

C18-BOLT-REAL-TIME-CLOCK-LCD-KEYPAD.hex