8 votes
Accepted

Why can't the Atmel ATtiny family delay over a minute?

This is absolutely nothing to do with "why can't the atmel attiny family delay over a minute?". It is all to do with the way that C++ works. See my page about Integer arithmetic and overflow. To ...
Nick Gammon's user avatar
  • 38.2k
4 votes

Why can't the Atmel ATtiny family delay over a minute?

These are the problem lines: long offPeriod = 1 * 60 * 1000; long onPeriod = 1 * 60 * 1000; Even though long should hold the result, integer operations in C++ are still done in int by default. And ...
Ignacio Vazquez-Abrams's user avatar
4 votes

Equivalent of millis() in Atmel studio

The millis() function is defined in the Arduino Core for AVR architecture, specifically the wiring.c file. You can see that timer0 is setup with various parameters for prescaling and interrupt ...
jose can u c's user avatar
  • 6,974
2 votes

Reading from a pin Arduino Uno (assembly)

Instructions for writing to an individual output bit:- sbi portd,5 ; make Port D output bit 5 high (set) cbi portd,5 ; make Port D output bit 5 low (clear) sbi pind,5 ; toggle Port D output bit ...
Bruce Abbott's user avatar
2 votes
Accepted

Reading from a pin Arduino Uno (assembly)

You are simply reading the state of the input pin - this won't work. Study the datasheet for the DHT22, available from Sparkfun or eslewhere. To get data from the DTH22, you must first send a start ...
Peter Bennett's user avatar
2 votes

Atmel studio 7 vs Arduino IDE for register level coding?

I actually wouldn’t recommend either for professionally developing for Atmel chips. Although Atmel Studio is a nice enough IDE (the simulator is amazing!), it does make it very difficult to unit test ...
RubberDuck's user avatar
2 votes

Run a loop for only 60 secondes

Note that in an Arduino environment, main() is already provided for you. It calls your function void setup(void){ ... } once, then loops forever, calling your function void loop(void){ ... }. Either ...
JRobert's user avatar
  • 15.3k
1 vote

Sending data to UART using Atmel Studio with Attiny84

The ATTiny84 does not have a hardware UART peripheral. Instead it has a USI (universal serial interface), which does not have all the capabilities needed for UART ("serial") interface. You don't need ...
chrisl's user avatar
  • 16.3k
1 vote

Programming ATMega4809 via Atmel-ICE with Hex File from Arduino IDE - why doesn't the code loop / work?

Because of the great question asked by @Juraj I thought about how pins are mapped (and that I was probably thinking wrong about that mapping). I searched for and found the following diagram: Notice ...
raddevus's user avatar
  • 402
1 vote

Linking the Arduino Bootloader In Atmel Studio

This isn't exactly 100% the answer I was looking for, because I still want to know how I can use a static library build, as I mention in my post, and compile everything as a single binary. This method ...
Andrew's user avatar
  • 107
1 vote

Why do I get different results when compiling the same code with different ide?

Different compilers produce different machine code. As Majenko pointed out, the Arduino IDE's compiler, which happens to be GCC, uses float even when you write double. The Atmel Studio creates double ...
the busybee's user avatar
  • 2,002
1 vote

How can I control blinking of LED while in timer function?

My solution: uint16_t st_led=0; uint16_t et_led=0; while((TIFR1 & (1 << OCF1A))==0) //30 second { st_led=TCNT1; et_led=st_led; while((et_led-st_led)<=...
harun caliskanoglu's user avatar
1 vote

How can I control blinking of LED while in timer function?

Your waiting loop runs much faster than once per millisecond, and even faster per second. So to get just one "event" per second, you need to detect the change of the second. void ...
the busybee's user avatar
  • 2,002
1 vote

Atmel studio 7 vs Arduino IDE for register level coding?

Atmel Studio for professional. Arduino is for fun and is normally the first step into embedded c programming using the atmega328 (Arduino)
PhillyNJ's user avatar
  • 1,178
1 vote

Program an Arduino Uno with an Atmel ICE

Your Ardunino is stuck in debugWIRE (The debug wire fuse is set). Here is a tutorial on how to get it back to programming mode. In the tutorial I am using the AVR Dragon with AS6, but the process is ...
PhillyNJ's user avatar
  • 1,178
1 vote
Accepted

VisualMicro Can't compile in debug ('Serial' was not declared in this scope) for attiny84a

I found how to disable the vMicro debugging, in AtmelStudio open the "vMicro" menu then click the "Debugger" item and make sure the option "Atmel Studio Debugger" is checked. 1) Change the ...
0xCDCDCDCD's user avatar
1 vote

Arduino Due's clock frequency

How can I find the low-level registers of the Due in the Arduino IDE? Any header files for the Due to change its clocking? Read the datasheet / programming manuals for the chip. The Arduino Due is ...
Majenko's user avatar
  • 105k
1 vote

Can Atmel Studio 6 Simulator simulate SPI?

No Atmel Studio cannot simulate SPI. The fact that you are using SPI makes me think that you are using the MAX7456 IC or even the SparkFun On Screen Display Breakout which uses this same IC. You can ...
sa_leinad's user avatar
  • 3,188
1 vote
Accepted

Using Atmel Studio with Arduino Starter Kit (Uno MCU)

There are many tutorials on programming Arduino boards (or any other AVR MCU) with Atmel Studio: Creating new project: https://asensar.com/blog/2013/how-to-setup-atmel-studio-for-arduino-development/ ...
Flanker's user avatar
  • 529
1 vote
Accepted

How to configure 2nd Quadrature Decoder IO pins in Arduino IDE

TC blocks are pretty much identical (except TC1 doesn't have wired some signals to pins) So you have to copy registers containing *_TC0_* = and replace TC0 to TC2. Plus PC25 and PC24 should be set ...
KIIV's user avatar
  • 4,752
1 vote
Accepted

Reading Two Quadrature Encoder using a single Arduino Due

According to Quadrature Decoder QDEC for SAM3/4 Devices_ApplicationNote_AT11483 and referenced excel sheet with Device to No of QDEC channels it seems to have two of them. However in DUE almost none ...
KIIV's user avatar
  • 4,752
1 vote

Problem Atmel Studio 7 with uploading

...Specify a programmer using the -c option and try again For Arduino, the programmer switch must be -c arduino. The full arguments for avrdude, in the Atmel Studio 7 External Tools window, are: -c ...
Flanker's user avatar
  • 529
1 vote

Atmel studio 7 - my own libraries

You should create your library as a separate project: File->New->Project and select C or C++ static library: Add your library modules in this project. When building, this will create lib{...
Flanker's user avatar
  • 529
1 vote

In Linux how do I start up Atmel Studio

https://mil.ufl.edu/374/docs/Install_Atmel_Studio_7.0.pdf : Note for Mac and Linux Computer Users If you have a Mac (i.e., a Macintosh computer from Apple) or if you use Linux, you will need an ...
hong tong's user avatar
1 vote

Arduino Due with Atmel Studio 7

I just encountered this. After looking at other examples in the compiler command line options, it looks like it should be $(LinkerScript) instead of ($LinkerScript). In Atmel Studio, go to project ...
Dan Twaddell's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible