A medical device for treating cardiac arrhythmia includes a microprocessor. A MCU configures the medical device to operate in a modified DVI (R) mode in which: when receiving a signal indicating the sensing of an atrial event, the MCU sets a PANP interval and sends to a time control unit a signal; if a scheduled post-ventricular atrial escaping interval is to end at a time not within the PANP internal, the MCU sends respective signals to a pacing control/generation unit and the time control unit to dictate the pacing control/generation unit and control a second timing unit to use a PAVI as a next ventricular escape interval; and if the scheduled post-ventricular atrial escaping interval is to end within the PANP interval, the MCU sends a signal to the time control unit, controlling the second timing unit to use the PAVI as the next ventricular escape interval.