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 [programming]

Questions about programming parts (FPGAs, Flash, etc.) Many software programming questions should be asked instead on Stack Overflow.

166
votes
16answers
80k 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 ...
51
votes
5answers
41k 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? ...
29
votes
3answers
45k views

FPGA programming, where to begin

I'm a software developer (C, C++, objective-c, java ...) and I am interested in learning to program FPGAs. Now the question may appear simple to you but please do take time to help me on this one as I'...
23
votes
2answers
30k views

What is bit banging

I am new to microcontroller programming. I am using ATmega32-A controller and CodeVisionAVR compiler. I am using the waveform generator(AD9833) to generate a sinewave signal using SPI communication. I ...
22
votes
10answers
30k views

Programming languages for electronics engineers

I am an Electronics and Communications Engineering student, before I got to college, I have been interested in programming and computer applications. I had focused on designing Windows applications ...
20
votes
5answers
4k views

Survey of High-Level Language Interpreters/Compilers for Microcontrollers

I would like to generate a list of high-level language interpreters and compilers (e.g. something that compiles LISP to C code) for microcontrollers. I've done a bit of research so far that I will ...
18
votes
5answers
71k views

How different are 8-bit microcontrollers from 32-bit microcontrollers when it comes to programming them

Right, so we have 8-bit, 16-bit and 32-bit microcontrollers in this world at the moment. All of them are often used. How different is it to program 8-bit and 16-bit micrcontrollers? I mean, does it ...
17
votes
3answers
31k views

Which programming languages are supported to program Arduino?

I would like to start to play with Arduino. I've read that C and C++ are the official languages but I've also found other way to communicate using Python or Java for example. Which programming ...
16
votes
7answers
6k views

Is it possible to draw circuits through code?

Is there a better way not by writing netlist files. something like: ...
15
votes
11answers
3k views

Why is Embedded Strictly C/C++ [closed]

