Author Topic: Best way to start moving away from Arduino?  (Read 11416 times)

0 Members and 1 Guest are viewing this topic.

Offline soggymushroomsTopic starter

  • Newbie
  • Posts: 2
  • Country: us
Best way to start moving away from Arduino?
« on: October 25, 2017, 09:10:48 am »
Like many other beginners, I currently use an Arduino as the core in most of my projects, but I know I'm sacrificing efficiency, price, and flexibility for ease of use with this approach. Apart from those shortcomings, it's just not as fun to hook up some stuff to an arduino and write some basic code to accomplish most tasks, it just feels like cheating sometimes. I'd like to shift to using microcontrollers other than the Arduino (the hardware and the software), or to not using any microcontroller at all and just discrete components when that is possible.

What's the best way for me to start getting familiar with utilizing other microcontrollers, and/or getting a feel for what I can and can't do without a microcontroller? I ask both in terms of the hardware and knowledge I would need to acquire for both of these tasks, particularly for other microcontrollers since there's just so many options and no definitive "best" answer like the Arduino is the best answer for the most easy to use hardware.

Any advice or tips appreciated.

Thanks,
Liam
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Best way to start moving away from Arduino?
« Reply #1 on: October 25, 2017, 09:30:11 am »
One microcontroller is very much like another; if you can program one you can program another. I was both delighted and horrified at how quickly I resumed doing it after a 20 year gap (horrified because so little had changed).

What does change is how you program a microcontroller. There the key points are bit-twiddling registers for internal peripherals, possibly bit-bashing external devices, available libraries, and how you deal with multi-tasking.

In the future having good reliable and predictable ways of using multiple cores will be a differentiator. Currently multitasking usually ends up using an RTOS on a single core; be very sure any RTOS deals correctly with multicore processors.

For a left-field approach that is very good for high-speed bit-bashing, and excellent for multithread and multicore embedded work, consider the XMOS xCORE devices with xC (Digikey/Farnell). Even if you don't use them, the concepts and design patterns are battle proven and can be used in any design.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: JPortici, amymcneil

Offline Fire Doger

  • Regular Contributor
  • *
  • Posts: 207
  • Country: 00
  • Stefanos
Re: Best way to start moving away from Arduino?
« Reply #2 on: October 25, 2017, 09:53:20 am »
Arduino is a development platform based on atmega, there is no point to move on a different family without knowing to program mcu (I don't think someone knows how to program MCU when he doesn't know what Timer means).

A good start is to download datasheet and make a program without using any wiring instructions. Learn it's peripheral, how to write on registers etc.
You can use an Arduino board and program it with pure C and an external programmer like any other MCU.
 

Offline Mjolinor

  • Frequent Contributor
  • **
  • Posts: 328
  • Country: gb
Re: Best way to start moving away from Arduino?
« Reply #3 on: October 25, 2017, 09:55:49 am »
The low power 8 pin Pics. Throw away your C compiler and learn the 36 or so instructions.

There is a huge amount of satisfaction when you do something and are successful.

Bit bashing I2C is a good example. Implementing I2C from scratch with no libraries to help you is a real achievement though quite simple to do with some thought. Getting it into the smaller pics and still having enough room in there to do what you needed alongside the I2C is also not trivial and is a real buzz.
 
The following users thanked this post: fourtytwo42

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Best way to start moving away from Arduino?
« Reply #4 on: October 25, 2017, 10:49:29 am »
Consider PSOC. It is both ARM based M0 or M3 or M4 cores depending on choice,
has a lot of analog capabilty, DSP engine built in (PSOC 5LP), has a fabric where
you can either create custom onboard logic functions using Verilog or schematic
capture, and overall chip allows routing to internal functions as well as pin choice.

So it has a touch of FPGA capability rolled up with decent core and analog.

A summary -

For me what stands out is -

