|John Haine||08/08/2020 11:08:36|
|3270 forum posts|
Thanks Joe - there are a couple of pics of my first clock in my albums, one before it was cased the other in its case (but with a horrid reflection in the door window).
6186 forum posts
As a next step, I suggest tabulating the design requirement. (Andrew mentioned the importance of the overall design early on.) In particular inputs and outputs.
Before setting up a bare board or attacking a Nano with bolt cutters it's best to understanding what the circuit and external hardware must do, designing software & hardware together to minimise power consumption. Leaving out the power LED is obvious and safe, but other notions need a little thought. For example, bad ideas might include:
I emphasise might because it all depends on the application. A simple switching application could be easy to power save; other code may be tricky! An Arduino advantage is it comes with all this stuff switched on and the processor is in a safe configuration. Beginner programmers don't need to worry about particulars, great except ease of use wastes power. Programmers who shave microamps become responsible for managing gory under-the-bonnet detail, which can be advanced stuff.
All do-able though, and interesting. Please keep us posted. I'm sure someone will help if you get bogged down in an unexpected complexity.
Edited By SillyOldDuffer on 08/08/2020 13:07:54
|455 forum posts|
as a sometimes Arduino user I'm always interested in such stuff. However, all is not so easy. I managed to install the Atom editor, and then tried in vain to cooperate it with PlatformIO. What I now have, if I start Atom, is a black screen with a menu bar. There is also a menu point for PlatformIO. But after say a minute I get the message 'editor isnot responding.
|Andy Stopford||08/08/2020 20:20:21|
|36 forum posts|
Posted by Joseph Noci 1 on 08/08/2020 08:21:54:Posted by Andy Stopford on 07/08/2020 20:53:10:
Just a couple of points:
Lastly, do yourself a favour and ditch the Arduino IDE - there are much better, easier to use alternatives, with full code completion, hints, colour coding, etc.
I use PlatformIO; it's available as a code editor plugin. I like the Atom editor, but you can use it with VSCode, and, possibly, others.
I just spent near 2 hours digging into 'PlatformIO'...I think its a little presumptuous to just tell folk to 'ditch' the Arduino IDE...
In the two hours I could not fine what the minimum software overhead is when running this system on 'my' board - is there a bootloader? What size is it typically? How does it affect run-time measurements?..
Steady on Joe, I'm just venturing my own opinion; people are free to make of it what they want. You will find many complaints regarding the Arduino IDE in the Arduino forums. It does not make life easy for the beginner, which surely is the point (and was my own experience when I first got an Uno).
As it happens, I totally agree with you regarding the PlatformIO website. It's a model of corporate BS which seems designed show how much money they can afford to waste on some wacky web developer with a mission to put interested punters off.
However to make it clear - it is just an IDE, like the Arduino one, but with some bells and whistles to make it easier and more convenient to use. It doesn't run on your board, it doesn't have a bootloader, though it could be used to install one in conjunction with one of the Nick Gammon scripts I linked to.
|Andy Stopford||08/08/2020 20:35:34|
|36 forum posts|
It looks like there might be a problem with the latest version of Atom (always a possibility with actively developed Open Source stuff), see this thread:
As suggested in the 3rd to last post there, it might be better to use the VS Code version, which being a Microsoft product, is likely to be more reliable than Atom. I shall have to look into that.
Anyway, in either case, it will compile and upload your code in the same way as the Arduino IDE, and it has a Serial window which you can read, interact with, etc if required, again like the Arduino one.
6186 forum posts
Like Hans I've tried PlatformIO and run into the same problem. Not easy to set up is it? The advantage appears to be support of multiple Frameworks and Boards from a common IDE, but it's a steep learning curve particularly when installation fouls up.
I went through the list of supported editors looking for one I liked. Unfortunately none of my favourites are there apart from vim, not my first choice for an IDE. Anyway atom is respectable, and it would make installing PlatformIO easy - except it's broken. Tried a couple of other editors but they lack the IDE integration offered by atom, and presumably vscode. As linux is my preferred platform I'm not keen to add a Microsoft editor! Or to learn Eclipse, Netbeans or one of the other big alternatives. The Platform.IO CLI works in so far as I've tested it, but it's not a beginner tool,
The Arduino editor may not be the most advanced, but it works and is straightforward to learn. The IDE is workmanlike rather than spectacular but it organises boards and libraries in a fairly obvious way and makes uploading easy too. For most simple purposes it's fine.
I'm not finding PlatformIO's documentation easy to penetrate. For example, what happens if I want to program a Nucleo? The documentation mentions a 'Bare Metal Proflle', a subset of the OS6 RTOS. I guess from the outline of JSON configuration details that full mbed can be set up and configured but I'm finding it hard work compared with both Arduino IDE and MStudio. Not clear how much is built-in and how much has to be configured.
I've not spotted a 'must have' reason to change so far. Not given up yet - I'll try vscode tomorrow. Advantages may appear when I get to compiling and uploading. For example my current project runs on both Arduino and Nucleo, with the Nucleo version based on a copy. Be nice to write and manage both as a single project, but I don't imagine many beginners are into that kind of code management.
|1581 forum posts|
I am a big fan of Micromites and as Bazyle says - they can be programmed to run at a (battery saving) slower speed or simply put to sleep - all under programme control. The 28pin PIC32 chip only needs an external capacitor to give you a complete working system programmable in MM Basic - the PIC32 chip required is under £4.00 - the s/w being free to download.
At full wack (48Mhz) the '170 ' chip will typically be drawing just over 30mA but you can programme the CPU clock speed and at 5Mhz the current draw is about 6mA.
You can also tell the system to "sleep" for a number of seconds or to go to sleep but monitor the "wakeup" pin - the current draw will then fall to about 100 micro amps. So for battery-powered embedded systems, Mites are very useful little creatures.
Micromite Basic has been ported to other systems - and if low power consumption but with more 'grunt' is required - the 'Armmite F4' based on the STM32F407VET6 board would be worth looking at. You can purchase these STM boards for about £12 and they have a fast ARM Cortex chip with more memory & I/O.
So whilst Arduino is very popular, there are very good (but lesser known) alternatives and the Micromite family is one of the best for embedded solutions in my view.
6186 forum posts
Final report on PlatformIO which I have working on Ubuntu 20.04! Took a couple of hours to sort out install glitches:
Conclusions. I can see why Andy likes PlatformIO but it isn't a beginner tool. Too many advanced options. vscode and platformio are both fairly intuitive, but suffer from a surfeit of choices. The software is generous with warnings, errors, hints and popups, just what an experienced programmer needs when hunting down awkward problems, but likely confusing noise for a beginner happy to have the editor jump to his suspicious code. An old conundrum: should a development tool give the programmer the full gen, or should it hide details because most of them are irrelevant? I prefer the latter, only looking at gory details when necessary.
Good stuff - being able to put projects into github, code checking and support for boards galore, plus ability to add you own. Code checking, ie highlighting issues that don't cause compile failures, might lead the beginner astray. Tells me correctly that atomicElementTime can be reduced in scope, but incorrectly flags functions setup() and loop() as unused. Trouble is they are!
My approach to software development varies. I quite often use vim, make and the command line as if it were still 1980. kate (or geany) are much used as a sort of semiautomatic-IDE for C,C++ and Python projects. The Arduino-IDE is great for Arduino, less satisfactory for some other boards. idle is good for small Python projects. For mbed I've experimented with Cloud, MStudio, and command line approaches. At the moment MStudio is ahead on points! I don't care much for full IDEs like Netbeans or Eclipse because they're over the top for what I do.
If I could only have one approach on a Desert Island it would be the old-fashioned command line tools because they can do everything! But they ain't easy to learn or use - most of the time simple projects are best done with simple tools. Learn to fly in a Tiger Moth, not a Jumbo Jet
Meanwhile, I shall explore PlatformIO further. I've certainly not rejected it.
|Andy Stopford||09/08/2020 20:24:51|
|36 forum posts|
Atom/PlatformIO seems to work now if upgraded to version 1.49.0. Mine wasn't set up to automatically update and was still on V 1.39. I used the method shown on this page:
And followed the instructions to add the repo for my OS (OpenSuse 15.1).
I've had another look at (VS-) Code, and I think Atom is more user-friendly (or at least less user-hostile).
It's a tricky one, simplicity v. all-singing, all-dancing complete solution. Much of the time I think poor documentation is the problem, as you've mentioned.
Of course, in the world of 'real', physical devices, simple isn't necessarily easier; my first lathe was one of these*:
It's a lathe, it turns, faces and screwcuts, but with no graduated dials, thread-dial indicator, on-off switch(!), etc., it wasn't exactly an ideal beginner's machine. Character-building, you might say.
* If the link disappears, it's a rather agricultural flat-belt driven machine by Brown Brothers of Great Eastern St., EC, dating from around 1900(?). Mine didn't have the power cross feed, countershaft or most of the other accessories.
|duncan webster||09/08/2020 20:35:13|
2734 forum posts
Well off topic!
I can go older than that lathe. When I first worked on R&ER the lathe used for turning wheels was a real relic, it had been donated to the R&E by the GWR in the early 1920s (they had a director in common, Sir Aubrey Brocklebank). It didn't have a cross slide as such, more like a double decker topslide. Not over good for big facing cuts, but OK for wheels.
When the time came to pension it off it was offered to MOSI and Science Museum but neither would pay for transport so it was weighed in
Edited By duncan webster on 09/08/2020 20:35:47
|1581 forum posts|
I think you've just summarised very well why I don't use anything this complicated SoD.
I'm not a professional programmer and never will be. These things might suit someone with the right background but I don't have the time to spare. Simple suits me better.
6186 forum posts
Not on my machine! I'm on Ubuntu 20.02 and "sudo snap install atom --classic" installs 1.49.0
Atom works as expected and other extensions load correctly - just PlatformIO that crashes. Probably a temporary glitch in the package.
I like Atom's clean look and feel, but it's main selling point isn't for me at the moment. It's integrated with git, perhaps the best way of sharing & developing version controlled code in collaboration. But I'm a singleton programmer, occasionally sharing code on a small scale with Forum friends, so github's advantages are wasted on me.
General point about choosing tools is understanding they all have advantages and limitations. I find the Arduino IDE well suited to simple 'just me' microcontroller projects, but professionals would likely need more control, especially if they're a team! PlatformIO is in that class. Thanks for mentioning it.
Please login to post a reply.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.