Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [microcontroller]

A device which includes a central processing unit (CPU), memory, and (generally) an assortment of I/O peripherals (UART, ADC, DAC, general-purpose I/O, I2C, etc.) in a tightly-coupled standalone package.

184
votes
13answers
241k views

What's the difference between a microcontroller and a microprocessor?

What's the difference between a microcontroller and a microprocessor?
165
votes
16answers
79k views

Is C++ suitable for embedded systems?

A common question, here and elsewhere. Is C++ suitable for embedded systems? Microcontrollers? RTOSes? Toasters? Embedded PCs? Is OOP useful on microcontrollers? Does C++ remove the programmer too ...
95
votes
5answers
8k views

Can microcontrollers be run at arbitrarily low clock frequencies?

The datasheet for the ATTiny13A, for instance, lists Min frequency of 0 MHz. Does this mean the clock can be run at any arbitrarily low frequency with no ill effects? I'm assuming it draws lower ...
92
votes
10answers
29k views

Why are there no 256-bit or 512-bit microprocessors?

In an 8-bit microprocessor its data bus consists of 8 data lines. In a 16-bit microprocessor its data bus consists of 16 data lines and so on. Why is there neither a 256-bit microprocessor nor a 512-...
83
votes
6answers
47k views

What is the difference between a DSP and a standard microcontroller?

I understand that a DSP is optimized for digital signal processing, but I'm not sure how that impacts to the task of choosing an IC. Almost everything I do with a microcontroller involves the ...
77
votes
11answers
13k views

What's the cheapest way to link a few microcontrollers wirelessly at low speeds over short distances

What's the cheapest way to link a few microcontrollers wirelessly at low speeds over short distances. I'm looking to keep it ultra-cheap, use common discrete parts and keep it physically small. I don'...
65
votes
11answers
8k views

How can anyone use a microcontroller which has only 384 bytes of program memory?

For instance a PIC10F200T Virtually any code you write will be larger than that, unless it is a single purpose chip. Is there any way to load more program memory from external storage or something? I'...
64
votes
8answers
12k views

Why aren't FPGAs ubiquitous?

Reading about FPGAs, if I understand correctly, they are basically fully configurable logic gate circuits. Being this, one can design anything with them. One can design everything in the most ...
57
votes
5answers
7k views

What exactly fries the chip when you invert power supply?

From my own experience, burning microcontrollers is quite easy. Put the 5V at ground, GND at VCC and in an instant your chip is burned. What exactly goes on internally that causes it to stop ...
55
votes
9answers
5k views

RTOS for Embedded Systems

I have seen many articles that tell me I should be using RTOS for time management and resource management. My time has not permitted my own research, so I come to chiphacker for advice. I use low ...
54
votes
6answers
53k views

When is a MOSFET more appropriate as a switch than a BJT?

In my experimentation, I've used only BJTs as switches (for turning on and off things like LEDs and such) for my MCU outputs. I've been repeatedly told, however, that N-channel enhancement-mode ...
50
votes
3answers
87k views

What is a boot loader, and how would I develop one?

I've met many projects in which an AVR microcontroller uses with a bootloader (such as the Arduino), but I don't understand the concept very well. How can I make a bootloader (for any microcontroller)...
50
votes
5answers
4k views

Can I cut an IC?

