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)

5
votes
3answers
773 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
120 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
60 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
47 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
124 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
0answers
25 views

ELAN EM78P156NP SAMPLE PROGRAM [closed]

Can anybody please share a sample program for ELAN EM78P156NP microntrollers in C or Assembly language? Or any link where I can find sample programs for the same microcontroller.
3
votes
3answers
107 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
46 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
74 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
51 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
45 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
72 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
77 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
59 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
98 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
166 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
92 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
98 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
277 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
101 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
125 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
213 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
110 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
28 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
227 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
101 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
90 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
145 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
140 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
257 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
484 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
265 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
155 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
171 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
117 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
194 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
98 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
103 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
245 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 ...
1
vote
0answers
85 views

AVR8 assign bit in assembly

I want to simply assign (copy) a bit in the IO register from some other register bit (or flag, or as a result of some comparison). Now I am using following (...
2
votes
1answer
106 views

Moisture Senstive Devices - Shelf Life

I have a bag of DAC7512N digital to analog converter from TI. They are still sealed in the original packing, however the caution notes denote "calculated shelf life in sealed bag: 24 months" and the ...
1
vote
1answer
479 views

Error: constant value required while compiling with avr-as in linux

Im trying to compile the following simple assembly program but there is a problem with the compiler that i cannot find its reason and fix it. So here is the code : ...
0
votes
1answer
211 views

Error in PORTB pic18f2550

I've read most of the datasheet, but have not found a solution. Why is PORTB on my PIC18F2550 only accepting a maximum value 3? My code is: ...
3
votes
3answers
420 views

AVR and bootloaders - where to begin?

I have the need to write a bootloader program on an AVR microcontroller (Atmega32) in order to enable self-programming. I have read various resources on the topic of bootloaders and have come to the ...
0
votes
2answers
134 views

Programming microcontrollers in ASM or C & how it's done

Just to clarify on these topics: If I were to program a microcontroller in ASM I would use an assembler, of course. The assembler would compile the code into opcodes (machine code?)(generally 1:1 ...
15
votes
3answers
785 views

From C to Assembly

Suppose that we have the following piece of C code for an avr-8bit: int v1=1; int v2=2; v2=v2+v1; I expected the following disassemble ...
1
vote
1answer
891 views

How to set all flags in 8085?

My Microprocessor teacher of 8085 gave an assignment to set all flags ! I have written this little program to set all except Sign, Please help me out ...
6
votes
2answers
1k views

What actually is a shadow register?

I noticed the term Shadow Register while going through a datasheet of a TMS320F28335 DSP. What does it actually mean? Does it have a physical location in the CPU as ...
0
votes
1answer
112 views

AVR: ASM multiplication label with 2

In the example below: ldi ZL, low(2*label) ldi ZH, high(2*label) label: .db "Hello world", 0 lpm Why multiplication label with 2 is needed? I understand that ...