All Questions
74
questions
0
votes
1
answer
44
views
LCD Entry Mode Set and AVR MCU
I want to simulate **the Entry set mode ** function of and LCD based on HITACHI 44780 Controller.
(Here is the datasheet.)
The "Entry set mode" is given the following code of the 8 bits data ...
0
votes
1
answer
41
views
AVR assembly indirect addressing: "Found no label/variable/constant named …"
I am currently trying to indirectly address the SRAM of the ATMega328P by using the following code:
...
1
vote
2
answers
478
views
Assembly: AVR Studio alternatives for Linux [closed]
I had been using using AVR Studio on Windows to write assembly code for my MCUs (mainly for atmega8515) for a couple years. However, recently I transitioned to Linux and turns out there aren't any ...
5
votes
3
answers
1k
views
How can I do immediate addition in the Atmel AVR instruction set?
I've been doing some AVR assembly programming for a university course, and I recently happened upon a situation where I would have wanted an "add immediate" instruction. However, no such ...
1
vote
1
answer
476
views
Understanding assembly code for LED blink with ATmega328P
I wrote the following program to turn an LED on and off at 1-second intervals:
...
0
votes
0
answers
93
views
SPI interfacing a sensor doesn't seem to work
I'm trying to get a feeling for how the SPI protocol works. I built this cirucit using Proteus simulator.
simulate this circuit – Schematic created using CircuitLab
And then according to the ...
0
votes
0
answers
68
views
Using SUB with values higher than 128 in an 8 bit system
how does the SUB instruction work in AVR assembly? does it take the twos compliment and add it or does it function differently? If I subtract two 8- bit numbers, say 1 - 2 and the answer is -1, should ...
2
votes
1
answer
144
views
Strange ATmega32 behavior with assembly code
I posted a kind of similar question recently, but it was not that organized, so here I am trying again :)
I wrote this short assembly code to blink an LED at different intervals depending on the state ...
0
votes
2
answers
170
views
Problem interfacing stepper motor with Atmega 32
I have been trying to interface a bipolar stepper motor with an ATmega32 controller using AVR assembly, but it just keeps clicking without movement or just move back and forth in the same step.
Here ...
0
votes
2
answers
314
views
AVR "OUT" function. addressing port without constant
I am currently writing some assembly code that needs to address different I/O ports at certain times in my code. For example, at one point I may want to address PORTD4, and at another point I may want ...
0
votes
1
answer
74
views
ST instruction of avr in microchip stuio (avr studio) nor working as expected
I am trying to understand indirect addressing in avr and tried the following code :
ldi r31, 0x28
ldi r26, 0x2c
ldi r27, 0x00
st X+, r31
when r26 and r27 are ...
0
votes
1
answer
631
views
Going below the bottom of the stack in ATmega328P
I'm working with an AVR based project and just have one curiosity.
The ATmega328P has total 2kB of SRAM. The lowest address of the stack can be 0x8FF. Now suppose the stack pointer is at 0x8FF. What ...
0
votes
0
answers
127
views
AVR Assembly - Operations with two 8-bit registers in 16-bit two complement negative values
I have this code in which I try to multiply the given number by 4. I have two variants and that is that it is negative and positive, but it doesn't work for negative values, you don't know why?
...
0
votes
2
answers
790
views
0
votes
0
answers
93
views
How to assess worst case runtime and correctness of an assembly implementation?
Set off by a question on CodeReview, I revisited "8-bit AVR unsigned division".
Trying much the same as for below 8 bit/8 bit → Q, R implementation, I found assessment of cycle counts of an &...