PIC24 Support Libraries
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
timer32bit_switch_pulse_measure.c File Reference
#include "pic24_all.h"
#include <stdio.h>

Go to the source code of this file.

Functions

void CONFIG_SW1 ()
 Switch1 configuration, use RB13. More...
 

Detailed Description

Measures the pulse width of pushbutton switch using Timer2/3 in 32-bit mode with INT1 for edge detection. For more accuracy, use an external crystal and define CLOCK_CONFIG=PRIPLL_8MHzCrystal_40MHzFCY in your MPLAB project. Typical crystal accuracy for through hole is +/-20 pmm, so for a 100000 us pulse width measurement this is +/- 2 us.

Definition in file timer32bit_switch_pulse_measure.c.

Function Documentation

void CONFIG_SW1 ( )
inline

Switch1 configuration, use RB13.

Configure INT1 interrupt

Definition at line 79 of file timer32bit_switch_pulse_measure.c.