Questions tagged [microcontroller]

This tag is related to questions that have something to do with a microcontroller. A microcontroller is a simple or small processor often with its program and execution memory on the same chip with input/output pins for controlling other hardware. Please specify the microcontroller and compiler or tools related to your question.

This tag is related to questions that have something to do with microcontrollers in general. A microcontroller is a simple or small processor often with its program and execution memory on the same chip with input/output pins for controlling other hardware. Microcontroller programs are embedded programs often talking directly to hardware registers without using an operating system. Microcontrollers are generally resource limited, program space measured in bytes, kilobytes or megabytes, processor clock speeds often in the kHz and tens of MHz range.

3656 questions
13
votes
2 answers

Building a two-part firmware image using GCC toolchain

I have some firmware built with GCC that runs on an ARM Cortex M0 based microcontroller. The build currently generates a single binary image that can be written into the program memory of the microcontroller. For reasons to do with field update, I…
Martin L
  • 1,016
  • 9
  • 12
13
votes
5 answers
12
votes
5 answers

In Microchip C18, why does the insertion of a NOP cause much larger code?

I have some code in an ISR. The code is given for completeness, the question is only about the commented-out __asm_ block. Without the __asm_ block, this is compiled into 82 instructions. With the __asm_ block, the result is 107 instructions long.…
AndreKR
  • 32,613
  • 18
  • 106
  • 168
12
votes
6 answers

Alternative to writing masks for 32 bit microcontrollers

I am working on a project that involves programming 32 bit ARM micro-controllers. As in many embedded software coding work, setting and clearing bits are essential and quite repetitive task. Masking strategy is useful when working with micros rather…
gbudan
  • 889
  • 7
  • 17
12
votes
3 answers

Initializing SD card in SPI issues

I've had a look at Stack Overflow question Initialization of a microSD card using an SPI interface and didn't see any answers that matched my issue (that is, things I haven't already tried). I have a similar issue where I'm trying to access a SD…
Sembazuru
  • 451
  • 1
  • 3
  • 10
12
votes
4 answers

is it possible write to console without stdlibs? c/c++

I am programming on an arm microprocessor and am trying to debug using print statements via UART. I do not want to add stdlibs just for debugging. Is there a way to print to the console without stdio.h/iostream.h ? Is it possible for me to write my…
Sam
  • 238
  • 3
  • 14
11
votes
12 answers

Call tree for embedded software

Does anyone know some tools to create a call tree for C application that will run on a microcontroller (Cortex-M3)? It could be generated from source code (not ideal), object code (prefered solution), or at runtime (acceptable). I've looked at…
Ron
  • 840
  • 2
  • 8
  • 15
11
votes
1 answer

How do I know where the .data section needs to get the init data from? (gcc linker)

When building a gcc based bare metal mcu project you need to take care of the initialization of the .data and .bss sections during startup. The .bss section is quite easy since I just fill the entire section to 0. But variables in the .data section…
Johan
  • 20,067
  • 28
  • 92
  • 110
11
votes
4 answers

What are some available software tools used in testing firmware today?

I'm a software engineer who will/may be hired as a firmware test engineer. I just want to get an idea of some software tools available in the market used in testing firmware. Can you state them and explain a little about what type of testing they…
LEMUEL ADANE
  • 8,336
  • 16
  • 58
  • 72
11
votes
3 answers

Defending "U" suffix after Hex literals

There is some debate between my colleague and I about the U suffix after hexadecimally represented literals. Note, this is not a question about the meaning of this suffix or about what it does. I have found several of those topics here, but I have…
Joey van Hummel
  • 400
  • 2
  • 12
11
votes
4 answers

CRC16 checksum: HCS08 vs. Kermit vs. XMODEM

I'm trying to add CRC16 error detection to a Motorola HCS08 microcontroller application. My checksums don't match, though. One online CRC calculator provides both the result I see in my PC program and the result I see on the micro. It calls the…
Potatoswatter
  • 134,909
  • 25
  • 265
  • 421
11
votes
2 answers

STM32F3 Discovery - Implement GPIO-Interrupt

I want to implement a GPIO-Interrupt, but I dont know how, I also found no real sample or explaination for it. I already know how to write to Pins, but not much more, please consider that I dont really have any knowlegde about c or programming…
Meister96Fels
  • 508
  • 1
  • 8
  • 26
11
votes
7 answers

Are there any current non-Harvard architecture microcontrollers?

I have used and like the Atmel ATMEGA and ATTINY series microcontrollers, and think them quite good. One thing I am not terribly fond of though is the fact that they (and Microchip PIC uC family also) are all Harvard machines, meaning I can't really…
Chris D.
  • 639
  • 2
  • 8
  • 18
11
votes
8 answers

Arduino millis() in stm32

I am trying to port some Arduino library to stm32. In Arduino, millis() returns the number of milliseconds since boot. Is there an equivalent function in stm32? I am using stm32f0 MCU.
user6064424
11
votes
7 answers

What is the difference between microprocessor and microcontroller?

One difference is microcontrollers are usually designed to perform a small set of specific functions whereas microprocessors are for huge, general functions. Anything else??
vandanak
  • 1,122
  • 3
  • 11
  • 13