Questions tagged [assembly]

Refer to the assembly (or assembler) language.

Filter by
Sorted by
Tagged with
3 votes
1 answer
333 views

Arduino Uno R3 assembly code to push a button and turn on a LED

I've been trying this for days without success... I need to turn on a LED on portb when a button in portd is pushed. Cabling works, I've tested it with Arduino IDE and it works like a charm. This is ...
mcflurry's user avatar
-1 votes
2 answers
171 views

Arduino IDE. How do I use labels in a macro?

It's the Arduino Uno. I've spent hours reading on the internet but found nothing yet. If you use a label in the macro, the 2nd time it's called you get a duplicate label error.
John McDonald's user avatar
0 votes
1 answer
112 views

Does the bootloader use some SRAM?

I want to use all SRAM of an Arduino by writing the code in assembly. But does the bootloader use some SRAM while the program is running, and if the answer is yes would changing that data lead to ...
markoj's user avatar
  • 43
0 votes
1 answer
188 views

Is it possible to use assembly with arduino?

I want to learn assembly, but would like to learn by doing, is it possible to learn and make something useful with arduino hardware? I dont know where or how to start something like this.
Bruno Barros's user avatar
1 vote
1 answer
331 views

Blinking a led using assembly language at different frequencies using two push buttons

I want to blink a led using assembly language and arduino I want the circuit to have a normal state of 5 hz blinking frequency Then use two push buttons to increase or decrease the blinking frequency ...
Abbas Mohammed's user avatar
0 votes
1 answer
85 views

Parallel I/O - maybe use Machine code function call

I'm a newbie to arduino but been programming lots. I have a project where I would like to output 4 bits to adjacent pins and read 4 bits from another (4) adjacent pins. (Imagine a matrix keyboard ...
Dave's user avatar
  • 11
2 votes
1 answer
302 views

Loading code to a mega 2560

As part of my application, I need to be able to update the code on my mega 2560 in the field with a download from the internet. I have found this code in the AT Mega 2560 data sheet ;-the routine ...
Thom's user avatar
  • 173
0 votes
1 answer
226 views

LED Blink in assembly with timer1 output compare interrupt not working

I was trying to have some fun with avr-assembly on my arduino and I tried the following codes to blink my LED first I tried the ISR approach and when It didn't work I tried the CTC mode one, both ...
Mahmoud Salah's user avatar
1 vote
1 answer
718 views

How to add two assembly arrays in arduino

Hey guys what I'm trying to do is to sum two arrays and return a new array; for example if given uint8_t a[] = {2, 4, 6}; uint8_t b[] = {1, 2, 3}; I should get { 3, 6, 9} What I'm trying to do is ...
John Rawls's user avatar
1 vote
0 answers
2k views

How to use LCD display HD44780 with arduino without using any library

My professor wants me to implement a display to an old project prototype we had laying around on the lab. But he wants me NOT to use LiquidCrystal.h library or any other to achieve that. I read ...
Augusto Filho's user avatar
0 votes
1 answer
63 views

ESP8266 CCLOCK Odd behavior

I'm trying to write some extremely fast code for the ESP8266, so I'm trying to figure out how to time things. I've discovered CCLOCK, a register that reflects the number of clock cycles since startup....
Erhannis's user avatar
  • 103
1 vote
2 answers
505 views

Am not able to call C++ function pointers from inline assembly

Due to some curiosity, I was trying to use some assembly with my Arduino MEGA 2560. I am not able to invoke a function from a c++ function pointer array. When I uncomment the call function, func_a ...
darkspine's user avatar
  • 113
1 vote
2 answers
94 views

Weird assembly output

I was taking a look at the disassembly for a loop of mine that seemed to be taking too long and I found these assembly instructions that I don't understand. Why does it load 0 into r25 and then do two ...
Anubhav's user avatar
  • 137
0 votes
0 answers
221 views

how do i convert to assembly code (AVR assembly) from arduino

i have code in the Arduino ide for a temperature sensor that shows the temperature on three 7 segment displays, it shows the temperature to one decimal point. using an arduino uno. I am struggling to ...
dirshan ramlall's user avatar
0 votes
4 answers
4k views

How to use assembly in Arduino?

I have been assigned a university project to make a sound/audio responsive LED using assembly language. I have already wrote C++ code in Arduino that uses the Fastled library. How do I write working ...
COAL's user avatar
  • 19
2 votes
1 answer
2k views