1) Routability
2) Fast 12 bit SAR A/D and slow 20 bit DelSig
3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFB
can be used as a GP fast processor block, similar to RISC block
4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGA
like capability
5) Onboard Vref
6) IDAC, VDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....
7) LCD,  COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE, USB
9) Custom components capability, create with schematic capture or Verilog
10) DMA to offload processes like filters, COM, Display
11) ARM M0 (PSOC 4) or M3 (PSOC  5LP) or 8051 core(PSOC 3) or M0+/M4 dual core PSOC 6
12) Extensive clock generation capabilities
13) All components supported by extensive prewritten APIs

https://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=true

http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

Great video library

Attached component list.  A component is an on chip HW resource.

Free GUI design tool with schematic capture, "Creator". Components have rich API library attached
to each component. Compilers free as well.

PSOC 4 is low end of family, consider 5LP parts as well. PSOC 4 also has arduino footprint boards (pioneer) as well. PSOC 6 dual core M0+/M4.

https://www.elektormagazine.com/labs/robot-build-with-cypress-psoc

http://www.cypress.com/products/32-bit-arm-cortex-m-psoc



https://brightcove.hs.llnwd.net/e1/uds/pd/1362235890001/1362235890001_5241352463001_2606504288001.mp4?pubId=1362235890001&videoId=2606504288001



Regards, Dana.
« Last Edit: October 25, 2017, 10:53:06 am by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: laseralex

Offline Quarlo Klobrigney

  • Frequent Contributor
  • **
  • Posts: 967
  • Country: pt
  • This Space For Rent
Re: Best way to start moving away from Arduino?
« Reply #5 on: October 25, 2017, 10:59:17 am »
SPOILER ALERT! AVR Fanboy here. Just learn to program the AVR in C and not use the Arduino shell. Get to the real chip and do some simple tasks.
As far as ARM, it all comes down to what are you trying to do, what do you want to learn, how much processor do you need? I'm just a noob to the ST ARM architecture. I bought a Discovery kit (not STD :-- that's another topic for a different thread) and am learning, albeit slowly.
Voltage does not flow, nor does voltage go.
 

Offline sainter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: lt
Re: Best way to start moving away from Arduino?
« Reply #6 on: October 25, 2017, 11:04:34 am »
I agree with Fire Doger, use Arduino IDE to do the same thing you done before, but with pure C. After you understand registers, timer and working with peripheral devices, go to other MC. I would advice not investing too much time in 8-bit MC and moving up to 32-bit ARM. It's not hard to use them after you understand the things described before.

Patrick Hood-Daniel has a channel on youtube. He uses STM32 MC (I have a dev board with STM32L152, so thins fitted me perfectly).

If you want to stick with atmel, move to Atmel Studio. You can configure it to flash via avrdude (to upload directly to arduino using arduino bootloader). This way you can learn new development platform without buying anything new. After that you can buy Atmel programmers with debugging tools.

What ever you chose, will be better than to dwell on arduino. It's a good launchpad for beginners, but people (me included) tend to get stuck on it.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Best way to start moving away from Arduino?
« Reply #7 on: October 25, 2017, 11:23:39 am »
Here are the boards, attached, concentrate on left most boards. There
is a $ 25 Arduino PSOC 4 board also quite useful. Link follows.


http://www.cypress.com/documentation/development-kitsboards/cy8ckit-042-psoc-4-pioneer-kit

Non Arduino version

http://www.cypress.com/documentation/development-kitsboards/psoc-4-cy8ckit-049-4xxx-prototyping-kits


The high end part $ 10 board, non arduino, very useful as the parts have
a full complement of capabilities. Great to learn on.

http://www.cypress.com/documentation/development-kitsboards/cy8ckit-059-psoc-5lp-prototyping-kit-onboard-programmer-and


Regards, Dana.

Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: laseralex

Offline woody

  • Frequent Contributor
  • **
  • Posts: 291
  • Country: nl