As far as I understand, the die of a DIP package is located at the center and the rest is just the lead frame. Given that I have unused pins, can I cut the top part of this microcontroller (ATmega16/...
49
votes
5answers
40k views

Programming microcontrollers: JTAG, SPI, USB oh my!?

I've noticed, with regards to microcontrollers, there are several way to program them. I am sorta familiar with USB as my Arduino's can be programmed via USB. What is a JTAG or SPI interface? ...
48
votes
7answers
36k views

How do I measure a negative voltage with a ADC?

I am working with a PIC micro-controller with inbuilt 10bit ADC and want to measure a voltage in the range of -1 to -3Volts. I thought of using an op-amp in the inverting mode to make voltage positive ...
47
votes
20answers
76k views

What is a good microcontroller for Ethernet applications?

What is a good microcontroller for doing Ethernet applications? Or do I just need a good Ethernet library to connect with an Ethernet MAC/PHY?
46
votes
5answers
7k views

Microcontroller shelf life

Our purchasing department requested the AT32UC3B1256 and the supplier has a few thousand in storage. However, those trays have a date code from 2009. While shelf life is normally not much of an issue ...
46
votes
16answers
54k views

Why use PLC instead of microcontroller?

Why does everyone use PLCs in industrial environments, instead of a microcontroller based solution? For a longer task, the PLC program is as complicated as a microcontroller program. A ...
45
votes
3answers
83k views

Push-pull/open drain; pull-up/pull-down

I am reading the datasheet of an ARM Cortex chip, specifically the GPIO chapter. Ultimately, I want to configure various GPIO pins to use them in "Alternate Function" mode for read/write access to ...
42
votes
4answers
11k views

Why does TI have so many microcontrollers?

I am working on a project with a group and I am responsible for the digital part of the project, so I will be writing the code. To go from Analog to Digital, I have to choose a microcontroller. I was ...
42
votes
9answers
6k views

Using volatile in embedded C development

I have been reading some articles and Stack Exchange answers about using the volatile keyword to prevent the compiler from applying any optimizations on objects ...
42
votes
8answers
6k views

How to choose a MCU platform? [closed]

There are numerous MCU platforms and once somebody has gotten used to one, they are generally reluctant to switch to another platform. My question is: If one started using a MCU for general purpose ...
42
votes
3answers
4k views

Minimum operating temperature - Outer Space?

I've been looking at some microcontrollers and I've seen they've got some "weird" minimum operating temperatures, like -25 degrees or -10 degrees etc. But I can't really understand why there is a ...
42
votes
5answers
11k views

Why don't microcontrollers generally have on-chip DACs?

In this answer I read that microcontrollers usually don't have DACs, while they do have ADC. Why is that? edit I appreciate that integrating resistors like in an R-2R DAC is expensive in terms of ...
41
votes
5answers
52k views

When to use pull-down vs. pull-up resistors

After learning and experimenting with microcontrollers, I've understood the concept of pull-up- and pull-down resistors. I now understand when and how to use them, and how they work. I've mainly used ...
40
votes
18answers
13k views

What are good microcontrollers available today? [closed]

I have experience with assembly and C programming for microcontrollers, but I'm not familiar with the various MCU and DSP families offered by today's companies. (eg: Texas Instruments, Atmel, Renesas) ...
38
votes
5answers
16k views

Why are things like RESET/MCLR active low on most ICs?

Convention? Easier to implement? Another reason? Is there a reason things like MCLR or RESET on microcontrollers are active-low, that is, you have to pull them down to reset the IC, and pull them ...
38
votes
8answers
19k views

Why do microcontrollers have so little RAM?

Maybe this is more of a perceptional problem, but it seems like microcontrollers have advanced by leaps and bounds in the last 20 years, in almost all regards, higher clock speed, more peripherals, ...
37
votes
14answers
8k views

How can I measure the RPM of a Frisbee?

I'd like to make a little device I can stick onto a Frisbee that could measure stats such as RPM/speed of the Frisbee when thrown. Would this be realistically possible? I was looking into near-field ...
37
votes
7answers
3k views

How do I make sure my electronics design is good from manufacturing perspective? [closed]

I am a beginner in electronics design. I have some experience with fairly complex PCB design. I want to design a product that will hopefully sell a lot. How do I ensure that the design is inexpensive ...
36
votes
4answers
10k views

How to synchronize two microcontrollers to micro-second accuracy?

I need to synchronize two micro-controllers so that they can measure the speed of propagating waves. The time delay measurements need have microsecond accuracy (error less that 1/2 of a microsecond). ...
36
votes
8answers
18k views

Why are relays so frequently driven by optocouplers?

Since the advent of the many microcontroller development boards, like Arduino, there have been a number of relay modules sold to drive mains AC loads. A lot of these seem to use an optocoupler, ...
35
votes
13answers
6k views

Have microcontrollers replaced simpler ICs?

Is it still worthwhile to learn, for example, how to tune a 555 timer with resistors and capacitors, when you can write a timer program for a microcontroller in a human-readable programming language? ...
35
votes
5answers
80k views

FPGA's vs Microcontrollers [closed]

I've worked on the Arduino family (specifically the Sanguino), built a few simple devices and a simple phototrope. I am thus pretty comfortable with microcontrollers - specifically Atmel's. I'm ...
34
votes
4answers
3k views

Who receives the value returned by main()?

I know that in computers, value returned by the main() function is received by the operating system. But, what happens in the ...
33
votes
6answers
9k views

Why does hardware division take much longer than multiplication?

Why does hardware division take so much longer than multiplication on a microcontroller? E.g., on a dsPIC, a division takes 19 cycles, while multiplication takes only one clock cycle. I went through ...
33
votes
15answers
1k views

What microprocessor for experimentation?

I harbor a secret fantasy (oops, not so secret anymore) to build a simple computer from scratch. I'm looking for an easy-to-use microprocessor to start with. I know about the usual suspects such as ...
32
votes
7answers
10k views

In what situation should I keep the Brown-out Detection feature OFF on a microcontroller?

When the power supply on a microcontroller falls under a certain threshold, a brown-out conditions occurs and RAM memory may get corrupted. Provided that every power down sequence of the circuit can ...
32
votes
2answers
26k views

Selecting a MOSFET for driving load from logic

I'm looking to drive a magnetic door lock from an Arduino. I've found a question about driving a solenoid from an Arduino, which includes a circuit that looks perfect for this kind of situtation: ...
32
votes
2answers
46k views

STM32 Understanding GPIO Settings

In STM32 Standard Peripheral library, we need to configure the GPIO. But there are 3 functions which I not sure how to configure them; GPIO_InitStructure.GPIO_Speed GPIO_InitStructure.GPIO_OType ...
31
votes
3answers
9k views

What's the catch with FRAM?

After recently acquiring an MSP430 Launchpad I've been playing with various microcontroller projects. Unfortunately, the MSP430G2553 only has 512 bytes of RAM, so doing anything complex requires ...
30
votes
2answers
7k views

A PCB for a Drone

I'm making a drone, and would love if somebody can review my work on the PCB layout. Image (red is top, blue is bottom, circles indicate holes and side transfers purple is glue): What is supposed to ...
29
votes
8answers
19k views

Why do Microcontrollers need a Clock

Why do instructions need to be processed at set time intervals (i.e. with the use of a clock)? Can't they be executed sequentially - immediately after the previous instruction has completed? An ...
29
votes
9answers
9k views

What happens when an embedded program finishes?

What happens in an embedded processor when execution reaches that final return statement Does everything just freeze as it is; power consumption etc, with one long ...
29
votes
11answers
17k views

I'd like to learn how to make my own USB gadgets

I've been writing Linux character device drivers for other people's stuff for some time. I'd like to find a new hobby and the thought of making my own USB gizmos seems really neat. I would be ...
29
votes
11answers
11k views

Is it possible to physically destroy a microcontroller with software?

Assumptions: No external circuitry connected (other than the programming circuit, which we assume to be correct). uC is not faulty. By destroying I mean releasing the blue smoke of death, not ...
29
votes
2answers
4k views

What are the RAM-only microcontrollers intended for?

While looking for some detailing on part number construction for Texas Instruments's MSP430 series, I came across this wiki page: TI MSP430 There is a statement, "L" as in the MSP430L09x series, ...
29
votes
2answers
13k views

How can I detect a power outage with a microcontroller?

I have the following power supply configuration: AC MAINS -> UPS -> 24V POWER SUPPLY -> 5V VOLTAGE REGULATOR -> PCB (microcontroller). What's the best solution to detect the power outage on the mains ...
28
votes
10answers
21k views

When can FPGA's be used and Microcontrollers/DSPs not?

I have to choose between a course on advanced microcontrollers and a course on advanced FPGA's. I have had introductory courses in both subjects, and what troubles me now is that I am already pretty ...
28
votes
4answers
11k views

Reason of multiple GND and VCC on an IC

What is the reason that most of ICs (e.g. MCU) has multiple (A/D)GND and (A)VCC pins? If it is to increase performance of an IC, how does it help to performance? or is it easier for the IC designer ...