How do I convert this program to assembly from c++

I am trying to implement a program in assembly code for an Arduino UNO. A potentiometer is used on an ADC pin for variable time (t). LED1 flashes for t seconds, then stays on for t seconds, then goes ...
user58745's user avatar
1 vote
1 answer
403 views

How to set PC (Program Counter) register to another function (for scheduler)

I am trying to implement a scheduler for Arduino Mega 2560. I think I lack understanding of how to set the PC register to another instruction. Here is my simple approach so far: void dummy(){ ...
Mustafa Otbah's user avatar
1 vote
0 answers
50 views

My alterate flashing LED program is not working

I am trying to program my Arduino UNO ATMega 328p in assembler to implement a flashing pattern with two LEDs. When one LED is off, the other must be on. I have made a program but it is showing errors ...
user58745's user avatar
0 votes
4 answers
4k views

I need help programming my arduino in assembly [closed]

I am new to using an Arduino and I am trying to program my it to implement a flashing pattern with two LEDs. When one LED is off, the other must be on. The program needs to be done in assembly. I have a ...
user58745's user avatar
0 votes
2 answers
74 views

Atmega collecting and relaying interrupt calls

I like to collect all possible interrupt and relay them to an alternative handler interrupt table what the user can set. In order to do this i have to: 1) collect all/any interrup request 2) ...
Dankó Dávid's user avatar
2 votes
0 answers
40 views

Low Level programming - MKR Fox1200

I'm working on a project using this board and wish to do so on a low level ,as in enabling certain registers to enable interrupts etc. I can't seem to find the correct header files to support ...
Patrick's user avatar
  • 21
0 votes
1 answer
2k views

Arduino button-controlled LED with AVR Assembly

I am trying to make a simple button-controlled LED, but I cannot seem to get any input from the button that would change the state of the LED. In other words, the program keeps branching to lighton, ...
Bgeo25's user avatar
  • 11
2 votes
1 answer
1k views

Trying to run Timer1 in ATmega2560 with assembly

I have a slight problem with Timer1 in arduino (ATmega2560) while coding it in assembly. I try to run the Timer1 in CTC mode - I configure everything well in my opinion, but the TCNT1 just doesn't ...
skorejen's user avatar
  • 123
1 vote
1 answer
620 views

Assembly for loop repeating 2 times when it's only suppose to do it once

I'm programming an Arduino Nano so I belive that this question should be qualified for this SE. I am trying to dim up an LED using a for loop in AVR assembly. My problem is that the cycle is ...
Dat Ha's user avatar
  • 2,913
1 vote
2 answers
279 views

Arduino IDE not compile .S program to board

After answering my previous question correctly I'm getting all sorts of errors when trying to compile the following program: I'm completely new to both assembly and the arduino IDE so I apologise in ...
CertainlyNotAdrian's user avatar
0 votes
1 answer
2k views

How to use arduino IDE to compile .s files

Hi I'm new to arduino and im using it to learn assembly for my computer hardware 101 class, I read online that I can make the IDE accept .s files and compile them to the board but I dont know how to ...
CertainlyNotAdrian's user avatar
1 vote
1 answer
124 views

using references to SFRs in gcc inline assembler

I want to write a driver that can use either timer0 or timer2, based on a choice made at compile time. So I want all references to timer registers to be abstracted, e.g. OCRA for OCR0A/OCR2A, etc. I ...
kuroi neko's user avatar
11 votes
10 answers
19k views

Different ways (and the fastest) to compute sines (and cosines) in Arduino

I am using an Arduino Uno board to compute the angles of my system (robotic arm). The angles are actually 10 bit values (0 to 1023) from the ADC, using the full range of the ADC. I am only going to be ...
Transistor Overlord's user avatar
2 votes
2 answers
1k views

How get assembler/preprocessed code for library

I am using https://github.com/sudar/Arduino-Makefile project with https://github.com/ladislas/Bare-Arduino-Project to compile my Arduino projects from Linux command line. I put as much as possible ...
gilhad's user avatar
  • 1,410
2 votes
1 answer
581 views

Using Arduino with Assembly on MacOS

I'm trying to use an Arduino UNO board with Assembly on MacOS, but I couldn't find any documentation about it. How can I compile and upload Assembly files to the Arduino with MacOS?
Dan's user avatar
  • 23
1 vote
1 answer
2k views

Controlling buzzer with assembly

