process( ResDrv, CXOut, MinClkCnt ) begin
if( ResDrv = '1' ) then
MinClkCnt <= b"000000";
elsif( CXOut'event and CXOut = '1' ) then
if( SecCarry = '1' and CmdReg(5) = '1' ) then
MinClkCnt <= b"000000";
elsif( SecCarry = '1' ) then
if( MinClkCnt = 59 ) then
MinClkCnt <= b"000000"; --Reset the count when 60 is reached.
else
MinClkCnt <= MinClkCnt + 1;
end if;
end if;
end if;
end process;
if( ResDrv = '1' ) then
MinClkCnt <= b"000000";
elsif( CXOut'event and CXOut = '1' ) then
if( SecCarry = '1' and CmdReg(5) = '1' ) then
MinClkCnt <= b"000000";
elsif( SecCarry = '1' ) then
if( MinClkCnt = 59 ) then
MinClkCnt <= b"000000"; --Reset the count when 60 is reached.
else
MinClkCnt <= MinClkCnt + 1;
end if;
end if;
end if;
end process;