mitxela.com forum
Welcome. Please log in or register.

Precision Clock not updating.
paulek Posted: 28 Mar 2021, 12:10 PM
Avatar


Member
Posts: 3
Joined: 28-March 21
Hi,

I built the precision clock on my own to learn something about board manufacturing and finding and byung all the parts on my own.
Now I got a problem.
The clock is turning on, all middle segments turn on and the clock counts up until it gets a GPS fix. After it got a fix, the individual 5mm LEDs begin blinking and the rest of the clock, except the last digit, freezes. What might be the problem here? Obviously something is working but then the microcontroller does something strange.

kind regards

(User posted image)


-------------
[top]
mit Posted: 29 Mar 2021, 10:44 AM
Avatar
yeah whatever

Admin
Posts: 596
Joined: 4-May 16
Have you set the fuses on the ATtiny? When it's counting up, is it counting in real-time? That could tell you if the clock speed on the chip is correct or not.

Also - a black PCB?? sacrilege!

-------------
[top]
paulek Posted: 29 Mar 2021, 04:23 PM
Avatar


Member
Posts: 3
Joined: 28-March 21
I have just flashed the hex file from github and have done nothing else.
It's counting up in real-time, yes. The last digit shows tenths and from there upwards it is seconds.

Sorry for the black PCB, I got lured by the matt finish.

-------------
[top]
mit Posted: 29 Mar 2021, 04:30 PM
Avatar
yeah whatever

Admin
Posts: 596
Joined: 4-May 16
If the last digit is showing tenths then it's not realtime. You need to set the fuses to disable the DIV8 bit, either using the makefile (make fuses) or with avrdude:

avrdude -p t2313 -B2000 -U lfuse:w:0xe4:m

I'm kidding about the colour, it looks good!

-------------
[top]
paulek Posted: 31 Mar 2021, 02:48 PM
Avatar


Member
Posts: 3
Joined: 28-March 21
Today, I finally found time to do it and it works now! Thank you for your help and the whole project.

-------------
[top]
Xenthera Posted: 14 Sep 2024, 05:29 PM
Avatar


Member
Posts: 1
Joined: 14-September 24
QUOTE (mit)
If the last digit is showing tenths then it's not realtime. You need to set the fuses to disable the DIV8 bit, either using the makefile (make fuses) or with avrdude:

avrdude -p t2313 -B2000 -U lfuse:w:0xe4:m

I'm kidding about the colour, it looks good!


Would you be able to put this in the assembly guide as a note for those sourcing their own components? I did the same as this guy and had the same issue until I spent 30 minutes clicking around on your forum trying to find the answer lol


-------------
[top]
k0jdd Posted: 6 Apr 2025, 02:39 AM
Avatar


Member
Posts: 7
Joined: 6-April 25
A question arises when comparing the command to reflash the attiny in order to change time zone (from the assembly instructions )

avrdude -c USBASP -p t2313 -U flash:w:us_eastern.hex:i


and the command to set fuses (listed here)

avrdude -p t2313 -B2000 -U lfuse:w:0xe4:m


If I am using a usbasp to set the fuses don't I need to tell avrdude that?

avrdude -c USBASP -p t2313 -B2000 -U lfuse:w:0xe4:m



-------------
[top]
mit Posted: 6 Apr 2025, 10:16 AM
Avatar
yeah whatever

Admin
Posts: 596
Joined: 4-May 16
If you are changing the timezone, you do not need to set the fuses.

You only need to worry about fuses if you are flashing a new chip.

-------------
[top]
k0jdd Posted: 6 Apr 2025, 01:55 PM
Avatar


Member
Posts: 7
Joined: 6-April 25
Apologies, I was not clear. I AM flashing a new chip.

(I am building some clocks from locally sourced parts and the Gerbers you so graciously shared via PCBway.)

Does my revised command for doing this with a uspasb look correct?

avrdude -c USBASP -p t2313 -B2000 -U lfuse:w:0xe4:m


-------------
[top]
mit Posted: 6 Apr 2025, 05:36 PM
Avatar
yeah whatever

Admin
Posts: 596
Joined: 4-May 16
Ah I see, yes that looks fine. I think there is a config file for avrdude which specifies the default programmer, so if that is set up then you can leave out the -c argument, but it never hurts to put it explicitly.

I was apparently inconsistent when I wrote the makefile which has a bunch of the commands: https://github.com/mitxela/PrecisionClockMkII/blob/master/makefile

The osccal stuff at the end is for calibrating the internal oscillator, which needs the special hardware I described here, but that usually isn't needed, the majority of chips are fine from the factory.

-------------
[top]
k0jdd Posted: 7 Apr 2025, 01:24 PM
Avatar


Member
Posts: 7
Joined: 6-April 25
Worked like a charm. I bad to slow down the clock rate a bit (as suggested by avrdude)

MacMini-M2-Pro:avrdude_macOS_64bit k0jdd$ ./bin/avrdude -B 20Khz -c USBASP -p t4313 -U flash:w:london.hex:i
Set SCK frequency to 16000 Hz
Set SCK frequency to 16000 Hz
Reading 1636 bytes for flash from input file london.hex
Writing 1636 bytes to flash
Writing | ################################################## | 100% 7.50 s
Reading | ################################################## | 100% 5.34 s
1636 bytes of flash verified

Avrdude done. Thank you.
MacMini-M2-Pro:avrdude_macOS_64bit k0jdd$ ./bin/avrdude -c USBASP -p t4313 -B2000 -U lfuse:w:0xe4:m
Set SCK frequency to 500 Hz
Reading 1 byte for lfuse from input file 0xe4
Writing 1 byte (0xE4) to lfuse, 1 byte written, 1 verified

Avrdude done. Thank you.
MacMini-M2-Pro:avrdude_macOS_64


Cheers!

-------------
[top]

Sign in to post a reply.