TOP

How to set RTC when IC simulation and application, what should be note for?

1.For MCU type with RTC function(2501B, 2308, 2808, 26Lxx), in simulation, user insert the corresponding crystal (select IHRC_RTC in code option, then insert 16M; choose 4M_X'tal in code option, then insert 4M;), as there has been soldered 32768 ICE crystal, which can be directly controlled by FT0TB bit in emulation RTC functions; For 2501B real chip, user need to select IHRC_RTC and connect 32768Hz crystal between XIN/XOUT; For 2308 and 2808, user need to connect 32768Hz crystal between LXIN and LXOUT; 
2. The following is an example shows how to enable RTC function in program:

 B0BCLRFT0ENB; T0 timer
 B0BCLRFT0IEN; T0 interrupt function disabled.
 B0BCLRFT0IRQ; T0 interrupt request flag cleared.
 B0BSETFT0TB; Select RTC clock source.
 B0BSETFT0IEN; Enable T0 interrupt function.
 B0BSETFT0ENB; Enable T0 timer.

3. T0RATE [2:0] bit is invalid after RTC function enabled. 
4. For some microcontroller with RTC function, user need to delay 16us before clearing T0IRQ after enter interrupt service routine.