Warm Tube Clock sat v2

Sve vezano za mikrokontrolere

Moderators: pedja089, stojke369, [eDo], trax

Post Reply
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

project on hold (again) until the new multimeter arrives next week.
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

:roll:

OK, do you mind posting some photos of the clocks mainboard until then? :D
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

Here are the 3 main boards.
Image
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

It looks OK from here :)
Nice work!

Just make sure you don't have short-circuited pins in DS3231 RTC clock IC.
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

trax wrote:It looks OK from here :)
Nice work!

Just make sure you don't have short-circuited pins in DS3231 RTC clock IC.
It is some sloppy soldering but I checked to make sure there were no short circuits.

Do I have to programe the Atmega ic with the firmware?
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

Niall wrote:Do I have to programe the Atmega ic with the firmware?
YES!
And also with CLKOUT fuse enabled! This provides the required clock for the LED driver IC. Please find the fuses-image-screenshot in this topic, somewhere :)
If you fail, let me know and I will look it up.
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

trax wrote:
Niall wrote:Do I have to programe the Atmega ic with the firmware?
YES!
And also with CLKOUT fuse enabled! This provides the required clock for the LED driver IC. Please find the fuses-image-screenshot in this topic, somewhere :)
If you fail, let me know and I will look it up.
Cool, another new process to learn. (hello youtube tutorials) I will search for fuse image screen shots.
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

Wow, a whole new world of stuff to learn. :shock: :shock:

Quick question to narrow my research field...

You said in an earlier post you are using a AVR programmer from mikroelectronika and I see other AVR programmers like the AVR dragon. For me, as this will be the only time I program an AVR, it would make more sense to go via an arduino, bread board and a AVR usb cable, there is the likely hood I could use the arduino for a future project. Would this be more complicated?

Sorry about this, it seemed I only needed to be guided through the physical assembly of the board but now I will be annoying for information about the programming :?
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

Well, that might be a bit of a problem then. You see, Arduino uses a bootloader to program itself, whilst the Warm Tube Clock project is not compatible with Arduino and it can't be programmed with a bootloader method.

You actually need an ISP AVR programmer. However, you might be in luck because you can actually use Arduino to program the AVR chip in ISP mode. I did not try this, but they say it works:

https://www.arduino.cc/en/Tutorial/ArduinoISP
http://forum.arduino.cc/index.php?topic=125248.0
http://hardwarefun.com/tutorials/use-ar ... ontrollers

Bottom line: You need to program your AVR chip with the HEX file that is provided in the project files of the Warm Tube Clock.

Let me know if this makes sense to you.
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

Thanks Trax, I understand the basic concept of what is needed. I just have to read more and get familiar with exactaly whats going on.

Quite a few tutorials about using an arduino and bread bord as an ISP, but I even found this one for putting hex code on Atmega chips which skips the arduino altogether, using a USBasp and software.


https://www.youtube.com/watch?v=jcDS8iaYS_Q
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

If I am not mistaking, there are AVR programmers for burning the HEX on eBay for just a few $, maybe even $3 with shipping! That is crazy cheap :)

Maybe something like this would work: http://www.ebay.com/itm/USBASP-ISP-AVR- ... TBtzLxcn8g

You can investigate that...
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

I was looking at those, compatible with atmega 328, for that price its worth a try.
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

So I bought it, now 30 day wait til it comes form China and I familiarize myself with how to program the AVR.
:)
Niall
Posts: 24
Joined: 11-06-2015, 21:34

Re: Warm Tube Clock sat v2

Post by Niall »

My new multimeter arrived today :) . And so I re ran the tests that are in the final pages of the mainboard assembly on all 3 of my mainboards.

Test 1. With only the 3v battery check across point 7 and 22 of the Atmega ic socket. It should read 3v but it reads nothing for any of them.

Test 2 With the power supply connected across the same points 7 to 22 it reads 4.9v on all 3 :)

Test 2a from the +battery to the voltage stabilizer it should read 3v, but it reads 1.02v on 2 of the mainboards and 0 on the 3rd mainboard

Test 3 Voltage stabilizer to the +C14 (1uf 250v) reads 11.24v on all 3.

My highly unqualified conclusion is that the back up circuit has a problem. I really hope it has nothing to do with the DS3231 RTC clock IC. :?
hetoosten
Pocetnik na forumu
Pocetnik na forumu
Posts: 25
Joined: 30-07-2016, 09:42

Re: Warm Tube Clock sat v2

Post by hetoosten »

I am currently stuck at programming the Atmel.

To program I bought an usbasp device with a 10 pins flat cable. It also had a program board with a zif socket which is too wide, so the 328p doesn't fit in.

Therefore I made a programmer board, using this circuit

