Single digit, Seven segment Numitron program and pcb design needed.

So will the ds1307 rtc library work for my 1340. The 1340 can do 12h time, I thought the 1307 could only do 24h format? :o

EDIT- the 1307 does 12H as well. I will try the adafruit RTC in the IED library and see if that works.

So i installed the RTClib folder found in manage libraries. I hooked up my RTC with super cap and crystal. I went to sketches and clicked on RTClib but nothing came up. The text in the code says, #include <RTClib.h>. That is it. Do I have to load the library somewhere else.

Just ran a I2C scanner sketch and my rtc device was found at address 0x86. So My RTC is showing up.

I figured out where all the libraries go and examples. So I think I am connected. Just need a sketch and understanding how RTC work.

That's a great start!

I found an RTC library for a ds3231 and it has a Test sketch and a settime sketch. When i load the test sketch i can open up the serial monitor and it shows the rtc reading every second. So it seems like they are working.

When i load the set time sketch. The serial monitor is blank. Do i need to set the time within the Arduino IDE or within the serial monitor?

I don't know the sketch - my best guess is that it'll ask you for the time, you can probably see that in the source.

Here is the sketch, I know I am supposed to set the time in YYMMDDwHHMMSSx format. Just not sure where. I was following this tutorial. [Arduino #20] JeeLabs RTC DS1340 tutorial for dummies | Curious Seyoung

/*
DS3231_set.pde
Eric Ayars
4/11

Test of set-time routines for a DS3231 RTC

*/

#include <DS3231.h>
#include <Wire.h>

DS3231 Clock;

byte Year;
byte Month;
byte Date;
byte DoW;
byte Hour;
byte Minute;
byte Second;

void GetDateStuff(byte& Year, byte& Month, byte& Day, byte& DoW, 
		byte& Hour, byte& Minute, byte& Second) {
	// Call this if you notice something coming in on 
	// the serial port. The stuff coming in should be in 
	// the order YYMMDDwHHMMSS, with an 'x' at the end.
	boolean GotString = false;
	char InChar;
	byte Temp1, Temp2;
	char InString[20];

	byte j=0;
	while (!GotString) {
		if (Serial.available()) {
			InChar = Serial.read();
			InString[j] = InChar;
			j += 1;
			if (InChar == 'x') {
				GotString = true;
			}
		}
	}
	Serial.println(InString);
	// Read Year first
	Temp1 = (byte)InString[0] -48;
	Temp2 = (byte)InString[1] -48;
	Year = Temp1*10 + Temp2;
	// now month
	Temp1 = (byte)InString[2] -48;
	Temp2 = (byte)InString[3] -48;
	Month = Temp1*10 + Temp2;
	// now date
	Temp1 = (byte)InString[4] -48;
	Temp2 = (byte)InString[5] -48;
	Day = Temp1*10 + Temp2;
	// now Day of Week
	DoW = (byte)InString[6] - 48;		
	// now Hour
	Temp1 = (byte)InString[7] -48;
	Temp2 = (byte)InString[8] -48;
	Hour = Temp1*10 + Temp2;
	// now Minute
	Temp1 = (byte)InString[9] -48;
	Temp2 = (byte)InString[10] -48;
	Minute = Temp1*10 + Temp2;
	// now Second
	Temp1 = (byte)InString[11] -48;
	Temp2 = (byte)InString[12] -48;
	Second = Temp1*10 + Temp2;
}

void setup() {
	// Start the serial port
	Serial.begin(9600);

	// Start the I2C interface
	Wire.begin();
}

void loop() {

	// If something is coming in on the serial line, it's
	// a time correction so set the clock accordingly.
	if (Serial.available()) {
		GetDateStuff(Year, Month, Date, DoW, Hour, Minute, Second);

		Clock.setClockMode(false);	// set to 24h
		//setClockMode(true);	// set to 12h

		Clock.setYear(Year);
		Clock.setMonth(Month);
		Clock.setDate(Date);
		Clock.setDoW(DoW);
		Clock.setHour(Hour);
		Clock.setMinute(Minute);
		Clock.setSecond(Second);

		// Test of alarm functions
		// set A1 to one minute past the time we just set the clock
		// on current day of week.
		Clock.setA1Time(DoW, Hour, Minute+1, Second, 0x0, true, 
			false, false);
		// set A2 to two minutes past, on current day of month.
		Clock.setA2Time(Date, Hour, Minute+2, 0x0, false, false, 
			false);
		// Turn on both alarms, with external interrupt
		Clock.turnOnAlarm(1);
		Clock.turnOnAlarm(2);

	}
	delay(1000);
}

I found another library and tried it. I get the same results. The test sketch loads in correctly. The when i open the serial monitor it gives you the date and time and refreshes every second. But the time never changes. It is like the clock is not being accessed or the clock is not working.

Probably the DS1340 uses different commands to set it.

It has been a long time since I started this thread, I have made some progress with the build. I have the display working as a clock with an arduino UNO. I was pretty cool to see it work. But now I am have problems getting this program to flash on the ATTINY. I know I need to use the uno as ISP to flash the TINY but I am having no luck getting it to recognize the board. I is probably just me not knowing how to hook up the ATTINY. Any help would be great thanks.

I am using a library for the ATTINY from here. GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8

Here is a link of a video of the clock. The time is displayed when I press a button.Old Numitron Clock - YouTube

Long time indeed :slight_smile:

Look for the ISP connections - you need an Uno (or dedicated programmer such as the USBasp one) to program it. It's a bit tricky to program a tiny but the moment you get the hang of it, it's getting easy.

That video looks cool!

I think I found a good write up on how to program the ATTINY. I installed the core from the github link. It is called ATinyCore. There are some things in the arduino IDE in the tools tab i am not sure what to use. Not really sure on the Pin Mapping, Save EEPROM,LTO,BOD Level

Here is a picture of what I have selected right now.

Mmm... yeah, that pin mapping :slight_smile: Confusingly there are two mappings available indeed.

The ATTinyCore page has nice graphics with the pinout of the various ICs for reference.

I followed the guide i found here https://www.instructables.com/id/Program-an-ATtiny44458485-with-Arduino/ and it seemed pretty straight forward but I am getting this error code.

Arduino: 1.8.2 (Windows 10), Board: "ATtiny44/84 (optiboot), Disabled, ATtiny44, 8 MHz (internal), EEPROM retained, B.O.D. Disabled, Clockwise (like damellis core)"

C:\Users\mafredre\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/bin/avrdude -CC:\Users\mafredre\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.2.3/avrdude.conf -v -pattiny44 -carduino -PCOM3 -b19200 -e -Uefuse:w:0xFE:m -Uhfuse:w:0b11010111:m -Ulfuse:w:0xE2:m 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\mafredre\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.2.3/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         Setting bit clk period        : 5.0
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x29
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x29

avrdude done.  Thank you.

Error while burning bootloader.

Not sure what i did wrong. I have double checked my connections and I cant seem to find anything.

It is quite straightforward indeed.

Make sure you have the 10uF cap on the RESET pin to prevent the Arduino from resetting while uploading; that's a major issue.

Try uploading stuff to your ATtiny while you have nothing else connected to it; just the six ISP wires. Other connections on those pins (esp. MISO, MOSI, CLK) may prevent uploading.

I have a capacitor between RESET and GROUND on both the Uno and the ATtiny. Also all I have are the six wires from the uno to the tiny. How can I upload if I do not have a bootloader on it?

That's the beauty of ISP: you don't need a bootloader.

No cap on the ATtiny's reset! That one you DO want to reset... otherwise no programming will take place.

So in the Github wiring notes it says to use a capacitor on the chip. I thought you needed to burn the bootloader in order to set the fuses. That way the clock will run at the 8mhz internal just like the uno. Sorry i am just confused.