Hello, after many hours of researching and finally giving up I decided to ask directly how to use assembly code alongside the Arduino code (like the analogWrite function, for example).
The reason for this is I need to enable timer interrupts while keeping the functions delay() and delayMicroseconds() available, mainly because one part of the code has to run as fast as possible while other parts need a 2 second delay between each line of code.
Aditionally, using millis() and/or micros() makes my code too slow.
So, if anyone would be a as kind as to answer the following questions I'd be really thankfull:
1.-how do I declare I'm using ASM code? 2.-what's the ASM code to enable timer interrupts on an ATMEGA328P? (I'm using an Arduino Uno) 3.-how do I declare the function which contains the code to be executed during the interrupt?
Hope someone can help me out, thanks for reading.