Use PIC microcontroller for Time application

In summary: It is possible to make a circuit using a PIC microcontroller to switch a device on a specific day, date, and time. One way to do this is by using a Real Time Clock module, such as the ones made by Dallas Semiconductor. Another option is to implement a real-time clock using the on-board timer, although this may not be as accurate long term. Both methods involve triggering an interrupt at specific intervals and keeping track of the time using an accumulator. A 32.768 kHz crystal is commonly used for RTCs because it simplifies the circuit design.
  • #1
sanyad
2
0
Dear,

I want to make a project to switch-n a device on day-date-time basis i.e. I want to lighup a lamp on 30/08/2008 at 02:00PM .Is it possible to make a circuit for this by using PIC microcontroller.I want to use it in my company for rotational under frequency relay which trips off the output feeder by getting an external input pulse and check for date/time for operation of PIC output i.e. which output should be trip as per current day/time?.


Kindly reply pleaseeeeeeeeeeeeeeeeeeeee...


SANDEEP
INDIA
 
Engineering news on Phys.org
  • #2
sanyad said:
Dear,

I want to make a project to switch-n a device on day-date-time basis i.e. I want to lighup a lamp on 30/08/2008 at 02:00PM .Is it possible to make a circuit for this by using PIC microcontroller.I want to use it in my company for rotational under frequency relay which trips off the output feeder by getting an external input pulse and check for date/time for operation of PIC output i.e. which output should be trip as per current day/time?.


Kindly reply pleaseeeeeeeeeeeeeeeeeeeee...


SANDEEP
INDIA


The best way to do that is to use a Real Time Clock module that the PIC can read:

http://en.wikipedia.org/wiki/Real_time_clock

Dallas Semiconductor makes RTCs, for example.

.
 
  • #3
Assuming you're not doing anything else that's really time critical, you can also implement a real-time clock using the on-board timer (note that the accuracy will depend on the accuracy of your oscillator--you won't be able to keep track of time long term if your oscillator is not accurate). See the Microchip documentation (there should be a generic timer section, as well as subsections for each of the usually-dependent timers) for more details, but a decent way of doing it is to trigger an interrupt every (few?) second(s) and have an accumulator somewhere which keeps track of the time.

Random trivia: if you're using a RTC: a 32.768 kHz crystal is usually used because 32,768 is 2^15, which makes (EE) life really simple--assuming you had to keep track of individual pulses yourself.
 
  • #4
MATLABdude said:
Assuming you're not doing anything else that's really time critical, you can also implement a real-time clock using the on-board timer (note that the accuracy will depend on the accuracy of your oscillator--you won't be able to keep track of time long term if your oscillator is not accurate). See the Microchip documentation (there should be a generic timer section, as well as subsections for each of the usually-dependent timers) for more details, but a decent way of doing it is to trigger an interrupt every (few?) second(s) and have an accumulator somewhere which keeps track of the time.

Random trivia: if you're using a RTC: a 32.768 kHz crystal is usually used because 32,768 is 2^15, which makes (EE) life really simple--assuming you had to keep track of individual pulses yourself.

Thanks
 

1. How do I program a PIC microcontroller for a time application?

To program a PIC microcontroller for a time application, you will first need to choose a suitable microcontroller model and obtain a development board or programmer. Then, you can use a programming language such as C or assembly to write the code for your time application. You will also need to include a real-time clock module and configure it correctly in your code.

2. Can a PIC microcontroller accurately keep track of time?

Yes, a PIC microcontroller can accurately keep track of time with the use of a real-time clock module. These modules are designed specifically for timekeeping and have built-in features such as battery backup to ensure accurate timekeeping even during power outages.

3. What are some common time applications that use a PIC microcontroller?

Some common time applications that use a PIC microcontroller include digital clocks, timers, alarm systems, and data loggers. PIC microcontrollers are also commonly used in industrial applications that require precise timekeeping, such as in automation and control systems.

4. How much power does a PIC microcontroller use for a time application?

The power consumption of a PIC microcontroller for a time application will vary depending on the specific model and the complexity of the application. However, PIC microcontrollers are designed to be low-power devices and can be optimized for power efficiency by using sleep modes and other power-saving techniques.

5. Are there any limitations to using a PIC microcontroller for a time application?

One potential limitation of using a PIC microcontroller for a time application is the limited amount of memory available on some models. This may restrict the complexity of the time application that can be programmed. Additionally, some PIC microcontrollers may not have built-in real-time clock modules, requiring the use of external components.

Similar threads

Replies
4
Views
2K
  • Electrical Engineering
Replies
1
Views
3K
  • Electrical Engineering
Replies
13
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
5K
  • Special and General Relativity
Replies
30
Views
14K
Replies
4
Views
30K
  • General Discussion
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
Back
Top