I didn't like this question since it can't be easily answered but perhaps I can rephrase: "What keeps Embedded from changing languages?" For instance, we pretty much see C/C++ for embedded (I think i'...
14
votes
10answers
6k views

Do Electrical Engineers use microcontrollers? [closed]

I've always loved to program, and I just recently became interested in electronics and programming microcontrollers. It is very fun, but I am wondering if I am learning something useful that can get a ...
12
votes
8answers
5k views

Functional Programming with MCU(s)

Functional languages like Haskell, LISP, or Scheme allow a programmer to work quickly using the functional programming paradigm. They do have their inefficiencies, but my application places greater ...
12
votes
5answers
3k views

Cycle counting with modern CPUs (e.g. ARM)

In many applications, a CPU whose instruction execution has a known timing relation with expected input stimuli can handle tasks that would require a much faster CPU if the relationship were unknown. ...
12
votes
3answers
8k views

How to Sleep Arduino

How do you program a sleep mode for your Arduino? Especially for battery powered designs, what are good techniques for sleeping the CPU but waking up only when needed?
11
votes
3answers
3k views

How do companies pre-program chips?

In particular I'm interested in SMD packages. A DIP package I would assume is simply put into a socket and programmed that way. Of course you could get around this by designing a programmer header ...
11
votes
5answers
17k views

LTSpice Automation

I have a battery-powered boost converter and I'm attempting to measure the maximum input (battery) voltage droop under various load conditions of high current draws (different duty-cycles/...
11
votes
2answers
1k views

Inbuilt flash memory size not enough

I am using TM4C1230C3PMI controller from Texas instrument in one of my project. It has 32KB of internal flash, which is not sufficient for my application. Higher flash sized micro-controller are ...
11
votes
5answers
8k views

Freescale Kinetis KE - writing to flash

I've been using various microcontrollers and microprocessors for many, many years now but I seem to be stymied by the Kinetis KE series (specifically the S9KEAZN64AMLC). Jan 17, 2015 TL;DR: ...
11
votes
2answers
4k views

Is it possible to program an Arduino in other languages?

Is it possible to program an Arduino with other languages that aren't C/C++ based? What would be required to do so? I know that other IDE's are available, I'm curious about actual programming ...
10
votes
4answers
1k views

ICSP or Pre-Programmed Microcontroller

I've designed a PCB for small scale production; currently I'm hand soldering them in batches of 20 at a time. This PCB uses an ATMEGA168 microcontroller which I program before soldering to the board - ...
10
votes
8answers
2k views

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

I've programmed the Arduino and have started programming the Teensy. They are similar to C but there are slight nuances in the programming language. For instance, in Arduino's C you call a function ...
10
votes
1answer
395 views

Can you program a surface mount IC with flash memory and then reflow solder them?

I know that many chips, such as the ATMEGA328P-AU list flash storage lifetimes at certain temperatures, but they usually cap out at 100° C. I know that, ideally, one should include leads on their ...
9
votes
5answers
13k views

ATTiny13 — avr-gcc Hello World uses over 100 bytes?

I'm trying to write a program for the ATTiny13. My problem is that it has huge size constraints. Well, when making my first Hello World program, it took 100 bytes of program space just to make a light ...
9
votes
4answers
2k views

FPGA - DIY Programming

I've been programming microcontrollers for a few years now, and I've just discovered FPGA's after taking a digital design class. After doing some research into different FPGA's, development boards, ...
9
votes
2answers
1k views

What is the physical representation of the heap and the stack?

I can easily understand how .bss and the code have physical representations in the processor which has a memory bank for the instructions that a program counter can count up and the bss (block ...
9
votes
3answers
9k views

Using multiple external interrupts in PIC

I've used PIC16F877 (datasheet) for several projects. For a single external pin change interrupts, you can use PORTB0 interrupt. ...
8
votes
7answers
66k views

How do I write to SPI flash memory?

I'm working on an audio application where instead of storing audio data on an SD card (Waveshield on Arduino) I'm storing it on an SPI flash memory IC and rolling my own board with MCU, DAC, and amp. ...
8
votes
7answers
57k views

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

I have built my own board with STM32F7-45VGT6. I have successfully programmed it with ST-LINK v2 (not the original one though) and now I cannot even connect with MCU. I use ST-Link Utility from ST ...
8
votes
3answers
15k views

How do I program a PIC12?

I have a PIC12F675 that I need to program. I'm using a Pickit 2 and the Pickit 2 software. Supposedly I should be able to program it using this circuit, but the Pickit 2 software is not detecting the ...
7
votes
8answers
3k views

Embedded C programming material

I am looking for some material (books/sites) related to embedded system programming in C language. Here in the lab we have available three plataforms: one Microchip PIC18f4550, one Freescale HC12 and ...
7
votes
9answers
76k views

Programming an ATmega328 with Arduino bootloader via a FTDI USB-serial adapter

I would like your advice relating to using the Arduino IDE and avrdude to program an ATmega328 which is preloaded with an Arduino bootloader. I am using a USB to TTL-serial breakout board based on an ...
7
votes
5answers
6k views

What causes turning ON a single output pin on Microchip PIC16F690 to spontaneously turn OFF another pin on the same port?

What causes turning ON a single output pin on Microchip PIC16F690 to spontaneously turn OFF another pin on the same port? I can work around this problem by writing a byte to the entire port, ...
7
votes
5answers
2k views

How to start reverse engineering a circuit?

I have an old controller card from a pc which had to control some stepper engines. But there are several problems with it: The pc isn't working anymore, and I have no access to the program which ...
7
votes
6answers
13k views

Failed to get Device ID - PICkit 3 & PIC16F684-ICD & AC16205

Like it is already mentioned in the title I have question regarding this dev stack: MPLAB X IDE v1.80 PICkit 3 PIC16F684-ICD (datasheet) AC16205 There is image of how things are connected (I don't ...
7
votes
3answers
4k views

Better workflow in Atmel Studio 6 for building and transferring program

After having modified my code in Atmel Studio 6, I write the program to my MCU in the following steps: Click Build or F7 Click Device Programming or Ctrl+Shift+P Click Apply (to choose programmer+...
7
votes
2answers
683 views

Embedded programming state machines

I am looking at implementing a non-trivial finite state machine (specified as a UML hierarchical statechart) on a 32-bit MCU with gcc. Are there any rules of thumb what works better and what works ...
7
votes
2answers
16k views

How different is the Arduino language than Atmel Studio language? [closed]

I see that on the official Arduino website, the reference page contains the functions and vales you would use specified to the Arduino compiler. http://arduino.cc/en/Reference/HomePage What would ...
7
votes
1answer
7k views

Possible to re-program microcontroller over Bluetooth?

I am looking at making an embedded design featuring an ARM Cortex M3 MCU and bluetooth. I would like to be able to update its firmware over Bluetooth periodically. Is this possible with the following ...
6
votes
5answers
5k views

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

I'm not sure whether this question has been asked before, but in researching my question, I came across this user's post (at If-else decision structure using op amps or any other non-programmable ...
6
votes
5answers
2k views

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

I want to make a circuit using logic gates that prints a message on the LCD display (2 X 16). Any idea? I want to know how to do this "by hand". like the old days. Can I build a circuit out of ...
6
votes
2answers
1k views

ISR - to flag or not to flag?

From what I read on the internet we should respond to interrupts as quickly as possible, when programming microcontrollers; and that flags should be avoided because they tend to compound over time. ...
6
votes
5answers
288 views

Programs resistant to hardware issues

I recall at one point reading about embedded development where the programmer took into account things like memory corruption and possibly other hardware issues. For example: If an instruction in ...
6
votes
5answers
1k views

How to think while working with VHDL or Verilog

All of my experience belong to general purpose programming languages e.g; c/c++ etc where each instructions are executed one after the other but it seems in VHDL/Verilog, all the instructions are ...
6
votes
2answers
825 views

Why are there more than one programming channels on PIC32?

Previously, I was working with PIC16 and PIC18 series, and none of them provided multiple channels for programming. Now, I am designing my first PIC32 circuit, and I'm very confused with these ...
6
votes
5answers
1k views

How to know usb connection is lost

I am working with AT90USB1287 controller with USB communication to PC. I am sending some commands from PC to controller using USB communication to activate some controlled switch. I am able to change ...
6
votes
1answer
250 views

Final steps in device manufacturing - AVR programming and board assembly

After I have prototyped my circuit and built AVR code for a device I want to sell, how do I go about getting mass production done? Will a PCB manufacturing and assembly shop be able to take the ...
6
votes
1answer
4k views

Why does my ATtiny13 report wrong device ID?

I am using an Arduino (with ATmega168) as an ISP programmer to program ATtiny13. When I try to do this, avrdude reports: ...
6
votes
1answer
391 views

An overhead of running program on Linux vs embedded bare-metal

Let's say I have some multi-core ARM Cortex-A. Now I have there a Linux, with RT_PREEMPT patch (so called real-time Linux). I run a processes with affinity set to one core and high priority (above 50)...
6
votes
1answer
1k views

Electronic Circuit Simulator API/Libraries

Are there any Electronic circuit simulator libraries/API that I can use to construct virtual circuit simulators like SPICE etc? My main research area is not Electronic simulation since I'm a Computer ...
6
votes
1answer
870 views

Multi-Device JTAG

I am designing a circuit. it will include ARM LPC1769 and AVR ATmega2560. I want to program these chips with JTAG. Now, the question is: Is that possible to do it with a single JTAG programmer ...