njeff / nixie-clock

Nixie Clock PCB and Code
6 stars 6 forks source link

Error when trying to build the NixieCode in AtmelStudio6.1 #1

Open FlorianPix opened 4 years ago

FlorianPix commented 4 years ago

I built a NixieClock with your instructable but cant write code to the ATMega328P. What I did is install AtmelStudio6.1, open your project connecting the ARCELI Atmel BEI AVRISP mkii XPII AVR ISP mk2 USB AVRISP-In-System-Programmer and then try to build the solution.

Error 1 #error "F_CPU not defined!" C:\Users\Florian Pix\Documents\Programme\NixieCode\NixieCode\millis.c 16 3 NixieCode Error 2 #error "Bad F_CPU setting (<256 or >=32640000)" C:\Users\Florian Pix\Documents\Programme\NixieCode\NixieCode\millis.c 20 3 NixieCode Error 3 'F_CPU' undeclared (first use in this function) C:\Users\Florian Pix\Documents\Programme\NixieCode\NixieCode\millis.c 121 14 NixieCode

What am I doing wrong ? I am new to Microcontroller programming.

njeff commented 4 years ago

Hi, you need to define the frequency of the microcontroller. In Atmel Studio, you can do this by going to Project ->NixieCode Properties -> Toolchain -> AVR/GNU C Compiler -> Symbols. Here, you should press the little + icon in the "Defined Symbols" box to add a symbol, and add F_CPU=8000000UL.

FlorianPix commented 4 years ago

Hi :) thanks for the quick response your answer resolved this issue but a new error rose. D: The USB driver attach timed out. Do you think this is due to me not properly soldering something or do I need to install a driver for flashing or something else?

Timestamp: 2020-05-27 21:42:20.481 Severity: ERROR ComponentId: 20100 StatusCode: 1 ModuleName: TCF (TCF command: Tool:connect failed.)

njeff commented 4 years ago

You may need to install a driver; does the programmer show up under your Device Manager as AVRISP? If not you will probably need to find the driver for it and install it.

FlorianPix commented 4 years ago

It shows up as Jungo - WinDriver im gonna try deinstalling the drivers, rebooting and installing everything again. Because some forums suggest that you should not attach the AVRISP to the computer prior to installing the drivers that come with Atmel Studio but I did. Lets see. image imageosh

alexanderkrause commented 4 years ago

Hi this is Florian Pix again from a friends account. I got it to apperantly connect and read something. grafik But I get this error:

Timestamp: 2020-05-28 19:39:59.928 Severity: ERROR ComponentId: 20100 StatusCode: 131101 ModuleName: TCF (TCF command: Device:startSession failed.)

Unexpected signature 0x00535353 (expected 0x001e950f).

In forums they said I could adjust the ISP Clock but I tried a lot of values and nothing seems to work. Any ideas ?

njeff commented 4 years ago

I'm taking a look at the solutions people are putting on the forums; what speeds have you tried? Maybe 100kHz would work? Can you read any other data from the microcontroller (like fuse data)?

You may also try flashing with avrdude (which may be easier).

alexanderkrause commented 4 years ago

Yes we have tried 100kHz. No we cant read any fuse data :(

We fixed an error with the power supply and now the clock looks like this: grafik Do you have an idea where there might be a faulty connection or is this the default behaviour before flashing the atmega ?

njeff commented 4 years ago

Hard to say but that is probably fine; I'm not sure what state the shift registers default to when powered on and have no data. All the channels could possibly be on and the clock would look like your picture shown.

One thing to check hardware-wise is make sure your high voltage and low voltage systems are well isolated. Residual flux from soldering could cause unwanted connections and you want to be sure everything is well cleaned. When you tried to program the device earlier, did you have the high voltage applied? Have you tried programming other AVR devices with the programmer? I would recommend trying to see if other devices flash to see if this is just a problem with this specific setup.