Re: Best way to start moving away from Arduino?
« Reply #8 on: October 25, 2017, 11:44:43 am »
The low power 8 pin Pics. Throw away your C compiler and learn the 36 or so instructions.

There is a huge amount of satisfaction when you do something and are successful.

I second that. It is amazing what you can accomplish with only 1 or 2 k words in an 8 bit, 6/8/14 pin device. The first time you write a working driver for an exotic display, based on its datasheet and not using someone else's driver for it is...like most first times: a great experience  8)  But I would hang on to the C-compiler; there is also a lot of satisfaction in writing C and knowing what instructions your compiler will make of it. You can bitbang using C, nobody forces you to use functions that came with your compiler. And it certainly does read back more easy IMHO.
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Best way to start moving away from Arduino?
« Reply #9 on: October 25, 2017, 01:12:13 pm »
Much as I like PICs, you've already got a decent development platform and the AVR chips are apparently quite nice so unless you want to move on to something completely different then stick with the arduino hardware and the Atmel/microchip tools until you're happy the chips don't suit your needs.

It pains me to say it but they are faster and more friendly than the equivalent Microchip PICs.

If you want to go further it seems STM32 is a very popular choice, free IDE, compilers and very cheap hardware.

 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Best way to start moving away from Arduino?
« Reply #10 on: October 25, 2017, 01:31:26 pm »
Only my 2p worth...

There is a very compelling reason to stay very close to Arduino.... the hardware is so cheap.. I particularly like the NHduino boards... they are so so so cheap (and have a proper XTAL). In fact the clones are so cheap they are a good source of components for your own designs!

So until you reach the point you cannot do something that you want to do stick with Arduino Uno i.e Atmega328P

The points above about getting closer to the bare metal by referring to the datasheet are very good.

Once you reach the point that you have a problem that cannot be realised with 328P then you can look for an alternative MCU that meets your requirements.


 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4034
  • Country: nz
Re: Best way to start moving away from Arduino?
« Reply #11 on: October 25, 2017, 01:43:55 pm »
There is nothing at all wrong with AVR-based Arduino or compatible hardware and there are a huge variety of very cheap boards to choose from. If an 8 bit chip running at 16 MHz with a few KB of RAM will do the job at all then they are perfectly fine.

The Arduino libraries are great to get started with easily, but do sacrifice some performance in order to get simplicity of use.

You can stick with the Arduino IDE (or switch to using bash, emacs, gcc, avrdude directly if you want) while gradually switching from the Arduino library functions to writing for the hardware directly. The source code of the Arduino libraries provides functioning example code which you can start from and improve.

If you need a more powerful processor then you can do the same thing with a ARM or RISC-V or other 32 bit board with Arduino IDE integration.

No need to throw out the baby with the bathwater.
 

Online Peabody

  • Super Contributor
  • ***
  • Posts: 2006
  • Country: us
Re: Best way to start moving away from Arduino?
« Reply #12 on: October 25, 2017, 01:56:23 pm »
An alternative to 8-bit MCUs would be the 16-bit TI MSP430 processors.  They have built-in oscillators, so don't need a crystal, run on extremely low power, and a few of them even come in DIPs.  I've worked with them in assembler, but there's an Arduino-like app available called Energia, and of course TI's own CCS IDE.  If interested, you would want to download SLAU144.pdf, which has all the detail.

But I have to say, Arduino is popular because it's easy, and because you don't have to know very much about the processor.  I enjoy getting a chip with 2K of flash memory and 128 bytes of ram to do lots of stuff for me running at 400 uA, but it takes more time and detailed knowledge to get that level of crunching.  Most people just wouldn't be interested in doing that.  Also, using Arduino lets you share with others easily, and vice versa - everybody has them, so it's common ground.

 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Best way to start moving away from Arduino?