I want to make a piezo buffer beeping with assembly code, but i haven't managed to yet. I have an Arduino UNO board (ATMega328p) and using avra and avrdude to build and load. The buzzer just stay ...
Frazzo's user avatar
  • 125
1 vote
1 answer
2k views

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

I am working to read two quadrature encoders using a single Arduino DUE, as part of my summer vacations project. According to the following link http://atmel.force.com/support/servlet/fileField?id=...
Masood Salik's user avatar
2 votes
7 answers
5k views

Building an AtMega328p from Transistors

I'm a little new to circuitry, and the Arduino in itself! From what I know, I think that it might be possible to actually build one (the processor itself, of course) from transistors. This isn't a ...
Dimitry M's user avatar
1 vote
1 answer
1k views

Force compiler to execute instructions sequentially?

Is there a way to force the Arduino compiler to compile individual commands sequentially? Looking at the disassembly, lines of the assembly code for different C/Arduino commands are mixed. I was ...
Alexandra's user avatar
1 vote
2 answers
2k views

Arduino PWM fading led in assembly

I'm writing Arduino UNO (=ATMega328P-PU) programs in assembly to save memory, so I use avra.exe (same as atmel studio's avrasm32) to compile and avrdude to upload, and simple programs like blinking ...
Frazzo's user avatar
  • 125
1 vote
1 answer
446 views

Working on a reaction test for the Arduino Uno using an led and an lcd shield

The situation involves some Asm inline practice and a basic circuit. The program turns an LED on after a somewhat random period of time then waits until the button is pressed to report back how many ...
Sam Kemp's user avatar
1 vote
2 answers
13k views

Make LED blink using AVR assembly

I have an ATmega328P Arduino and am trying to make the LED blink using assembly without any additional includes. The goal is to have it blink for 1 second on, then 1 second off, however, it blinks ...
Josue Espinosa's user avatar
2 votes
2 answers
5k views

How to update multiple outputs simultaneously

I need to update simultaneously all the outputs of a specific port. I am familiar with using micro-processors assembly language. After initializing a port (Data Direction Register), I can write to ...
Marla's user avatar
  • 600
2 votes
3 answers
398 views

Programing in Assembly for the Digispark

I've been given a digispark and am looking to write straight assembly code for it. Anyone know how to get started with this? I've been successful in getting the Arduino IDE set-up but would really ...
Jester Jeffrey's user avatar
1 vote
3 answers
606 views

How fast is an Arduino?

Can an Arduino Uno calculate the time that an assembly instruction will take in nanoseconds, not microseconds? I don't want to use a PC, because the calculation will be more accurate using an Arduino, ...
Gimy boya's user avatar
  • 113
2 votes
1 answer
805 views

Interleave Assembly and Source for avr-objdump

Trying to get avr-objdump to generate a listing that interleaves the assembly with the source code. I've tried a bunch of debugging arguments in different configurations but I can't seem to get it. ...
Ashlyn Black's user avatar
1 vote
2 answers
540 views

How is AVR Assembly in Eclipse or at Linux command line done?

I'm trying to learn AVR development in C and Assembly for the Arduino Uno (Atmel 328p microprocessor) in Linux. I've found many good guides on how to install and setup the AVR plugin for Eclipse, ...
hacke's user avatar
  • 11
1 vote
1 answer
433 views

Upload Assembly to AVR on a breadboard using Arduino as ISP

I try to learn assembly and use an arduino uno R3 to act as a programmer. i have build a standalone circuit with an atmega328p, can upload usual sketches (written in c) and have also sucessfully ...
BrainWorx's user avatar
3 votes
1 answer
4k views

Storing in a global variable using inline assembly

What I'm trying to do is pretty basic: I have a global variable and I'm trying to store some value in it (specifically, the SP_H and SP_L values). The variable is an array of structs and I'm trying ...
Mark's user avatar
  • 133
1 vote
1 answer
2k views

Arduino uno AVR assembly with LEDs

I am currently in an introductory assembly language class. My assignment is to use a sparkfun joystick shield kit to do something with an arduino uno. I figure turning on LEDs is the easiest. We must ...
Tim's user avatar
  • 11
2 votes
1 answer
4k views

How to create delays in AVR assembly language

Hi i'm new to AVR assembly language so i was trying to get delay function to create 1 ms , 100us, and 1us delays to do that i need to figure out what to replace nop's with below here (mainboard ...
user avatar