I have a RA4M1 on which the RTC is not incrementing. The waveforms on the crystal are identical to one that does work. All the other functions of the processor also seem to work.
I know that anything is possible, but it is it at all likely that i have a processor where everything works except the RTC? Or should i continue looking for a hardware fault?
Thanks for reaching out to us!
As far I can understand from what you are saying you have some custom boards where the RTC is working properly and only one board has issues with the RTC, even though the same software is running on all the boards, right?
First of all could you please provide to us the FSP version you are using and the configurations you have made in rtc stack on FSP Configurator?
RCR1 is set to 0b11100100
RCR2 is set to 0b01000001
FSP is version 4.0.0 but the RTC stack is not used.
Do you follow the initialization of registers (as you do not use FSP APIs) ?
What clock do you use - sub-clock or LOCO ?
Please let me inform you that there is also one case that the RTC counter cannot be read correctly.
Generally when you are using the RTC, set the PCLKB to a frequency that is greater or equal to the frequency of the RTC count source.
If this condition is not met, the RTC counter may be not read correctly.
Check also this.
Additionally could you please provide to us more information? Like as mentioned what are the settings that you have done for the RTC? As mentioned what is the count source of it, have you followed the correct process to initialize the RTC from registers? We would appreciate it if you could provide to us, some sample code to help us in the debugging process.
Yes. That’s where I got the set up procedure from. it uses sub-clock and a crystal. The waveform on the crystal looks the same on both working and non-working boards
Thanks for your response!
Could you please provide to us some sample code of the register settings you have done by following the procedure shown in the previous answer?
I’m just getting back to this project. . . I found what the problem was.I had misinterpreted the instructions about the software reset. I assumed that it cleared the time registers which I didn’t want to do, so I omitted that step, and that fixed the (only) one which wasn’t working.
I then found two more that didn’t work because the 32768Hz crystal oscillator wasn’t oscillating, and the instructions in the manual are just plain wrong.
Rf is nothing to do with the resonator, Rf is required to bias the amplifier. Whether it is needed or not depends only on the amplifier.
Nor is Rd anything to do with damping, it adds the extra phase shift. A crystal has a phase shift that is asymptotic to 180°, but the amplifier needs 180° phase shift to oscillate, which the crystal on its own cannot provide. Normally the amplifier output resistance and the first capacitor provide the extra phase shift, but if that is insufficient, the Rd is required.
Most other micros I have used include Rf, though devices like 74HC4060 which also employ Pierce oscillators don’t. But the manual doesn’t specify whether an external Rf is required or not, giving me some nonsense that it is dependent on the crystal.
Crystals don’t have any significant parallel resistance.