« Reply #13 on: October 25, 2017, 02:29:52 pm »
The Arduino libraries are great to get started with easily, but do sacrifice some performance in order to get simplicity of use.
+1.  The Arduino libraries aka 'Wiring' are a abstraction from bare metal but most of these can be 'turned off' whilst staying within the Arduino IDE... i.e. Never return from loop(), do PORT i/o not DigitalWrite i/o.
No need to throw out the baby with the bathwater.
+1

PS
The big step change you get by getting a in circuit debugger is breakpoints... for that AFAIK you need to move outside the Arduino domain.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3146
  • Country: ca
Re: Best way to start moving away from Arduino?
« Reply #14 on: October 25, 2017, 03:03:58 pm »
If you want to get away from Arduino approach (stick boards and modules together and equal them with a matching set of software libraries), don't repeat it on the other platform.

The production-oriented approach would be to design a PCB, print it (very cheap now), solder it, test it, use it. In this scenario you don't select an MCU once and for all. Rather, since your PCB is good for only one project, you analyze your specific task, you select MCU, other parts specifically for your task, put everything together in a unique way.

If you don't know enough about the MCU you have selected or the other parts of circuitry, you test it before printing PCB. Many people use dev boards for this. I personally prefer breadboards, if they can handle the speed.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4034
  • Country: nz
Re: Best way to start moving away from Arduino?
« Reply #15 on: October 25, 2017, 03:06:33 pm »
The Arduino libraries are great to get started with easily, but do sacrifice some performance in order to get simplicity of use.
+1.  The Arduino libraries aka 'Wiring' are a abstraction from bare metal but most of these can be 'turned off' whilst staying within the Arduino IDE... i.e. Never return from loop()

Hell, never return from setup()! Either will work.
 
The following users thanked this post: NivagSwerdna

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Best way to start moving away from Arduino?
« Reply #16 on: October 25, 2017, 04:30:10 pm »
I agree with all of the people who say to keep using your arduino hardware, but start getting more involved with the low-level programming.   One way to gain knowledge is to start READING the code in the libraries you've been using.  Go ahead and LOOK at the code in digitalWrite(), and figure out why it's "slow" and how you might improve it.  And etc...


Quote
or to not using any microcontroller at all and just discrete components when that is possible.
No one has talked about this, yet.  The sad (?) fact is that MOST of the things that hobbyists want to do with electronics these days are cheaper and easier to do with a microcontroller and some firmware than with "discrete components."  The main area I can think of where this might not be true is music stuff - homemade synthesizers, effect pedals, etc.  And Ham radio stuff, I guess.
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2732
  • Country: ca
Re: Best way to start moving away from Arduino?
« Reply #17 on: October 25, 2017, 04:32:00 pm »
For me the big step away from Arduino as a platform was purchasing Atmel ICE, that allowed me to program and debug pretty much any AVR or ARM chip Atmel sells. That facilitated my move to CM0/CM0+ instead of AVR as they are so much easier to work with. Atmel Studio was also a biiig advantage since it's based on Microsoft Visual Stuidio, which happens to be the main software I use professionally for pretty much my entire career, so I felt right at home there.

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Best way to start moving away from Arduino?
« Reply #18 on: October 25, 2017, 05:06:39 pm »
IMHO, products like Teensy and the ESP32 (et.al) are "next generation" products that build on your Arduino experience.  You can transition to the hardware while learning on the Arduino IDE, and then graduate to more "hard-core" development methods.

The Teensy is like a bench full of 100 Arduinos at little additional cost.  And the ESP things seem like a real game-changer if you are interested in wireless iOT, etc. People are only beginning to exploit what the ESP chips are capable of.

Teensy: https://www.pjrc.com/store/  available in many places

ESP32: https://en.wikipedia.org/wiki/ESP32#Development_and_other_boards  fast-growing number of vendors of boards.
 

Offline woody

  • Frequent Contributor
  • **
  • Posts: 291
  • Country: nl
