Microchip | The Embedded Control Solutions Company Register Login
Browse All
Microchip Technology
 305 Code Snippets

CE113 - Timer1 used in Real-Time Clock Applications-1

Microchip Technology

dsPIC Digital Signal Controllers feature several on-chip general-purpose timers. Of these, the Timer1 module has the capability to be clocked by an external asynchronous 32KHz crystal connected to the device via the SOSCI and SOSCO pins.

About this Code Example


dsPIC Digital Signal Controllers feature several on-chip general-purpose
timers. Of these, the Timer1 module has the capability to be clocked by
an external asynchronous 32KHz crystal connected to the device via the
SOSCI and SOSCO pins. The attached code example demonstrates how Timer1
may be configured to use the 32KHz secondary oscillator for a real-time
clock (RTC) application.
Configuring Timer1 for the real-time clock application is a two-step
process. In the first step, the code demonstrates how the secondary
oscillator may be enabled via a special write sequence to the OSCCON
register. In the second step, the code demonstrates how the Timer1
is configured for using an external asynchronous clock. In addition
to these steps, the code also demonstrates Timer1 interrupt operation.

Categories

Release History

  • Jun 20, 2012

    Version: 1.0.0

    First Release to ECS

Download Contact the Developer

*Required Fields

  • Current Version:1.0.0
  • Created:Jun 20, 2012
  • Updated:Feb 26, 2015
  • Downloads:3813
  • MPLAB Version:V8.xx or above
  • C Compiler:MCC18 v3.30 or above
  • Development Tools:Explorer 16 Demo board
  • Supported Devices:PIC24HJ256GP610

Corporate News

Resources

Stay Connected

Stay up to date with the latest news from Microchip Technology.