Author Topic: How to grow past arduino  (Read 13126 times)

0 Members and 1 Guest are viewing this topic.

Offline TheUnnamedNewbieTopic starter

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
How to grow past arduino
« on: April 09, 2017, 09:22:24 am »
Hi guys,

I'm mainly an analog/low level digital guy. I almost never do any programming for embedded, if I do any programming it's usually scripts for on my computers or assignments.

I have an arduino mega that I bought a couple of years ago for a project that never got finished. I would now like to grow into programming microcontrollers without all this arduino overhead (cost, physical and programming size/speed). I don't really know how to get started tho. I was originally planning on using my arduino mega as a programmer, but I then found that every single example I seem to come accros uses the uno as a programmer - first putting the arduino bootloader software onto the target, then removing the uC from the Uno, and pretty much just using the target in the Uno board.

So I was looking at getting a programming cable, but this seems somewhat intimidating and I don't really know where to get started. Should I just get an uno and use that? Or can I use my Mega as a programer to?

The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline Avacee

  • Supporter
  • ****
  • Posts: 299
  • Country: gb
Re: How to grow past arduino
« Reply #1 on: April 09, 2017, 09:29:25 am »
One option is to skip the programmer and go straight to the Arduino chip.
Much smaller, uses a lot less power for long duration battery powered projects, and much easier to put on some stripboard in a project box.
Or get some Nano's and Mini's for a couple of dollars each.

https://www.arduino.cc/en/main/standalone



« Last Edit: April 09, 2017, 09:33:02 am by Avacee »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6146
  • Country: ro
Re: How to grow past arduino
« Reply #2 on: April 09, 2017, 09:56:16 am »
This is a good place to start:


Offline TheUnnamedNewbieTopic starter

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: How to grow past arduino
« Reply #3 on: April 09, 2017, 10:30:00 am »
This is a good place to start:

*link removed for clarity*

Thanks! I'm gonna check that out!

One option is to skip the programmer and go straight to the Arduino chip.
Much smaller, uses a lot less power for long duration battery powered projects, and much easier to put on some stripboard in a project box.
Or get some Nano's and Mini's for a couple of dollars each.

That would work! I don't know what to think about the Nano's and Mini's. Seems like I might as well just buy the parts myself at that point, the thing (for me) that makes arduino attractive is the "plug-in-usb-and-go" concept. If I need an external programmer anyways...

The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: How to grow past arduino
« Reply #4 on: April 09, 2017, 11:39:16 am »
Given you mention analog / low level digital, consider a PSOC. Simple
USB interface for program / debug. Tool (PSOC Creator) free, drag and
drop everything from simple gates to complex counter, timer, LUT,
serial.......




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)
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

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

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


Simple logic to complex capability, drag and drop, roll your own -




Regards, Dana.




« Last Edit: April 09, 2017, 12:04:48 pm 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: bitseeker

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
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: blueskull

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: How to grow past arduino
« Reply #6 on: April 09, 2017, 03:59:17 pm »
Or, buy the book and follow along (STM32 chips):

http://www.carminenoviello.com/mastering-stm32/
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: How to grow past arduino
« Reply #7 on: April 09, 2017, 08:51:47 pm »
Quote
So I was looking at getting a programming cable, but this seems somewhat intimidating and I don't really know where to get started. Should I just get an uno and use that? Or can I use my Mega as a programer to?

 Your mega board can certainly act as a external ISP programmer by loading and running the ArduinoISP sketch located in the IDE example sketches. It's just a matter of using the correct I/O pin numbers wiring to the targer chip, as the arduino AVR hardware SPI pins are located on different pin numbers going from uno to mega boards. Using the 6 pin ISP header on the mega board will work easier in that is wired correctly for using the AVR's hardware ISP signals.





 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12806
Re: How to grow past arduino
« Reply #8 on: April 09, 2017, 09:20:59 pm »
Yes, but don't forget that you need to break out the RESET pin of the programming cable at the Arduino end and extend it to a pin to fit in D10 of the I/O port headers as the sketch specifies.  Jumpering from an Arduino to a breadboard to program AVRs occasionally is one thing, but if you are going to be doing it regularily, you'd do better to get a dedicated USB-ASP off EBAY, or hack a CH240 Nano clone from a cheap 10 pack:- Don't fit the long headers, then after checking it has the Arduino bootloader, cut the Reset track to its ISP header, patch it to D10, and install 3mm LEDs + series resistors directly on D7, D8 & D9 as documented at the beginning of ArduinoISP.ino.   Put the resistors on the cathode side of each LED and solder the other end to the nearest corner of the top of the USB socket for a convenient ground point.
 

Offline lem_ix

  • Regular Contributor
  • *
  • Posts: 192
  • Country: cs
Re: How to grow past arduino
« Reply #9 on: April 10, 2017, 09:55:09 am »
Atmel clone programmers are ridiculously cheap so go with any one of those. Only thing to watch out for is that it has some adapter for the 6 pin header.

Use that atmel studio(easy/bloated) thing or set up your own gcc enviroment(harder/customizable/diy make files). Dig around here for more info:
http://www.ladyada.net/learn/avr/programming.html

Bunch of avr tutorials
http://maxembedded.com/

Atmega mcus are simple and should be fine for a beginner. After you cover the basics switching to something more powerful won't be much of a problem.

 

