S
S
Sergey2014-07-08 12:21:22
Arduino
Sergey, 2014-07-08 12:21:22

How to port an Arduino sketch to a real device on a similar chip?

I bought an Arduino with the goal of making a very specific device. Since everyone is well aware that this is a prototyping platform, I additionally bought a separate microcontroller, well, and all the harness, intending to assemble everything more compactly, but use the ready-made program with Arduino.
After a detailed inspection of the Arduino, it turned out that porting the finished code (which I have not had time to write yet, and this seems to be for the better) is not a trivial task. Arduino's libraries provide many conveniences, but even an empty sketch has a significant output size.
It is clear that using code written for Arduino "in combat" is at least not the Unix way. Maybe there is a way or at least a manual for porting code from Arduino's libraries to usable on real hardware?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
svd71, 2014-07-08
@Livich

A programmer is being built / bought (probably on another ardurin), the flash and erprom dump from the sketch arduino is merged and written to a new chip.
Although there is a menu option in the Arduino environment - "save to file" or something like that, for programming individual crystals with a real programmer.
Googling on "AVR programmer" will give you a bunch of options.

V
Vladimir, 2014-07-09
@noonv

The Unix way is to program in pure C.
But the prototype can also be assembled on Arduino;)
There is also no problem pulling out a hex file for flashing the controller via SPI ( using the same Arduino).

V
Vitaly Pukhov, 2016-01-19
@Neuroware

You can go the other way, when building (compiling) the project, the Arduino IDE converts the sketch into a regular cpp file that is already being compiled, you can take this same cpp and use it in another environment (winavr, etc.), naturally, part of the code is not ported, because . just those "a lot of garbage" will have to be deleted and written from scratch again (because in arduino it's just already done for you), in the end you will get the same thing as it was, but with a bunch of glitches because you wrote a bunch of your bikes. In practice, if you do not squeeze 102% performance out of the crystal and fit perfectly into the allocated memory (which most likely is), there is no point in abandoning the arduino. Naturally, I wouldn’t advise hanging up an uno-type board in prom (although there’s nothing terrible in this), if you wish, you can pour everything the same into a separate crystal on your board.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question