mame/src/devices/machine/ds128x.cpp
Jean-François DEL NERO 8191fd96fe Fix DS128X/DS1288X main frequency divider. The output frequency must be fixed to 1HZ with these devices.
In  the  MC146818, DV2-DV0  were  used  to  select  the input frequency to provide a proper time base.
Since the DS12885/87 and DS1685/87 use only the 32.768kHz  crystal  these  3  bits  are  used to  turn  the  oscillator  on  or  off  and  to  reset  the  countdown  chain.
There are not used anymore to select the main clock divider value.
2017-11-02 08:58:42 +11:00

26 lines
669 B
C++

// license:BSD-3-Clause
// copyright-holders:smf
#include "emu.h"
#include "ds128x.h"
DEFINE_DEVICE_TYPE(DS12885, ds12885_device, "ds12885", "DS12885 RTC/NVRAM")
//-------------------------------------------------
// ds12885_device - constructor
//-------------------------------------------------
ds12885_device::ds12885_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: mc146818_device(mconfig, DS12885, tag, owner, clock)
{
}
int ds12885_device::get_timer_bypass()
{
if( !( m_data[REG_A] & REG_A_DV0 ) ) //DV0 must be 0 for timekeeping
{
return 7; // Fixed at 1 Hz with clock at 32768Hz
}
return 22; // No tick
}