A compiler transforms code written in a source language to a (binary) target language.

learn more… | top users | synonyms

14
votes
12answers
4k views

Could you program a microcontroller without a computer?

Let's say you had a rather simple and small microcontroller and had no interfacing, no computer, no debugger, compiler, or assembler. Could you write your code in assembly, convert it (manually) to ...
1
vote
2answers
75 views

Why does MPLAB IDE has so many compilers?

I have learnt that the MPLAB IDE has different compilers like C18, XC8 and HI-Tech. I want to know the following things: Why are there different compilers when one can do the job? Are certain ...
0
votes
0answers
19 views

Zigduino Serial Communication works when programmed from Ubuntu but not Mac

So I have a zigduino which I am programming with TinyOS. I have tried programming TinyOS locally on Mac (10.10 Yosemite) and Ubuntu (14.10). It makes and programs fine using the command (on Mac): ...
2
votes
3answers
69 views

Courses about deploying Linux on embedded systems

I am a new grad student in EE and am trying to take full advantage of my time here at the uni. I have always wanted to understand how to get Linux running on embedded platforms, but from the outside ...
2
votes
3answers
272 views

Toolchains for STM32CubeMX IDE: what to choose from?

I just installed the STM32CubeMX (original ST Microelectronics's ARM IDE if I understand right). Once installed I tried to open a new project for a DISCOVERY kit I have (STM32F0DISCOVERY). Howether ...
-4
votes
1answer
57 views
7
votes
1answer
432 views

How does the call stack operated during an interrupt on AVR?

(Specific to the Arduino Uno...) What happens to the stack when an interrupt occurs on an AVR microcontroller and I call a function? Does the compiler inline the code? Does it cache the stack ...
1
vote
1answer
352 views

'undefined reference to' errors trying to compile with Make

I had a working Makefile that successfully compiled and built a basic program to toggle and LED on my stm32-h103 board. I have since attempted to add and use FreeRTOS in my program. I have added in ...
1
vote
1answer
76 views

Compilers for STM32F303x [closed]

Does anyone have any suggestions for C/C++ compiler/debugger for this chip, initially via ST-LINK on a Discovery board? I am currently using IAR EWARM but am not particularly happy with it.
2
votes
2answers
274 views

How can I bind a local variable to AVR's rXX register?

I need to have programmable pause with precision as high as possible. To accomplish this I have the following GCC code: ...
3
votes
3answers
173 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
1answer
686 views

Regarding Microchip XC8 compiler's registers and bits definitions

I'm going to take a random 8-bit Microchip microcontroller: PIC16F887. Let's have a look at how the XC8 compiler (and the HI-TECH PICC, for that matter) is defining a register (SFR) and its ...
0
votes
1answer
82 views

The MDK-5 (Keil-5) cannot build my project!

I'm trying to build my project but the MDK-5 give me this error: And also as you can see, in target you just can see Xtal. What happened? What's the problem?
1
vote
0answers
453 views

How can I stop MPLAB X from hanging between build and program?

I've been using MPLAB X and XC16 to build and program projects for a dsPIC 33EP128MC506 for about a year now. For the last two months, I've seen some new and unusual behavior on two separate machines. ...
1
vote
1answer
304 views

Purpose of ARM Linker Files

I would like to know what is the purpose of ARM scatter file and ARM Linker address MAP file ? How do they help in compilation and eventually during loading of the executable ?
2
votes
2answers
372 views

Using the arduino toolchain as a convenent way to get GCC - Can you disable the code-munging?

I've been using the Arduino toolchain as a extremely convenient way to get a complete GCC toolchain and build-system with basically zero effort a lot recently. However, I'm currently working on some ...
2
votes
1answer
268 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, ...
3
votes
3answers
217 views

Exact recreation of Xilinx FPGA binaries from source control

I'm software developer in a small shop where there's only been one EE guy responsible for a series of FPGA designs spanning a decade, almost all of which target the Spartan line, specifically the ...
2
votes
2answers
6k 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 ...
2
votes
0answers
212 views

dsPIC30F: Link assembler project with XC16 in command line mode

I have an assembler project that compiles and links fine with MPLABX. Now I am trying to build it from the command line. Attempt to use the command line from MPLABX fails. When I am calling: ...
1
vote
2answers
705 views

How does a specific pin in a port change its state (PIC Microcontroller)? Software vs Hardware

How does, for instance PortB.B0 = 1; command change the state of a specific pin in a microcontroller. Microcontroller usually has a 8 bit data line, meaning it will write and read from the entire ...
1
vote
4answers
881 views

PIC microcontroller memory limitations

I am trying to program a PIC10f202 using the XC8 compiler to compare the value of a timer to a variable which will be a function of a look-up table. Here is a sample code : ...
4
votes
3answers
2k views

Why IAR Compiler?

I just saw an Application Note from Atmel about how to compile some code in IAR and I wonder, why would anyone use an external compiler if Atmel already provides the Atmel Studio, with a Visual Studio ...
1
vote
1answer
122 views

How to change PORTx register in other place of program?(Codevision & AVR-GCC)

I have a question related to AVR microcontrollers using AVR-GCC and CodeVision: Normally we set the port related registers inside the main function using DDRx/PORTx registers, for example like this: ...
2
votes
2answers
1k views

Memory management problems with ATTiny85

The setup is as follows: I have a little program to drive single color 8x8 led matrix using 595 shift registers that are supplied with data by ATTiny85 through USI as SPI Master. I upload program to ...
1
vote
1answer
748 views

AVR-GCC: Ports Undeclared when compiling

My Setup I'm running Ubuntu 12.10, and I want to be able to use gcc and avrdude to compile and program my ATmega328. I followed this Ladyada tutorial: Ladyada AVR Tutorial Everything installed ...
1
vote
2answers
660 views

STM32 ARM header files for use with Eclipse and GCC

I'm a mechatronics (mechanical and electrical) engineering student and want to learn how to program ARM microprocessors. I've used Atmel ATMegas previously. I'm using a mac and being a student I ...
1
vote
1answer
124 views

Get bytes from a short long in C18

I'm using the C18 compiler and need to get the three bytes of a short long from MSB to LSB. I'd say I could use this: ...
3
votes
1answer
151 views

Integers >9999 in PIC C18

In this answer, I made a function to convert an integer to an ASCII string: ...
6
votes
5answers
2k views

Integer to ASCII in C18

I'm writing code for a PIC18F46K22 using the C18 compiler. I want to write the value of an integer \$n\$ in ASCII over the USART to my PC. For \$n<10\$, it's easy: ...
6
votes
3answers
4k views

How to discover memory overflow errors in the Arduino C code?

Several times I had some suspicious outputs on the Serial Monitor after uploading code to the Arduino: like eternal output of whitespaces or suddenly cut of strings or scrambled strings. Because ...
2
votes
2answers
140 views

VHDL code not compiling

I'm new to VHDL and I cannot seem to get my code to compile. I've looked over the code to the best of my ability, but I do not see anything wrong with it from my current basic understanding of how it ...
8
votes
3answers
2k views

Absolute address of a function in Microchip XC16

Device: dsPIC33FJ128GP802 I have some *.s files as follows ...
3
votes
3answers
856 views

Can I pass a bit register as a function argument in Hi-Tech C compiler for PIC16?

Is there a way to pass a bit from a PIC's register as a function parameter? Taking, for example, the PIC16F887, its registers (SFRs) and individual bits are defined as fallows in the corresponding ...
4
votes
2answers
877 views

If YOU were starting out now, what PIC16F-compatible IDE and compiler would you choose, and why?

This is going to be a bit long as I wanted to cover all the obvious questions before they arise, give a rationale to some of my thinking, and prove I've done my groundwork! If time is short, skip down ...
-1
votes
1answer
60 views

Adding a global int corrupts compiled code

I have a strange issue. I want to either increment a value every time the loop function is called or us a random value each time. Whether I use a global int for incrementing or set a local int to a ...
5
votes
3answers
431 views

ARM Programming interface and tool chain

I have acquired a RM48L952 that is an ARM Cortex R4F from TI and I would like to start learning ARM development with this chip. My question is can I use any JTAG programmer to program it? Something ...
2
votes
1answer
254 views

Compiling MSP430 files linking problems

I'm trying to compile a simple C file to later upload to my MSP430 uC but when I try to compile I get something that looks like a linking problem: ...
1
vote
2answers
570 views

Where can I start to program a S5PV210?

At the university I learn only the Microchip microcontroller, but I would like to improve my knowledge. I ordered a development board based on Samsung S5PV210. The manufacturer also provided a Linux ...
3
votes
1answer
338 views

Easiest way to get rid of __clz_tab in winavr compiled code?

I've ported a program from the arduino environment to a makefile build using winavr, which, in turn, is based on avr-gcc (just like arduino). However, my program started crashing, and after some ...
0
votes
1answer
290 views
2
votes
1answer
2k views

How does the Arduino IDE/build system work?

How does the Arduino IDE/build system work? I noticed that they use the avr-gcc in the background, but what do they do on top? They seem to have their own "kind of C" language that transforms into ...
7
votes
2answers
8k views

Programming for the Arduino without the Arduino IDE.. but with the provided libraries?

I recently started a new project using my Arduino that's been collecting dust for a while. Along with the physical board collecting dust, so has my copy of avr-gcc and the Arduino libraries. I can ...
8
votes
3answers
683 views

What does #if 0 do

Today I started to use MPLAB X to program my PICs, and found a code template, with multiple files and spots to fill in code. Before I have had a single file with my code in it. In this template, where ...
12
votes
2answers
1k views

Compiling code to run from external RAM

I am considering designs for a minimalist game system based on a PIC18F85J5. Part of my design is that games can be loaded from an SD card without reprogramming the chip or flashing the program ...
4
votes
1answer
538 views

Texas Instruments Compiler

I am working with TI's CC2533 SoC Low Power RF I bought a few chips and assembled a few PCBs.. Using TI's debugger I confirmed that I can send and receive packets using the basic RF using the ...
8
votes
5answers
2k views

Editable PIC Serial Number in HEX File

Currently I have a serial number hard-coded in my firmware for a design I'm working with. The firmware can read and report back the serial number. That works fine for what I need. The trouble is ...
13
votes
4answers
8k views

Is Code Sourcery G++ Lite still a viable project?

When I tried to download a newer version of Code Sourcery G++ Lite for ARM, I noticed that I was redirected to another company and it is really hard to find anything on that site about Sourcery G++ ...
1
vote
1answer
222 views

Breakout Boards and C-Compilers

I'm new to embedded programming and looking for advise on a couple things: I'm developing two "projects." One is based on Microchip's dsPIC33 series of micros and the 2nd project involves Freescale ...
1
vote
1answer
396 views

Developing a compiler and linker for embedded systems

Does anyone know some good resources (textbooks, papers, tools, etc) for developing a custom compiler and linker for a specific microcontroller?