Offline dimkasta

  • Regular Contributor
  • *
  • Posts: 185
  • Country: gr
Re: How to grow past arduino
« Reply #10 on: April 10, 2017, 10:31:51 am »
You should be able to use your mega as a programmer. I just tried it yesterday and it works without issues.

Just follow the instructions below, and the comments in the ISP sketch.
https://www.arduino.cc/en/Guide/ArduinoISP

For "virgin" chips, just burn the bootloader first to have the fuses set for you, and then burn whatever you want.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12806
Re: How to grow past arduino
« Reply #11 on: April 10, 2017, 10:45:22 am »
The Arduino IDE installs a perfectly usable AVR GCC toolchain - you just have to know where to find it.  Westfw wrote a batch script for Windows PCs that finds it and adds it to your path so you can easily invoke it from the command line.  See https://www.eevblog.com/forum/blog/adventures-in-avr-isp-programming/msg1147021/#msg1147021 for details.

The rest of that topic is also worth a read.
 

Offline ohdsp

  • Contributor
  • Posts: 32
  • Country: gb
Re: How to grow past arduino
« Reply #12 on: April 10, 2017, 10:48:49 am »
Might be worth mentioning that once you are past the bootloader on the Arduino you can do what you want with the chip. The Arduino programming interface seemed to accept/compile (or it used to, assume it still does) standard AVR assembler and C code allowing you to bypass most of the overhead of the Arduino. I have used this before on the Mega for development of a couple of projects; let the boot loader do it's thing, reconfigure the registers/device as you need and ignore the Arduino libraries and use you own code.

It meant you could do a lot more, all under your own control, but still get away with the mega board and Arduino software only. Much less intimidating than going full on Atmel Studio/programmer tool. The good thing is once you have "normal" code you could port to Atmel Studio for development fairly easily.

Atmel make nice microcontrollers so no reason not to start with them.
Check out the Open Hardware DSP Platform:
http://www.ohdsp.org
http://github.com/ohdsp
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7304
  • Country: nl
  • Current job: ATEX product design
Re: How to grow past arduino
« Reply #13 on: April 10, 2017, 11:06:14 am »
Really depends, what you are trying to do.
To go beyond arduino, it is not really worth it to use any other 8 bit micro, as they will not offer much more. So go for 32 bit. AVR32 is going to die. PIC32 is OK, if you can live with microchip. ARM is the mainstream, well worth to learn.
With ARM you have a bunch of companies to choose from.
Atmel, now microchip, is making ARM microcontrollers.
TI is expensive.
ST is probably has the most well rounded family, and I would highly recommend them. Programmers cost less than a pizza.
NXP is another candidate, though I prefer ST.
And then there are the small ones.
I recommend not using cypress, because their sales channels or support is really weak here.
Ultimately, I dont recommend any of the small microcontroller manufacturers (or big manufacturers, with microcontroller as a side business), because it is not worth your time. If they dont have a low power Cortex M0+ to a 120Mhz M4F, dont waste time on learning one.
A bunch of fanboys will throw rocks at me for this. But I've been there, programming is ultimately boring, just use what gets the job done, flexible, and gives me the least headache.
 

Offline dimkasta

  • Regular Contributor
  • *
  • Posts: 185
  • Country: gr
Re: How to grow past arduino
« Reply #14 on: April 10, 2017, 11:13:52 am »
FPGA is also very nice if you are looking at powerful alternatives

Granted, it will be more expensive and hands-on to get started, but it should be a far more marketable skill if you can work VHDL or Verilog, when everyone and his cat has experience with AVRs and arduino.
 

Offline ohdsp

  • Contributor
  • Posts: 32
  • Country: gb
Re: How to grow past arduino
« Reply #15 on: April 10, 2017, 11:15:24 am »
Depends where you are coming from though, if you are fairly new to programming any micros without using the Arudino Libraries to do it all for you then the 8 bit microcontrollers are simple enough to not cause you too many headaches.

A lot of people like to try and jump-the-gun these days.

For any professional project in a commercial/industrial application it would make sense to start with something like an ARM chip; but if you are just trying to work out the basics like how to use a programming cable then I would still advise to start on a simple 8 bit chip myself.
« Last Edit: April 10, 2017, 11:18:02 am by ohdsp »
Check out the Open Hardware DSP Platform:
http://www.ohdsp.org
http://github.com/ohdsp
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3020
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: How to grow past arduino
« Reply #16 on: April 10, 2017, 11:22:01 am »
I personally think people should start with an ATTiny, especially something like the Tiny13 or 25/45/85.

Why?  Because it's small, the abilities it has are necessarily limited, everything you learn (well the concepts) is directly applicable to the other AVR 8 bit chips, and getting a working toolchain is as simple as downloading the Arduino IDE, something chip manufacturers should learn from.

Anyway, it is both less daunting a prospect to dig into the inner workings, and more challenging in getting your code to fit, which makes you think about embedded concerns, forces you to learn about things like PROGMEM, and the amount of RAM you have, it will probably convince you to look at the disassembly of code at some point to see what's going on and how you might optimise things, and eventually it could even coerce you into wanting or needing to inline some assembly.

You can start with using an Arduino Core with it and just program it "like an arduino" using pinMode and digitalWrite etc, and then progressively have a look to see how said core works to "do it yourself" by bit twiddling in the registers if you want.

The biggest problem, is thinking of a project in the first place to get started with.  A simple calculator might be a fun task to fit into a Tiny85, or maybe even Tiny13, lots of concepts there.





« Last Edit: April 10, 2017, 11:26:11 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: 3db

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: How to grow past arduino
« Reply #17 on: April 10, 2017, 11:33:23 am »
I'm mainly an analog/low level digital guy. I almost never do any programming for embedded, if I do any programming it's usually scripts for on my computers or assignments.
Sounds like Arduino is ideal for you.

Quote
I have an arduino mega that I bought a couple of years ago for a project that never got finished.
Hmm, so you didn't complete basic training, but now want to skip to the advanced stuff?

Quote
I would now like to grow into programming microcontrollers without all this arduino overhead (cost, physical and programming size/speed).
What overhead? Arduino is cheap, small and relatively fast. The core code can slow things down a lot, but it is easy to write directly to the chip. If you want a bigger chip, not all Arduinos are AVR - there are several Cortex M3 and M4 chips which are much more powerful.

Quote
So I was looking at getting a programming cable, but this seems somewhat intimidating and I don't really know where to get started.
Really, if you can't get the hang of simple Arduino stuff, you will be totally lost in a bare bones embedded development environment.
Bob
"All you said is just a bunch of opinions."
 
The following users thanked this post: ziplock9000

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: How to grow past arduino
« Reply #18 on: April 10, 2017, 11:36:42 am »
I would now like to grow into programming microcontrollers without all this arduino overhead (cost, physical and programming size/speed).
You can actually take your development a long way further without abandoning the Arduino development environment... although the Arduino IDE and libraries hide much of the complexity and fun of the underlying hardware from you by providing the 'wiring' layer it is possible to access these directly and get to grips with the real hardware and even program in assembly if so inclined.
It is really useful to understand about the hardware peripherals available on the silicon and in the case of an Uno it has some very capable bits and pieces.
e.g. Wiring hooks Timer0 for use with delay() and millis() functions but you can use the raw timers if you like so for example I wanted to get a reliable 100Hz timer so used Timer1 directly... there is some code to do this here http://www.hobbytronics.co.uk/arduino-timer-interrupts but it is not ideal since the interrupt latency would affect the count... CTC mode is better... but to code that you need to understand the hardware and which interrupts etc.
The Mega has even more fun hardware so explore that in detail as far as you can before you abandon the Arduino IDE.
You can drop down a level and use an AVR Dragon or Atmel ICE next but to be honest you can get so far with the Arduino IDE my Dragon spends the majority of the time in its box.
Check out for some low level info.  To be honest I tend to stick with C rather than Assembly but it might be a good way to get a bit deeper into the detail.
Have fun!
(Uno hardware from China is so cheap I've taken to just buying the NHduino boards and re-using the components)
[If you really want to move on then it gets really confusing... there are so many alternatives!)



 

Offline TheUnnamedNewbieTopic starter

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: How to grow past arduino
« Reply #19 on: April 10, 2017, 11:38:51 am »
Thanks all for the replies!

I would like to point out that maybe I misrepresented my level of skill in my original post.
I have experience programming PICs in MPLAB, as well as building a crypto-coprocessor on a ZYNQ (modular exp. and multiplier in Verilog, other stuff in C/assembly on the ARM core).

However, all of these projects were at my university, with a) Prebuilt boards with a nice "plug the programmer we give you in here" and b) already big template projects (eg the ZYNQ project) where we just get to add files and such. In terms of physical programming it was all just "plug the cable in and press the program button"


The thing that is putting me off is the complexity of all the boards and projects we already had. I don't really know where to get started - digital hardware is an alien world to me, I've only ever done analog and RF circuit design.


I asked this question because I know that a lot of microcontrollers cost a few euros at most (1off quantities), and thus being able to put really simple projects on a external micro would make a lot of projects more reasonable. However, every time I tell myself I should get started I waste a day trying to figure out what components I need to buy int he first place, struggle with 24 software libraries, and then end up throwing my hands in the air and say "screw this, I'll just order an arduino if I really need this".

Knowing the mega can be used as a programmer is nice to know - I got the impression that you needed to remove the microcontroller on the arduino in order to use the board as a programmer (essentially, you'd be just using it as a really fancy FTDI serial board).

I personally think people should start with an ATTiny, especially something like the Tiny13 or 25/45/85.
(...)

The biggest problem, is thinking of a project in the first place to get started with.  A simple calculator might be a fun task to fit into a Tiny85, or maybe even Tiny13, lots of concepts there.


Yeah, finding projects is always a pain. I have a few in mind tho, all quite simple control-type applications (a way to monitor the AC/light/temperature in my lab, for example)


Hmm, so you didn't complete basic training, but now want to skip to the advanced stuff?

Really, if you can't get the hang of simple Arduino stuff, you will be totally lost in a bare bones embedded development environment.


I think you (understandably) misunderstood my OP. I have no experience with the physical implementation - I have programmed quite complex systems, but that was always only programming, with very basic hardware-interfacing (or even none at all because they were provided by libraries).

And the project that I never finished was not due to it being to complex, or because it was training - just because I started realizing that the cost would be a lot higher than I originally expected and decided, at the time, it wasn't worth it.
The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: How to grow past arduino
« Reply #20 on: April 10, 2017, 11:50:29 am »
My best recommendation is approach it similar to how i did,

Work with the arduino IDE your somewhat familiar with, and begin writing code that talks to the peripherals, e.g. reading and setting inputs / outouts via registers, its still in C code, but its working on the AVR chip rather than just the macros, say next you might want to count or time an external input, well you have peripherals in the chips to do that, next you want to run 3 different interupts, but not on the dedicated pins, in comes the pin change interupt mask,

Then there are power modes, and fun tricks like the ADC conversion can take place while you run code, only having to read it out some time after a register with a flag is set,

familiarise yourself with taking to and controlling more of the bare AVR chip, this was the learning gap that helped me jump to the AVR side rather than just the arduino side,

the IDE is still a workable IDE, even if it is basic in functionality compared to others, but for myself i prefer it that way, as i am not yet advanced enough to use even a fraction of the tools in the bigger programs, being a self taught programmer. (e.g. advanced beginner)
 

Offline dimkasta

  • Regular Contributor
  • *
  • Posts: 185
  • Country: gr
Re: How to grow past arduino
« Reply #21 on: April 10, 2017, 12:01:48 pm »
Having no clear roadmap of what you want to do is the biggest problem.
Having a project in mind is nice, but it is easy to get sidetracked.
As you said, you end up jumping from idea to idea and from part to part.

I would start getting a bear minimum attiny as sleemanj suggested, and using it with a bear minimum circuit and an ISP connector/programmer.
A small breadboard would be awesome for that.
Start by learning how to initialize it (fuses etc) and burn a bear minimum program to it.
You would not even need a crystal for this, but you will get a nice overview of the hardware side too.

Then get the full (not summary) datasheet and start reading it from the top, exploring its abilities (registers, ports, pins etc).
You will get the full AVR experience, but not get overwhelmed by peripherals and fancy stuff.

Then set up a second one, and get them talking with I2C or something. Or perhaps with a shared external SRAM or eeprom chip

From there you get into application specific stuff, and you will get lost if you try to learn everything. Explore as you need features
« Last Edit: April 10, 2017, 12:05:14 pm by dimkasta »
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: How to grow past arduino
« Reply #22 on: April 10, 2017, 12:17:37 pm »
Arduino or whatnot other platform is just a tool. I wound suggest going other direction if you really want to learn digital design things.
Which is pick a project you wanted to do. It could be something simple first (for example a temperature/ambient light sensor with serial or USB interface, to store data on your PC).
Think what features or knowledge you need to make such a project (surely you can google ton of sensor loggers, all the way from simple 5 component 5$ designs to advanced industrial FPGA-based monsters with own HTTP servers and TFT panels). Writing the code for sake of code I personally find boring and uninteresting, so unless you have much more motivation, learning stuff this way could be quite grim experience.

Then search which approaches can be applied to design and make stuff, given what is available to you. You will see that AVR,PIC,STM or whatever have similar families of chips, which can do same stuff, with minor details in implementation and toolkit. Picking ARM however allow you to be me cross-compatible, as you likely to spend less time moving from let's say ATMEL ARM to NXP ARM chip. If you design own schematics, lay out PCB , put everything in nice enclosure - it's an additional plus for you, and extra skill set, instead of being just a XXX MCU programmer ;).

One you get project done and working, after spending X months on debug and making stuff good, you can move on to move complex/feature-rich projects. Or you could loose the interest altogether and focus on analog/RF design for example instead.  ;)
« Last Edit: April 10, 2017, 12:19:29 pm by TiN »
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline dimkasta

  • Regular Contributor
  • *
  • Posts: 185
  • Country: gr
Re: How to grow past arduino
« Reply #23 on: April 10, 2017, 12:30:22 pm »
If you design own schematics, lay out PCB , put everything in nice enclosure - it's an additional plus for you, and extra skill set, instead of being just a XXX MCU programmer ;).

++ on that
Plus, it is very fulfilling creating your own stuff. Even simple ones. A small 5x5 board, properly soldered and cleaned, with your name on the solder mask is priceless :) Even if it just blinks a led.
And it is far more educating (especially when you mess things up) than working with stuff where someone else has done the homework.
« Last Edit: April 10, 2017, 03:09:58 pm by dimkasta »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12806
Re: How to grow past arduino
« Reply #24 on: April 10, 2017, 01:03:30 pm »
An easy way into the hobbyist embedded wold beyond the Arduino is to stick with chips available in PDIP you can stick in a solderless breadboard.  The ex-Atmel AVRs are a great migration path from AduinoLand in 'baby steps' all the way - start with a 'board' support patch for the Arduino IDE,  dump the setup() loop() paradigm (see reply #40 onwards in the topi I linked in my previous post) and start reducing your dependence on the Arduino libraries so you can get closer to pure AVR-GCC C++ and eventually migrate to either Atmel Studio or the preferred generic GCC compatible IDE of your choice with a supported Atmel in-circuit debugger. 

You mention some Microchip experience.  Their 8 and 16 bit PICs are very accessible to the hobbyist breadboarder.  At the low end of the range the core architecture is frankly vile, but it gets better as you move up to the more powerful and newer ones.  The 16 bit ones have a GCC based compiler, and the 8 bit ones have Microchip XC8, (originally HiTech C for PIC10/12/16 or for PIC18).   Try to avoid resorting to assembler - PIC assembler is very much a hair-shirt exercise - if you enjoy CARDIAC (the Bell Labs cardboard computer simulator), you'll probably love it!

So why go PIC?  Well the only reason to do so is the vast range of devices and peripheral choices they have, from the low end sot23-6 PIC10(L)F320/322 family which can do useful work ambling along at only 0.0079MIPS drawing an average of under 10uA powered by a single coin cell, boosting to 4 MIPS at about 3/4 mA when you need more 'grunt'  or sleeping till a pin change on a fraction of a uA, right up to the dsPIC33EP family capable of doing complex signal processing at 70 MIPS on a breadboard.  They are very well documented so its fairly easy to hit the bare metal and control the peripherals at the register level without using Microchip's libraries.   A PICkit 3 (or clone if you are on a *really* tight budget), a breadboard, a Sparkfun 3.3V/5V breadboard PSU or similar, a home made PICkit 3 to breadboard ICSP cable, a few PICS, preferably with on-chip debug support, and the usual assortment of resistors, LEDs, buttons, displays etc that is typically sold as an 'Arduino component kit' will get you going. You should also have a USB<=>logic level serial breakout cable (3.3V/5V) if you want to do anything with the on-chip UARTs. Initially its as well to choose a PIC that is used on one of Microchip's entry level demo boards so you can easily find example code to get started with, but once you are past the blink a led, read a pot, output a PWM stage, only your imagination is the limit.  PIC based projects are often featured in Australia's Silicon Chip magazine and republished in the UK's Everyday Practical Electronics (EPE) Magazine, and although sourcecode is often not available (or of it is its probably FUGLY assembler), such articles can be a good source of project ideas, and some help deciding how powerful a PIC you will need.  OTOH they normally don't bother reserving the programming/debugging pins so going up to a higher pin-count device for easier development is often a worthwhile tradeoff.

Then there's 8051 derivatives.  The  Intel 8051 (MCS-51) was the classic embedded processor, beloved of educators from the second half of the '80s onwards.  There are still a lot of instruction set compatible ones about in niche markets.  I'm barely touching on the 8051 other than to note that a few current manufacturers have breadboardable ones with built-in serial bootloaders as I haven't used one this millennium, so hopefully a current user will chip in here,
« Last Edit: April 10, 2017, 06:39:59 pm by Ian.M »
 
The following users thanked this post: TheUnnamedNewbie, bitseeker

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: How to grow past arduino
« Reply #25 on: April 10, 2017, 01:52:50 pm »
The Arduino hardware is really a pretty nice prototyping setup.  There is no need to use the Arduino libraries and you can still keep the simple download scheme.

Next up is mbed https://www.mbed.com/en/platform/

I really like this platform for speed and the fact that I can use their web based toolchain from any browser, anywhere in the world.  Their servers are very fast and downloading to a board is a simple drag and drop of the .bin file.  There is no requirement to use their toolchain, many others work just as well.

mbed is really an idea, similar to the Arduino but much more powerful, that runs on a lot of different hardware.  I use the LPC1768 version but I see that many ST Microsystem boards (and chips) are also supported, at least to some level.

The original mbed is FAST and, with the addition of a MagJack, ethernet is provided.  There's a fair amount of memory along with DMA channels and some dedicated RAM.  A pretty nice platform.
 
The following users thanked this post: bitseeker

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9410
  • Country: gb
Re: How to grow past arduino
« Reply #26 on: April 10, 2017, 06:24:35 pm »
I would like to point out that maybe I misrepresented my level of skill in my original post.
I have experience programming PICs in MPLAB, as well as building a crypto-coprocessor on a ZYNQ (modular exp. and multiplier in Verilog, other stuff in C/assembly on the ARM core).

However, all of these projects were at my university, with a) Prebuilt boards with a nice "plug the programmer we give you in here" and b) already big template projects (eg the ZYNQ project) where we just get to add files and such. In terms of physical programming it was all just "plug the cable in and press the program button"


The thing that is putting me off is the complexity of all the boards and projects we already had. I don't really know where to get started - digital hardware is an alien world to me, I've only ever done analog and RF circuit design.

Well if that's all that is worrying you, then you really don't have much to worry about.  Most of these boards are really just convenient breakout boards for the microcontrollers in question, just providing basic life support like PSU, clock and comms, either USB or serial. The usual trouble these days is that a lot of people come up  from Arduino breadboards and have no clue about analog, let alone RF. It sounds as if you have the s/w side reasonably well covered too.

I think you just need to read the i/o specs of a few ICs, 74HC series logic etc. and take the plunge. There's nothing at all difficult about digital hardware compared to what you already know. You'll be fine designing real world I/O (ie. using resistors, transistors and opamps!) and by the time you're handling digital signals fast enough to worry about then you already have the knowledge to RF techniques to cope.

It sounds as if you're suffering more of a mental block than anything - time to just take the plunge and ask specific questions if / as they arise.
Best Regards, Chris
 
The following users thanked this post: 3db

Offline firehopper

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: us
Re: How to grow past arduino
« Reply #27 on: April 10, 2017, 06:31:21 pm »
Atmel clone programmers are ridiculously cheap so go with any one of those. Only thing to watch out for is that it has some adapter for the 6 pin header.

Use that atmel studio(easy/bloated) thing or set up your own gcc enviroment(harder/customizable/diy make files). Dig around here for more info:
http://www.ladyada.net/learn/avr/programming.html

Bunch of avr tutorials
http://maxembedded.com/

Atmega mcus are simple and should be fine for a beginner. After you cover the basics switching to something more powerful won't be much of a problem.

only issue some will have is the software is windows only. and dont forget the psoc 6 that is in the works.
 

Offline exoticelectron

  • Regular Contributor
  • *
  • Posts: 68
  • Country: us
Re: How to grow past arduino
« Reply #28 on: April 10, 2017, 07:12:27 pm »
An easy way into the hobbyist embedded wold beyond the Arduino is to stick with chips available in PDIP you can stick in a solderless breadboard.  The ex-Atmel AVRs are a great migration path from AduinoLand in 'baby steps' all the way - start with a 'board' support patch for the Arduino IDE,  dump the setup() loop() paradigm (see reply #40 onwards in the topi I linked in my previous post) and start reducing your dependence on the Arduino libraries so you can get closer to pure AVR-GCC C++ and eventually migrate to either Atmel Studio or the preferred generic GCC compatible IDE of your choice with a supported Atmel in-circuit debugger. 

You mention some Microchip experience.  Their 8 and 16 bit PICs are very accessible to the hobbyist breadboarder.  At the low end of the range the core architecture is frankly vile, but it gets better as you move up to the more powerful and newer ones.  The 16 bit ones have a GCC based compiler, and the 8 bit ones have Microchip XC8, (originally HiTech C for PIC10/12/16 or for PIC18).   Try to avoid resorting to assembler - PIC assembler is very much a hair-shirt exercise - if you enjoy CARDIAC (the Bell Labs cardboard computer simulator), you'll probably love it!

So why go PIC?  Well the only reason to do so is the vast range of devices and peripheral choices they have, from the low end sot23-6 PIC10(L)F320/322 family which can do useful work ambling along at only 0.0079MIPS drawing an average of under 10uA powered by a single coin cell, boosting to 4 MIPS at about 3/4 mA when you need more 'grunt'  or sleeping till a pin change on a fraction of a uA, right up to the dsPIC33EP family capable of doing complex signal processing at 70 MIPS on a breadboard.  They are very well documented so its fairly easy to hit the bare metal and control the peripherals at the register level without using Microchip's libraries.   A PICkit 3 (or clone if you are on a *really* tight budget), a breadboard, a Sparkfun 3.3V/5V breadboard PSU or similar, a home made PICkit 3 to breadboard ICSP cable, a few PICS, preferably with on-chip debug support, and the usual assortment of resistors, LEDs, buttons, displays etc that is typically sold as an 'Arduino component kit' will get you going. You should also have a USB<=>logic level serial breakout cable (3.3V/5V) if you want to do anything with the on-chip UARTs. Initially its as well to choose a PIC that is used on one of Microchip's entry level demo boards so you can easily find example code to get started with, but once you are past the blink a led, read a pot, output a PWM stage, only your imagination is the limit.  PIC based projects are often featured in Australia's Silicon Chip magazine and republished in the UK's Everyday Practical Electronics (EPE) Magazine, and although sourcecode is often not available (or of it is its probably FUGLY assembler), such articles can be a good source of project ideas, and some help deciding how powerful a PIC you will need.  OTOH they normally don't bother reserving the programming/debugging pins so going up to a higher pin-count device for easier development is often a worthwhile tradeoff.

Then there's 8051 derivatives.  The  Intel 8051 (MCS-51) was the classic embedded processor, beloved of educators from the second half of the '80s onwards.  There are still a lot of instruction set compatible ones about in niche markets.  I'm barely touching on the 8051 other than to note that a few current manufacturers have breadboardable ones with built-in serial bootloaders as I haven't used one this millennium, so hopefully a current user will chip in here,

I would agree your block is mental. Confidence is not inspired by using hobbyist tools and a university environment. What you really need is to see how many teenage hobbyists have/were using bare microcontrollers long before Arduino's existed and without any formal training. Then I think you'd see its not a big deal. With mplab + a C compiler, and a copy of K&R 2nd ed., you are on your way.  Just do it.









 

Offline ohdsp

  • Contributor
  • Posts: 32
  • Country: gb
Re: How to grow past arduino
« Reply #29 on: April 10, 2017, 07:44:13 pm »
TheUnnamedNewbie, If you already have a lot of programming experience, and experience with analog/RF electronics, then it should be easier to work with the hardware; as you will not be trying to work out everything at once.

In terms of understand digital hardware the essence is it is still all analog electronics.  If you pick a simple micro (basic Atmel or Mircochip 8 bit part) then understanding what it needs should be covered in the datasheets and user manuals. All you should need is a power supply and a clock source (crystal) for most low end chips, and a programming interface to get them up and running.

My first attempt at embedded programming was on a PIC16F877A using a discrete RS232 programmer built on strip board, with the PIC plugged into a solderless proto-board. It was flaky to say the best but did work. These days a cheap programmer off ebay would most likely be the best option for a programmer, with the proto-board giving an easy platform to play with.

The only way to really get into it is to get your hands dirty and be prepared to spend a little money in the process; it's not wasted money if you plan on using it as part of your career. And sometimes you can score free samples of micro's; or you used to be able to from microchip.


Check out the Open Hardware DSP Platform:
http://www.ohdsp.org
http://github.com/ohdsp
 

Offline pyroesp

  • Regular Contributor
  • *
  • Posts: 180
  • Country: be
    • Nicolas Electronics
Re: How to grow past arduino
« Reply #30 on: April 10, 2017, 10:11:59 pm »
You can get your arduino to program other microcontrollers too, well at least some PICs.
As others said, all a microcontroller really needs is power, a clock and a programmer.
I like PICs so here's how to connect the programmer to the PIC, spoiler there are only 5 wires :


It's that easy. Just give it a try, and if at first you don't succeed, try again. The forum is here to help in case you get stuck.

If you think you want to get started with 32 bit MCU, I do recommend the ST Discovery boards. They have an on board programmer so you just have to plug in a USB cable to flash the MCU. (Other manufacturers like TI for ex. do the same).
 

Offline exoticelectron

  • Regular Contributor
  • *
  • Posts: 68
  • Country: us
Re: How to grow past arduino
« Reply #31 on: April 10, 2017, 10:23:40 pm »
Skip MCU's that need an external crystal. There are zillions that have internal oscillators. Save the PCB space and the time dealing with it.  Also, crystals + breadboards = asking for trouble. Actually, breadboards period = asking for trouble. We've finally hit the golden days where you can capture, layout, simulate, and get PCB's made for basically nothing, in a few days, from the USA, with almost entirely free tools. Breadboards are just going to get in your way. Take your design seriously, do your homework, and commit something to fiberglass for $10. The rewards will far outweigh the learning curve, which you will need to deal with anyway at some point.

 
 
The following users thanked this post: blueskull

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3423
  • Country: us
Re: How to grow past arduino
« Reply #32 on: April 11, 2017, 05:34:20 am »
...
...

I personally think people should start with an ATTiny, especially something like the Tiny13 or 25/45/85.
(...)

The biggest problem, is thinking of a project in the first place to get started with.  A simple calculator might be a fun task to fit into a Tiny85, or maybe even Tiny13, lots of concepts there.


Yeah, finding projects is always a pain. I have a few in mind tho, all quite simple control-type applications (a way to monitor the AC/light/temperature in my lab, for example)
...
...

Sometimes, sharing experience is like sharing prescription eye glasses.  What works nicely for me may not work for you at all.  At the risk of "sharing my glasses"...

I did my "stepping away from Arduino" via the ATTINY13A and ATTINY85.

I am a relatively inexperienced hobbyist.  A while back, I did build a bare (no boot loader) ATMEGA 328p (28 pin dip) to work like an Arduino UNO.  Learning how to use an UNO as the ISP flasher was useful.  Stepping away from Ardunio means one would need some kind of an ISP burner.

I needed some flashlights.  I got a very cheap (under $5) single-18650 flashlight and decided to do some upgrade.  I found the NANJG105c (which uses the ATTINY13A) to be rather suitable along with a Cree XML-T6 led.  Well, with the ATTINY13A, the most obvious further improvements would be to upgrade the firmware.  I found tons of information out there on writing drivers for 105c.  Best of all, a bare-bone flashlight driver source code - it works and it was a good base to learn from.  Starting with something working and learn by modifying existing codes is the easiest way to learn in my view.  Getting the downloaded simple driver source code compiled and downloaded help me build and understand the tool-chain.

I ended up making a dedicated Arduino NANO as my ISP equipped with SOIC clips, and breakout of target MCU pins - and of course some blinking lights for convenience and important status info.  So, at that point, I was coding C without a single line of code from the Arduino library, and with tools that can stuff the result down to the Attiny 13A using my NANO-ISP.  The flashlight with the NANJG 105C was transformed into an "AVR application development education tool" at this stage.

Having custom flashlight with my personal brightness setting is of course good, but more fun things can be done.  Finding the Attiny 13A limiting, I moved on to the Attiny 85 with a lot more space and capabilities.  Needs a bit of pin-bending to get the Attiny 85 on to the 105c - again with lots of info out there about how.  With the added capability, I can temperature-sense  using Attiny 85 built in temperature-tied ADC to throttle down to keep the LED from over-heating.  By then, I feel very comfortable working with the MCU outside Arduino environment.  I even learned to "wear balance" the EEPROM so I can switch brightness on the LCD tens of millions of times on the Attiny 85 -again, learned that from flashlight firmware information out there.

Attiny 85 is big enough to actually run some of the Ardunio library.  So of course I have to try it.  I got that to run my 20x04 LCD with I2C showing the time from an I2C clock.    So, I crossed the Rubicon and came back.  Now I feel comfortable working the the MCU with/without Arduno boot-loader or library.

In the end, I have a handful of 18650 flashlights with the NANJG 105c driver using my own custom code (no Arduino library).  And back on the Arduino side, I have a keyboard handler running ATTINY85 doing input handling and communicating back to a "master MCU" via I2C.

I am still tied to the AVR at this stage, but I am freed from Arduino, and I feel should I want to switch to something else, I know what additional hardware and knowledge I may likely need.

Again, this is like sharing my prescription eye-glasses.  What works for me and what counts as great results for me may not be what works for you.  But, I hope this input helps with your quest.
« Last Edit: April 11, 2017, 05:40:06 am by Rick Law »
 

Offline TheUnnamedNewbieTopic starter

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: How to grow past arduino
« Reply #33 on: April 11, 2017, 05:58:04 am »
I want to thank you all for your replies. They made me realize that I perhaps overestimated the complexity getting my own microcontroller to work, and through doing so have stopped myself from trying. Once I'm finished with my current project, in which I will use an arduino still - It's a project for someone else and I want them to be able to easily replace/update the hardware - I'm going to try and use a separate micro controller for a small project. I'll have to see with what I start, I have one or two ATTINY laying around, but I'll have to look at what is easiest.

If I get to it, I might put my experience into a blog, who knows.

Thanks again for the help guys! I have a lot of things to look at now, and some nice places to look at for help.

The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline dimkasta

  • Regular Contributor
  • *
  • Posts: 185
  • Country: gr
Re: How to grow past arduino
« Reply #34 on: April 11, 2017, 07:03:38 am »
Another way to get some more insight about the mcus and check out what arduino hides, is an assembler tutorial.
You don't have to follow the code, just see the concepts that they have to tackle with.
Very eye-opening

Sent from my HUAWEI NXT-L29 using Tapatalk

 

Offline jamie297

  • Contributor
  • Posts: 10
  • Country: gb
  • 'Mature' grad engineer
Re: How to grow past arduino
« Reply #35 on: April 12, 2017, 05:57:07 am »
Huge thanks to all the replies on this thread for encouraging me to stop messing about and just order a PIC.

Sometimes need a kick to stop thinking about projects and just start them.
Noob forum questions on the way no doubt!  :-/O
 

Offline Luminax

  • Regular Contributor
  • *
  • Posts: 159
  • Country: my
    • Electronesk
Re: How to grow past arduino
« Reply #36 on: April 12, 2017, 07:32:21 am »
You can get your arduino to program other microcontrollers too, well at least some PICs.
As others said, all a microcontroller really needs is power, a clock and a programmer.
I like PICs so here's how to connect the programmer to the PIC, spoiler there are only 5 wires :


It's that easy. Just give it a try, and if at first you don't succeed, try again. The forum is here to help in case you get stuck.

If you think you want to get started with 32 bit MCU, I do recommend the ST Discovery boards. They have an on board programmer so you just have to plug in a USB cable to flash the MCU. (Other manufacturers like TI for ex. do the same).

+1
I'm mainly using PIC18F nowadays for its various embedded peripheral. Capture Compare PWM, ADC/DAC, Gate-able 16-bit timers, and some even have direct LCD drivers, the lots!.
With the latest version of MPLAB X IDE is the capability to "Generate Code" using the MCC (MPLAB Code Configurator) so most of the "early setups and configuration" are done through an easy to use interface code generator. Additionally, the codes are formatted for a "State Machine" base configurations which is one of the useful programming method for small-memory sized MCU.
16-bit PIC24 and 32-bit PIC32 looks interesting, too, with the abundance of low-cost development boards.
Jack of all trade - Master of some... I hope...
 

Offline pyroesp

  • Regular Contributor
  • *
  • Posts: 180
  • Country: be
    • Nicolas Electronics
Re: How to grow past arduino
« Reply #37 on: April 12, 2017, 07:26:52 pm »
+1
I'm mainly using PIC18F nowadays for its various embedded peripheral. Capture Compare PWM, ADC/DAC, Gate-able 16-bit timers, and some even have direct LCD drivers, the lots!.
With the latest version of MPLAB X IDE is the capability to "Generate Code" using the MCC (MPLAB Code Configurator) so most of the "early setups and configuration" are done through an easy to use interface code generator. Additionally, the codes are formatted for a "State Machine" base configurations which is one of the useful programming method for small-memory sized MCU.
16-bit PIC24 and 32-bit PIC32 looks interesting, too, with the abundance of low-cost development boards.

And I'd like to add that you can get a few PICs for free from Microchip.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12806
Re: How to grow past arduino
« Reply #38 on: April 12, 2017, 07:45:00 pm »
Yes, in many countries, but you cant use a free email address to register.  Apparently some dishonest idiots were making multiple registrations, ordering sample PICs and EBAYing them still in their Microchip antistatic bags with the samples label on.  This caused Microchip to clamp down a long while back.   
 

Offline Luminax

  • Regular Contributor
  • *
  • Posts: 159
  • Country: my
    • Electronesk
Re: How to grow past arduino
« Reply #39 on: April 13, 2017, 07:40:42 am »
I did get some free sample from Atmel when they were still "Atmel", and some from Microchip, I think it was 16F, the smaller ones without any big-bang peripherals.
I remembered Dave's video about PICKIT2 comparison against PICKIT3 and I wish I have had experienced the PICKIT2 but eh, PICKIT3 works for me.
Now... to figure out how to properly get this damn ICD 3 working...
Jack of all trade - Master of some... I hope...
 

Offline Docholiday

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: How to grow past arduino
« Reply #40 on: April 13, 2017, 10:36:21 am »
I have learned so much on this thread.

Thank you to every single one of you that replied. I truly appreciate your time and effort taken in your responses.

Sincerely,

Nicholas
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf