pic32mx320f064h Microchip Technology Inc., pic32mx320f064h Datasheet - Page 416

no-image

pic32mx320f064h

Manufacturer Part Number
pic32mx320f064h
Description
64/100-pin General Purpose, 32-bit Flash Microcontrollers
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
pic32mx320f064h-40V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064hT-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PIC32MX FAMILY
EQUATION 21-1:
3.
EXAMPLE 21-7:
DS61143A-page 414
/*
*/
a) If the oscillator is faster than ideal (negative
result from step 2), the CAL bits register value
needs to be negative. This causes the specified
number of clock pulses to be subtracted from
the timer counter, once every minute.
b) If the oscillator is slower than ideal (positive
result from step 2), the CAL bits register value
needs to be positive. This causes the specified
number of clock pulses to be added to the timer
counter, once every minute.
The following code example will update the RTCC calibration.
int cal=0x3FD;
if(RTCCON&0x8000)
{
}
RTCCONCLR=0x03FF0000;
RTCCONSET=cal;
(Ideal Frequency (32,758) – Measured Frequency)
unsigned intt0, t1;
do
{
}while(t0!=t1);
if((t0&0xFF)==00)
{
}
t0=RTCTIME;
t1=RTCTIME;
while(!(RTCCON&0x2)); // wait until second half...
* 60 = Error Clocks per Minute
ERROR CLOCKS PER
MINUTE
UPDATING THE RTCC CALIBRATION VALUE
// 10 bits adjustment, -3 in value
// RTCC is ON
// read valid time value
// we're at second 00, wait auto-adjust to be performed
// clear the calibration
Advance Information
4.
Writes to the CAL bits should only occur when the timer
is turned off, or immediately after the rising edge of the
seconds
(RTCTIME<15:8>) field is ‘00’ due to the possibility of
the auto-adjust event).
Note:
Load the CAL bits (RTCCON<9:0>) with the cor-
rect value.
pulse
A write to the seconds bits resets the state
It is up to the user, to include in the error
value, the initial error of the crystal drift,
due to temperature and drift due to crystal
aging.
of calibration (not its value). If an adjust-
ment just occurred, it will occur again
because of the minute roll over.
(except
© 2007 Microchip Technology Inc.
when
the
seconds

Related parts for pic32mx320f064h