Tagged Questions

This is a programming language that is at a low level that corresponds with the instruction set of the machine being programmed.

learn more… | top users | synonyms (1)

0
votes
1answer
35 views

XMega bootloader - How to use make use of the functions in assembly source file

Its been two days I'm trying to write a Bootloader for ATXMega32E5. The Atmel studio doesn't have boot.h header file supporting XMega. As a result of searching and ...
2
votes
0answers
47 views

PIC12F ADC conversion has an unwanted offset

The current setup is shown below. PIC12F1822 with a 10-bit ADC. I'm using a 250R 0.05% precision resistor to get a nice 0-5V input to the analogue pin (AN2 if it matters). As far as I can tell I ...
0
votes
1answer
57 views

How to calculate cache size?

A cache with a line size of L 32-bit words, S number of sets, W ways, and addresses are made up of A bits. Assume that the cache is word addressed, i.e., the low two bits of the address are ...
0
votes
1answer
43 views

Direct cache vs. associative cache

Trying to solve this problem where direct cache would outperform associative: Propose you have a cache with a line size of L 32-bit words, S number of sets, W ways, and addresses are made up of A ...
0
votes
1answer
63 views

5-stage pipelined implementation (RISC) of a microprocessor

I'm trying to solve two questions about a RISC 5-staged pipeline that is not exactly like MIPS found here (everything is included in this post). Consider the non-pipelined implementation of a simple ...
0
votes
1answer
52 views

ISA efficiency code compaction and memory traffic

I'm having issues understanding this problem and am new to ISA's. Here's a problem with 3 questions and my biggest question is, what is supposed to happen? Specifically, the HLL Code at the bottom. ...
1
vote
2answers
58 views

MSP430 Stack pointer and frame pointer behavior

While trying to analyze a simple Assembly file generated through the msp430-gcc, I stumbled upon a set of instructions that I don't understand dealing with the frame pointer and the MSP430's stack ...
0
votes
1answer
73 views

Numerical value in decimal of the 32-bit word stored at address 1000H

I'm a little confused how to tackle these three questions. Assuming two's complement arithmetic and operand alignment, give the numerical value in decimal of the 32-bit word stored at address 1000H ...
2
votes
0answers
52 views

What happens to AVR registers during multi-cycle instructions?

This is more of a theoretical question... (Also my first on Stack Overflow) I am wondering what happens to Atmel AVR microcontroller (i.e. ATTINY85) registers during a multi-cycle instruction. i.e. ...
1
vote
1answer
56 views

Assembly XMEGA program creating a longer than expected pin toggle?

I'm trying to do the fastest pin toggle possible on an XMEGA32E5 running at 32MHz. My code is as follows: ...
0
votes
2answers
54 views

Average Cycles Per Instruction

We have two different computers with the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. Computer M1 has a clock rate of 80 MHz and Computer M2 has ...
5
votes
3answers
846 views

Is this a correct way to have a 1 second delay?

If I have a PIC24 with a 4 MHz frequency. Is it accurate to have a 1 second delay by having 4 million clock cycles? I made a 1 second delay like this on my PIC24FJ128GA010: ...
1
vote
1answer
124 views

The PIC24F RETURN instruction

The PIC model I have is PIC24FJ128GA010. My question how many clock cycles does the RETURN instruction consume? The datasheet says 3(2), what does that mean?
2
votes
2answers
93 views

AVR microcontrollers, who initilizes assembly `data` segment and what is the purpose to have this directive?

I am new to assembly and microcontrollers and am trying to figure out how they work. Now, I have read a lot how in assembly text and ...
2
votes
0answers
76 views

32-bit unsigned binary integer to 8-bit BCD in AVR ASM for ATtiny. How to make it more efficient?

I wrote a program in AVR ASM for converting 32-bit unsigned binary numbers to 8 digit ...
1
vote
2answers
135 views

ATtiny2313 vs ATtiny84 software compatibility

