Tagged Questions
3
votes
2answers
76 views
Use PWM and ISR at same time on AVR
Is it possible to use AVR PWM outputs and ISR interrupts at the same time?
I've got a project I'm trying to do on an ATMega328P and I need 3 PWM outputs but ALSO need to be able to use ISR interrupts ...
2
votes
2answers
135 views
Understanding volatile class fields in AVR C++ programs
I'm having some confusion about what members to declare volatile in a program I'm writing in C++ for an AVR microcontroller, with interrupts. When it's plain C it makes sense - the compiler doesn't ...
3
votes
1answer
9 views
4
votes
2answers
13 views
How can I control things without using delay?
I have always hated that you couldn't do other things unless you used the delay(); function. However, I want to blink a LED or do whatever while using serial, but ...
3
votes
1answer
154 views
AVR Measuring frequency using external interrupt - where are my cycles going?
I'm using an external interrupt to measure the frequency of a signal, the AVR clock is at 8MHz. I'm essentially counting the ticks between pin toggles using a 16 bit timer (with some handling for ...
5
votes
2answers
311 views
AVR interrupt service routine not executing as fast as expected (instruction overhead?)
I'm developing a small logic analyzer with 7 inputs. My target device is an ATmega168 with a 20MHz clock rate. To detect logic changes I use pin change interrupts. ...
6
votes
2answers
260 views
Any reason not to use Timer0 on AVR?
Just a basic question... For arduino/avr/ATMega328 I find lots of examples using Timer1 (there's even a whole library for it) but rarely any that utilize Timer0 (or Timer2).
Now, I know that using ...
6
votes
1answer
253 views
Time Base ISR Concurrency
This is sort of a "classic" problem, and I think I have a solution, but I want to vet it with this community. I am building a project using the ATtiny88 microcontroller, and I'm programming in ...
3
votes
1answer
528 views
Determining which pin triggered a PCINTn interrupt?
Am I correct in thinking that if you have two pins causing the same AVR PCINT interrupt, (e.g. PCINT0 vector caused by either PCINT0 or PCINT1 pins -- I think the naming overlap of vectors and pins is ...
3
votes
2answers
301 views
Can't set to Fast PWM OCRA mode
Trying to have Fast PWM mode when TOP == ORCA.
Works fine with OCA toggle (measuring correct frequency), but doesn't work in ...
0
votes
2answers
125 views
Repeating the same interrupt in AVR
Suppose, AVR microcontroller is handling an interrupt. Interrupts disabled. At this time the same interrupt occurs. Will microcontroller handle the interrupt again after return from the first handler?
...
0
votes
1answer
156 views
Arduino stop RGB fading (3rd party library) at interrupt
Using the following code, the fading process only stops after a full cycle has been run (as predicted). What would be the optimal way to stop the color cycling when the interrupt is called (so I can ...
1
vote
2answers
602 views
Arduino UNO Timer issue
i seem to be facing a weird issue here. First time working with AVR timers. Basically what I am trying to achieve is to set timer2 (with prescaler val @ 1024) and use CTC mode (with val 78) to get 5ms ...
4
votes
1answer
547 views
Modifying Interrupt Vector Table of Atmega32
A project that I'm working on involves a cycle accurate interrupt service routine. This routine is written in AVR Assembly where I just wrote:
...
4
votes
2answers
353 views
Moving the code and interrupt locations in Arduino
I need to be able to choose between two Arduino apps running on an atmega 1280 (megaavr) at boot time. Therefore I need to move one of those apps to a different location in program memory, and I need ...
4
votes
1answer
628 views
Overflow interrupt firing only once
I've run into an issue where, it appears, my interrupt only fires once, then simply refuses to fire again on my ATMega32U2. I have the following (stripped down) code:
...
2
votes
1answer
490 views
How to implement a synchronization signal with AVR (attiny45)?
In pseudocode I want to do following:
...
3
votes
4answers
1k views
Arduino interrupts for button input
I have 6 buttons on my printed board, and I'd like to use interrupts on them all, but they don't correspond to the interrupts listed on the specs.
Is it true that you cannot choose arbitrary pins to ...
6
votes
1answer
2k views
Handling timer overflow and compare interrupts in ATMega328 (Arduino)
I'm trying to simulate PMW mode on multiple pins in software by controlling a Timer2.
I'm using maximum prescaler value to get approximately 60 pulses per second when timer counts to its maximum ...
5
votes
2answers
685 views
Teensy USB Interrupts
I'm trying to learn about interrupts using one of the Teensy USB boards. It's got an AVR AT90USB1286 chip on it. I'm using the code below, and I'm expecting my ISR block to get called and periodically ...