# Tag Info

### MCU programming - C++ O2 optimization breaks while loop

The code optimizer has analyzed the code and from what it can see the value of choice will never change. And since it will never change, there's no point in ...
Accepted

### Why do we need a bootloader separate from our application program in microcontrollers?

A bootloader on a microcontroller is responsible for updating the main firmware over a communication channel other than the programming header. This is useful for updating firmware in the field over ...
• 955
Accepted

### Why do microcontrollers need a programmer device?

That's what the programmer does. It takes the binary output from the compiler and stores it in the MCU's Flash EPROM, usually over a serial bus. Flash EPROM requires a programming algorithm to store ...
• 18.5k
Accepted

### Create Circuit Simulation

I wrote the simulation engine that powers CircuitLab from scratch: from the sparse matrix library up through component models and simulation modes. My co-founder wrote the front-end. It ended up being ...
• 3,389

### Why do microcontrollers need a programmer device?

A programmer is the implementation of " via specific bus,". Some devices have inbuilt bootloaders (may be hardware or software or firmware) that allow the use of a port of some sort to load ...
• 143k
Accepted

### STM32 & ST-LINK - Cannot connect to MCU after successful programming

I managed to solve that problem. If anybody encounters similar problem, here's what I've done: I used ST-Link v2 and ST-Link Utility. In setting, I set "Connect under reset" and SWD ...
• 1,537

### Is it possible to draw circuits through code?

If you are familiar with $\LaTeX$, you can use circuitikz to draw nice circuits by writing code. Example. More Examples
• 8,177

### Do Electrical Engineers use microcontrollers?

Q: Do Electrical Engineers Use Microcontrollers? Yes. Absolutely. From simple toys to complex manufacturing processes and robots. It is not a skill that will hurt you to know. Learn as much ...

### Why do we need a bootloader separate from our application program in microcontrollers?

So that the loading process can recover from errors. Suppose there is a communication error or power disconnects during an upgrade. If the boot loader were part of the application you were upgrading ...
• 10.2k
Accepted

### Inbuilt flash memory size not enough

You cannot extend the program memory (flash). TI produces the same chip with double the flash and RAM, but nothing else changed: TM4C1230D5PMI. If you cannot use a chip with larger flash, you will ...
• 1,132

### How can I estimate the speed of this code section for this microcontroller?

Since the code snippet you're interested in isn't big, you could disassemble your compiled code, look at all the assembly instructions and count how many cycles they need. You can find the number of ...
• 713

### ICSP or Pre-Programmed Microcontroller

If you have the space for a header, that's probably the best option, and the slightly staggered pins Majenko recommends is a good way to hold a connector in place without adding complexity. But here'...
• 66.1k

### Why do microcontrollers need a programmer device?

transfer it to specific place in flash memory via specific bus This is exactly what flash programmer devices do. They just don't use something slow and archaic like RS232, but instead nowadays ...
• 14.3k
Accepted

### What does a function mean that doesn't have "void", "int", etc in front of it mean?

The functions are interrupt handlers, defined using the ISR(vector, attributes) macro. The macro generates a proper platform-specific function signature, including ...
Accepted

### ICSP or Pre-Programmed Microcontroller

I would suggest always including a header in that kind of quantity (small). If you get to larger quantities you can consider pads for pogo pins (you'd have to make a fixture to hold the PCB in ...
• 335k
Accepted

### Do you typically need to program-in a USB communication protocol?

Like any protocol stack, USB incorporates components representing various layers. High-level drivers and libraries provide higher-layer functionality on top of lower layers, effectively abstracting ...
• 14.5k

### Can an operational amplifier circuit be made entirely out of diode Nand and Nor gates?

Can An Operational Amplifier Circuit Be Made Entirely Out Of Diode Nand And Nor Gates? This apparently simple-enough question is somewhat ambiguous and can be answered several ways. Spehro has ...
• 143k

### Is it possible to drive a 2 X 16 LCD display using logic gates? (Without computer)

It is possible to make a circuit out of logic gates that would be able to initialize and display characters onto a 16x2 LCD character mode module. It is also possible to make a circuit out of logic ...
• 55.4k

### Does each microcontroller line have its own programming language/syntax?

The language in this case is exactly the same. The Arduino environment happens to have some extra libraries (just more C code) that 'wrap' the access to the actual hardware registers (DDRx, PORTx, ...
• 39.8k

### Is it possible to draw circuits through code?

Check out SKiDL (https://github.com/xesscorp/skidl), this is along the lines you're thinking. Edit (as req'd): SKiDL allows procedural description of all circuits (rather than just digital), instead ...
• 7,309

### ICSP or Pre-Programmed Microcontroller

I always add space for an ICSP header, even if it's not populated. I have three ways of doing it at the moment depending on situation. One of my designs has a very fine pitch header for which I have ...
• 55.5k
Accepted

### Is the datasheet of the AVR ATmega32 wrong?

If the system clock is 16 MHz and the prescaler is 256, you timer will run on $\large \frac{16\,MHz}{256} = \small 62500\,Hz$ , so there will be an increment in every \\$ \large \frac{1}{62500\,Hz} ...
• 6,265

### How can I estimate the speed of this code section for this microcontroller?

Let's do it! Say we have the code ...
• 330

### Is it possible to draw circuits through code?

Many programs can draw a schematic. None that I know of can draw a good schematic: One that emphasizes the most important information, and arranges the circuit in a clear and easy to understand way. ...
• 121k
Accepted

### MCU programming - C++ O2 optimization breaks while loop

(Cross site duplicate on SO about the thread case, rather than interrupt/signal-handler case). Also related: When to use volatile with multi threading? A data race on a non-...
• 1,279

### PIC12F675 GP4 doesn't work

You have configured the PIC to output the internal clock signal on GP4 using #pragma config FOSC = INTRCCLK Replace INTRCCLK with INTRCIO.
• 335k

### Do Electrical Engineers use microcontrollers?

This particular job may not, but the product would likely include a microcontroller and perhaps be controlled by a more powerful embedded system. Note that it mentions 'troubleshooting' (but not ...
• 335k

### How come Misra C checker is such a prestigious tool?

A MISRA-C checker is much more than just a style checker; it enforces a set of software development guidelines for the C programming language developed by MISRA (Motor Industry Software Reliability ...
• 47.1k

### FPGA - DIY Programming

Yes, it would work just fine. Actually, the development tools for most FPGAs allow you to program the external flash directly through the FPGA's own JTAG connection, eliminating the need for a ...
• 165k