public void update() {
		// Update the realtime clock from the system time
		long millisSinceLastUpdate = System.currentTimeMillis() - lastSecondIncrement;

		while (millisSinceLastUpdate > 1000) {
			millisSinceLastUpdate -= 1000;
			RTCReg[SECONDS]++;
			if (RTCReg[SECONDS] == 60) {
				RTCReg[MINUTES]++;
				RTCReg[SECONDS] = 0;
				if (RTCReg[MINUTES] == 60) {
					RTCReg[HOURS]++;
					RTCReg[MINUTES] = 0;
					if (RTCReg[HOURS] == 24) {
						if (RTCReg[DAYS_LO] == 255) {
							RTCReg[DAYS_LO] = 0;
							RTCReg[DAYS_HI] = 1;
						} else {
							RTCReg[DAYS_LO]++;
						}
						RTCReg[HOURS] = 0;
					}
				}
			}
			lastSecondIncrement = System.currentTimeMillis();
		}
	}