RTCC Interrupt on PIC18F47J53

Thread Starter

spinnaker

Joined Oct 29, 2009
7,835
I have a PIC18F47J53 with an RTCC. The datasheet shows an RTCCIE bit in the PIE3 register and a corresponding interrupt flag but curiously these bits aren't mentioned anywhere else in the datasheet.

The alarm section does have this very cryptic reference on interrupts.

17.3.2 ALARM INTERRUPT
At every alarm event, an interrupt is generated. Additionally,
an alarm pulse output is provided that operates
at half the frequency of the alarm.
The alarm pulse output is completely synchronous with
the RTCC clock and can be used as a trigger clock to
other peripherals. This output is available on the RTCC
pin. The output pulse is a clock with a 50% duty cycle
and a frequency half that of the alarm event (see
Figure 17-6).
The RTCC pin can also output the seconds clock. The
user can select between the alarm pulse, generated by
the RTCC module, or the seconds clock output.
The RTSECSEL (PADCFG1<2:1>) bits select between
these two outputs:
• Alarm pulse – RTSECSEL<2:1> = 00
• Seconds clock – RTSECSEL<2:1> = 01

Would this be the interrupt for RTCCIE and RTCCIF bits??


And what does the rest of it mean?
Additionally, an alarm pulse output is provided that operates at half the frequency of the alarm.

What does that mean? How can an alarm have a frequency?

The documentation for the RTCC really is pretty dismal.

What I really need is an interrupt when the time changes. But I also what an interrupt when the alarm is triggered.
 

Papabravo

Joined Feb 24, 2006
16,463
The square wave output goes to enable a piezo buzzer or a speaker to implement the actual audio of the "alarm". I'm just curious as to why you think an alarm cannot have a frequency. Has your head been somewhere it is not supposed to be? (Like in a dark corner, or under a rock).

I don't know what you are complaining about WRT the dastasheet. Figure 17-1 on p. 230 describes the operation pretty well. It looks like each time there is a comparison match between the RTCC timer and the compare register you get an alarm event. Each alarm event causes an RTCC interrupt. Each time there is an RTCC interrupt the Alarm output changes state. As long as the time between amarm events is the same the alarm output has a frequency the is 1/2 or 50 of the RTCC match frequency.

Figure 17-6 on p.246 shows the relation between alarm events and the output on the alarm pin. It looks like you can have alarm events every at one of nine selected intervals from half a second up to 1 year.

Looks like you might have a problem debugging an alarm that goes off once a year for the next 82 years.
 
Last edited:

Thread Starter

spinnaker

Joined Oct 29, 2009
7,835
Has your head been somewhere it is not supposed to be? (Like in a dark corner, or under a rock).

.
Is there really a need for this? It was a valid question. I never figured microchip would have a feature to notify the user of an alarm based on different frequencies. I would think that was left up to the programmer to design exactly how the user is to be notified how ever the programmer chooses. A "frequency" can be anything including the clock frequency.
 
Last edited:

Papabravo

Joined Feb 24, 2006
16,463
Is there really a need for this? It was a valid question. I never figured microchip would have a feature to notify the user of an alarm based on different frequencies. I would think that was left up to the programmer to design exactly how the user is to be notified how ever the programmer chooses. A "frequency" can be anything including the clock frequency.
Sorry, I forgot the trigger warning. Cheer up. My head has been there and I know what it looks and feels like. It may be cold comfort, but there it is.:confused:
 

Papabravo

Joined Feb 24, 2006
16,463
So to answer my question. There is no interrupt for tome change correct?

The RTCCIF is for the alarm?
I'm assuming that "tome" = "time"

I don't think so. If you want an interrupt for the time change you set the ALARM MASK to interrupt every second. If you don't care about seconds, you set the ALARM MASK in interrupt every minute.
At least that's how I interpret what is going on. Your mileage may differ.
 
Top