Image (full page is here: Link

When I try to connect with Avrdude I get this output:
sudo avrdude -v -c usbasp -p m328p
avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0xc817a8
avrdude: Expected signature for ATmega328P is 1E 95 0F

Could the problem be that the circuit for the programmer board is for ATmega328 and I have a 328P?

Are there other ways to program the atmel? Like using an Arduino (I have an Uno laying around)
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

hetoosten wrote:Could the problem be that the circuit for the programmer board is for ATmega328 and I have a 328P?
It is true that these two have different signatures, so programmer isn't getting what it is expecting.

You can set your avrdude to program m328 and see what happens. The HEX code should work just fine in 328 and 328P!
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

Niall wrote:Test 1. With only the 3v battery check across point 7 and 22 of the Atmega ic socket. It should read 3v but it reads nothing for any of them.
This is good news. There should be no power here from the 3V battery. The AVR does not run on 3V battery, only DS3231 RTC IC.
Niall wrote:Test 2 With the power supply connected across the same points 7 to 22 it reads 4.9v on all 3 :)
This is also good news. So far so good.
Niall wrote:Test 2a from the +battery to the voltage stabilizer it should read 3v, but it reads 1.02v on 2 of the mainboards and 0 on the 3rd mainboard
This I do not quite understand. What are you attempting to measure here? Anyway, all three boards should behave identically. :?
Niall wrote:Test 3 Voltage stabilizer to the +C14 (1uf 250v) reads 11.24v on all 3.
This is also good news, since ATmega is not connected or does not have firmware programmed. Once the firmware is there, at C14 you should see high voltage! This is all good.
Niall wrote:My highly unqualified conclusion is that the back up circuit has a problem. I really hope it has nothing to do with the DS3231 RTC clock IC. :?
You just need to explain a bit more what are you doing in your test 2a, and see why all boards do not behave the same.

If I were you, I would load HEX into the ATmega328P and see what happens with the high voltage generator. Do not shock yourself.
hetoosten
Pocetnik na forumu
Pocetnik na forumu
Posts: 25
Joined: 30-07-2016, 09:42

Re: Warm Tube Clock sat v2

Post by hetoosten »

@trax thank you for the reply!

I tried lots of different combinations. The returned id does not exist. I suspect the USBasp device is broken.

I had more luck with my Arduino uno. I connected the 328P, using the 6pins ICSP header, and Arduino-isp

I added two extra wires to the 328P: 1x 5v to pin20 and Ground to pin 22

Command:
sudo avrdude -P /dev/ttyUSB0 -c arduino -p m328p -v -e -U flash:w:wt2_IN14_shield.hex

I am only confused what to do with the fuses.
Output:
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: erasing chip
avrdude: reading input file "wt2_IN14_shield.hex"
avrdude: input file wt2_IN14_shield.hex auto detected as Intel Hex
avrdude: writing flash (15060 bytes):

Writing | ################################################## | 100% 2.34s

avrdude: 15060 bytes of flash written
avrdude: verifying flash memory against wt2_IN14_shield.hex:
avrdude: load data flash data from input file wt2_IN14_shield.hex:
avrdude: input file wt2_IN14_shield.hex auto detected as Intel Hex
avrdude: input file wt2_IN14_shield.hex contains 15060 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.71s

avrdude: verifying ...
avrdude: 15060 bytes of flash verified

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (H:00, E:00, L:00)

avrdude done. Thank you.
More info: https://learn.sparkfun.com/tutorials/in ... bootloader
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Warm Tube Clock sat v2

Post by trax »

OK, it looks like it will work.

Please see the attachment from my programmer software to see which fuses you need.
fuses_for_warmtube_v2.png
fuses in my programmer software
(29.98 KiB) Not downloaded yet
After you saw them, you should access this page to do the same and get the three bytes you need (three fuse bytes): http://www.engbedded.com/fusecalc/

This is what I got when I set the fuses in this calculator:

-U lfuse:w:0x96:m -U hfuse:w:0xd9:m -U efuse:w:0xfd:m
paste this option string into your avrdude command line. You may specify multiple -U arguments within one call of avrdude.
I never used avrdude so I can't help more than this.
hetoosten
Pocetnik na forumu
Pocetnik na forumu
Posts: 25
Joined: 30-07-2016, 09:42

Re: Warm Tube Clock sat v2

Post by hetoosten »

paste this option string into your avrdude command line. You may specify multiple -U arguments within one call of avrdude.
Thank you! that was very helpful. I used this command to program:
sudo avrdude -P /dev/ttyUSB0 -c arduino -p m328p -v -e -U lfuse:w:0x96:m -U hfuse:w:0xd9:m -U efuse:w:0xfd:m

I got error messages, but the fusecalculator website already warned this would happen. I will try the avr on my nixie mainboard now :-) Let see what happens.
Post Reply