I make and sell a variant of the USBtiny AVR programmer. It uses an ATtiny2313 clocked at 12 MHz and does bit-banged USB using hand-tuned assembly language (that someone else wrote - it's an open ...
3
votes
3answers
122 views

Frequently used functions, performance improvements using static variables?

Does defining variables (large arrays) as static inside a function have any performance improvements if the function is to be called repeatedly say in the order of seconds?
1
vote
0answers
61 views

Weird bug in MPLAB X IDE

When using the RTCC module in the PIC24F, we need to use the secondary oscillator (by setting bit #2 of OSCCONL register) and disable the write lock on the RTCC registers. Now the write lock can be ...
1
vote
1answer
106 views

Problem with the explorer 16 dev board

I have the explorer 16 dev board equipped with the PIC24FJ128GA010. I wrote a C code to write something on the LCD and a LED blinking after that. I wrote the same code in assembly and both codes work. ...
0
votes
1answer
64 views

pic18f instruction reference for XC8 Assembler

I found lots of tutorials online on PIC18 assembly programming, but i did not found any official document from microchip on PIC18 architecture and assembly programming. Can anybody share the link ?
1
vote
1answer
66 views

mpasm - overlapping variables in a udata directive

In MPASM it appears I can do this to make paylen_lo and bytesleft have the same memory location: ...
0
votes
0answers
166 views

Debug Assembly Code in Atmel Studio

I am using latest Atmel Studio to generate *.hex file from *.asm file. When I start to ...
1
vote
1answer
101 views

RSBMI instruction in ARM

as an exercise problem in ARM assembly program, I had to convert a number x to its absolute value. now seeing the problem as a simple problem of removing the sign of the respective number, I used BIC ...
0
votes
2answers
62 views

Avoiding multiple defines by using side effect of PIC banking

This is more a question of style than anything else and might strike some as a bad thing to do. If I have a serial port pin on RC4, say, I can make some defines to help out: ...
2
votes
1answer
136 views

PIC12 TRIS Register not setting, No GP0 GP2 output

I originally asked the this question on Stack Overflow. I think here would have been a better audience. I'm trying to program a PIC12C508A to do a simple LED learning circuit. I've read some ...
3
votes
2answers
208 views

Changing to relocatable code for PIC microcontrollers

I've come back to PIC programming after 10 years and I've been relearning everything. I'm looking at the section in the MPASM manual where it discusses relocatable code. And I've come to the ...
3
votes
1answer
131 views

avr-gcc timer overflow interrupt handler in inline assembly

My current project involves producing 200KHz PWM waveforms using timer 1 in fast PWM mode. I would like to increment a 16-bit counter every time the timer overflows (every 5μS) ...
2
votes
1answer
119 views

Number must be positive and less than 64

Im working with an ATMEGA328P, making a bit of USART code. I used asm linked with C, with no less than 7 building errors. All those were same "Number must be positive and less than 64". Yes, I have ...
2
votes
2answers
290 views

Tiny Code for dumping Flash Memory

I'm trying to write as tiny code as possible to extract the firmware of Infineon's XMC4500 microcontroller. The code must fit into a 30 byte buffer which allows me to have 15 machine instructions ...
2
votes
1answer
115 views

What's the issue in this LEDS blinking PIC18 ASM code?

I got to code the typical example of 8 LEDS turning ON and OFF, then all getting ON in a loop. I got a PIC 18F4550, and coded this: ...
1
vote
2answers
168 views

How to produce time delays in PIC18 ASM programming?

I'm a newbie with microcontrollers programming. I have a high level programming understanding but I'm getting involved in low lever CPU/Microcontrollers development. I want to do this simple exercise ...
1
vote
0answers
335 views

Obstacle detection using an ultrasonic sensor and a PIC microcontroller

I'm trying to detect obstacles at a specific distance using an ultrasonic sensor which is interfaced with a PIC micro controller. Ultrasonic sensor = HC-SR04 PIC micro controller = PIC16F628A ...
5
votes
3answers
125 views

Dump Flash Memory through a single GPIO pin

I'm working with Infineon's XMC4500 Relax Kit and I'm trying to extract the firmware through a single GPIO pin. My very naive idea is to dump one bit at a time through the GPIO pin and somehow ...
4
votes
1answer
29 views

How can I achieve a third interrupt priority level on 8052?

Most standard 8052 platforms allow the user to configure interrupts to be of two possible priorities: higher, during which any pending interrupt must wait, and lower, which can be interrupted by the ...
3
votes
2answers
253 views

Could an ARM (ARM7TDMI) Branch instruction take 6 cycles?

I have found an ARM Branch instruction appears to take 6 cycles to run on an ARM7TDMI processor. It seems it shouldn't be happening because in all references I've found, an ARM7TDMI branch instruction ...
0
votes
0answers
113 views

Cortex M3 GPIO Interrupt won't trigger

I have set a pin on a Cortex M3 to act as an rising-edge triggered interrupt and it's not firing for some reason. What it should do is receive a 1Hz pulse, trigger an interrupt and start a 12.8Khz ...
0
votes
0answers
114 views

PIC Assembly: Place to set external interrupt

I'm using keyboard to take input and make some manipulations with 7-segment display and timer. Basically I'm trying to implement a countdown timer. I use keyboard for inputting time to be counted ...
1
vote
1answer
198 views

Practical issue with PIC PWM

I have written the following code to generate PWM and to change the duty cycle when a button is pressed. In simulations it works fine. However when actually implemented the circuit, the PWM starts ...
1
vote
1answer
174 views

How to use an interrupt on Cortex - M3

I am trying to set up the chip so it will detect a rising edge on a pin then start outputting a square wave on the next pin over after that. I have the interrupt turned on but I don't know how to say ...
2
votes
1answer
326 views

Moving SP and PC using inline assembly in MPS430-GCC

I am writing a simple task scheduler for my MSP430F5529 USB launchpad. I need to update stack pointer(SP), then enable interrupts and then update program counter (PC). But I am getting an error with ...
4
votes
3answers
502 views

Is there any difference between the assembly instructions of ARM MCUs from two different corporations?

I'm curious to know, are there any differences between the assembly instructions of ARM MCUs from two different corporation? For example between an Cortex-M3/4 of NXP and TI or ST or other ...
1
vote
1answer
311 views

Using USB to Parallel Port, Send an 8-bit data of Assembly Code [duplicate]

For educational purposes, our professors have DB25 ports on our laboratory rooms, and of course we can only simulate our assembly codes in there Our professor said that it might not be possible to ...
0
votes
1answer
167 views

How to understand initialization and stack checking of ARM assembly language [closed]

I am trying to understand How bad a 'void main(void)' is from the following link: tech notes. But I have difficulties in understanding two assembly languages examples, the first one is shown below: ...
2
votes
1answer
213 views

ATmega2560 assembly pin read and compare logic problem

I apologize if my question was vague. Program: Atmel Studio 6 I am trying to make a program that enters an loop which it will only break out of when a pin goes low. ...
2
votes
1answer
138 views

IAR EWARM gives error on everything in startup_stm32

I'm trying to compile a project for school, which all my fellow classmates have no trouble compiling. This assignment is nothing more than dragging already written source code and compiling an, ...
0
votes
1answer
205 views

Force Cortex-M3/4 reset from assembly

I would like to force my STM32F4 to reset on fault, I tried to copy NVIC_SystemReset in assembly as : ...
1
vote
1answer
103 views

Processor directive in MPASM

I'm slightly confused about the processor directive in MPASM. Is it essentially the same thing as list? And what is the required value? If I take an example from the template file, f88temp.asm: ...
1
vote
3answers
103 views

How to force the shutdown of the PIC18 [closed]

I made a simple project, a "Hello World" test. The LED's light up, but when I turn the power off for the PIC18 they still stay on for a few seconds. I want to turn off the power to the PIC18 with no ...
0
votes
2answers
105 views

PIC 24F VGA array addressing instructions

In order to make a VGA driver for a PIC 24F microcontroller, I am generating an interrupt creating a VSYNC pulse, followed by a loop that puts data to the ports. HSYNC pulses are calculated after this ...
1
vote
0answers
264 views

Stellaris Launchpad: UART over GPIO PIN in ASM

I want to initialize and use UART on my LM4F120 Stellaris Launchpad in ASM. I found a reference code on how to to this on this ...