Re: Best way to start moving away from Arduino?
« Reply #19 on: October 25, 2017, 05:59:38 pm »
32 bits microcontrollers? I have a T-shirt that sums it up nicely: Why insist on 32 bits if you can't handle the first 8?

To each her own, but I find programming an 8 bits device where I control everything and I know I am the one to blame if it does not work as advertised a lot more fun that slashing together other peoples' libraries on a pre-made board. If that means I can not have Internet connected hardware then so be it. I do not see any advantage in having my fridge telling the local supermarket that I'm out of pizza anyway.

I made an internet connected thermometer not too long ago. Based on a Raspberry Pi. It needed 1 temp/humidity sensor. And 4gigs of OS. A webserver. A lot of libraries. Google Fonts. A wall wart delivering 10 watts. Does it work? Sure. Was it fun making it? Not really. It is making a meal using a Knorr (Kraft?) box and adding water instead of buying ingredients and really cooking something. Do I really understand how and what happens inside this thermometer? Not a clue.

YMMV


 
The following users thanked this post: fourtytwo42

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2732
  • Country: ca
Re: Best way to start moving away from Arduino?
« Reply #20 on: October 25, 2017, 06:02:58 pm »
The Teensy is like a bench full of 100 Arduinos at little additional cost.  And the ESP things seem like a real game-changer if you are interested in wireless iOT, etc. People are only beginning to exploit what the ESP chips are capable of.

Teensy: https://www.pjrc.com/store/  available in many places

ESP32: https://en.wikipedia.org/wiki/ESP32#Development_and_other_boards  fast-growing number of vendors of boards.
I disagree as this move only force you to stay longer on Arduino instead of moving to your own boards as it's not a trivial task to design and build the board for ESP32, unlike atmega328p, which in certain circumstances can work on it's own with no external components whatsoever, and even in most "bullet-proof" configuration requires only few external passives, and thus making designing a board for it very easy for absolute beginners. I've been there not so long ago.

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Best way to start moving away from Arduino?
« Reply #21 on: October 25, 2017, 06:07:37 pm »
The Teensy is like a bench full of 100 Arduinos at little additional cost.  And the ESP things seem like a real game-changer if you are interested in wireless iOT, etc. People are only beginning to exploit what the ESP chips are capable of.

Teensy: https://www.pjrc.com/store/  available in many places

ESP32: https://en.wikipedia.org/wiki/ESP32#Development_and_other_boards  fast-growing number of vendors of boards.
I disagree as this move only force you to stay longer on Arduino instead of moving to your own boards as it's not a trivial task to design and build the board for ESP32, unlike atmega328p, which in certain circumstances can work on it's own with no external components whatsoever, and even in most "bullet-proof" configuration requires only few external passives, and thus making designing a board for it very easy for absolute beginners. I've been there not so long ago.
Curious that you excised the part of my posting that addressed your objection.
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2732
  • Country: ca
Re: Best way to start moving away from Arduino?
« Reply #22 on: October 25, 2017, 06:19:49 pm »
Curious that you excised the part of my posting that addressed your objection.
What's the point in going to discrete MCUs only to go back to pre-made boards (unless you're good enough at RF design to design the board for ESP32)?

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Best way to start moving away from Arduino?
« Reply #23 on: October 25, 2017, 06:26:43 pm »
Best way to start moving from arduino?
take a library and rewrite it.
seriously, you have to learn how the peripheral actually work, by knowing how to set up the peripheral itself... Read the chip's datasheet!

write your own spi driver for example.

you have to move out of the ecosystem
 

Offline Mjolinor

  • Frequent Contributor
  • **
  • Posts: 328
  • Country: gb
Re: Best way to start moving away from Arduino?
« Reply #24 on: October 25, 2017, 06:38:26 pm »

Timing and logic at a really basic level are the things that assembler and machine code programming will teach you. There is no way to get that sort of understanding with any high level language.

Even if it is a short term thing it will improve any C (or other) programming you do.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf