0

I want to use the Ino command line toolkit to build and upload my HEXes. It works well for the regular Arduino, however when I try to upload code to a Mini Pro 3.3V at 8 MHz, the code has the timing wrong. The serial output is garbled (I tried at different baud rates and was garbled each time) and delay(1000); seems to take double the time. I have selected the correct board (pro328 in my boards.txt), but it didn't seem to make a difference in the generated code. Has anyone used this and encountered a similar problem?

4
  • You have to set the correct value for F_CPU (i.e. 8000000). – Gerben May 13 '15 at 19:04
  • Where should I set that value? Is it a compiler define that's not taken into account by Ino? – rslite May 13 '15 at 22:05
  • Normally it's set in boards.txt. – Ignacio Vazquez-Abrams May 13 '15 at 22:21
  • Well it is set in boards.txt if you look at the pro328 settings that I mentioned. I'd like to find out where that is used in the arduino code and how can I make sure Ino will use it. – rslite May 14 '15 at 3:00
1

Per the Quick start guide, Ino assumes the board is an Arduino Uno unless otherwise specified on the command line:

All examples were done in assumption that you have Arduino Uno and it is available on default port. Now consider you have Arduino Mega 2560 and it is available on port /dev/ttyACM1. We have to specify this for our build steps as command-line switches.

Board model may be set with --board-model or -m switch. Port is set with --serial-port or -p switch. So lets do it:

$ ino build -m mega2560
$ ino upload -m mega2560 -p /dev/ttyACM1
$ ino serial -p /dev/ttyACM1

For the full list of board names refer to ino build --help.

So you might be able to do this by using

$ ino build -m pro328
$ ino upload -m pro328 ...

However I don't know what options Ino includes for boards (presumably it uses the boards file), so using ino build --help should give you the information you need to select a suitable board if pro328 doesn't work.

Once that's done, the frequency setting should be taken care of for you.

2
  • The think is I use that board. I tried both in command line and in the settings file and it didn't seem to work. In the meantime I found out about platformio which I'm evaluating and on which it works correctly. – rslite May 14 '15 at 17:15
  • @rslite - the pro comes in both 5v 16 MHz and 3.3v 8 MHz version, to get the correct clock for the latter you will have to specify that and not the 16 MHz version. This is exists in the current boards.txt but it is unclear what the ino syntax for it would be. – Chris Stratton Oct 12 '15 at 5:11
0

So it seems the F_CPU should be set up at compile time and I'm not sure if Ino does that or not (probably, or I'm missing something else).

However after pulling my hair for a day or so I discovered PlatformIO which has a much better functionality - my code works correctly, the lib manager is intriguing, is platform independent and seems it doesn't even require the Arduino environment to be installed (it can pull the required files itself).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.