Author Topic: microcontrollers beginning  (Read 13213 times)

0 Members and 1 Guest are viewing this topic.

Offline LuisLDiasTopic starter

  • Contributor
  • Posts: 13
  • Country: pt
microcontrollers beginning
« on: December 12, 2015, 12:27:10 am »
Hi, everyone!

I want to learn how to program microcontrollers. I already know C and C++ language I'm starting with Arduino but I want to go further. Is there any good starter kit? Should I buy pickit, another programmer or some dev board?
I know nothing.. I don't even know where to search...
Anyone could help me or just put me on the right path?
 

Offline Cliff Matthews

  • Supporter
  • ****
  • Posts: 1910
  • Country: ca
    • General Repair and Support
Re: microcontrollers beginning
« Reply #1 on: December 12, 2015, 03:40:04 am »
Welcome to EEVblog! You will find some threads on the forum comparing AVR with PIC (the later usually wins on technical strengths) but since you are in Lisbon, I'll suggest a visit here: https://www.facebook.com/MakerFaireLisbon
 

Offline Connoiseur

  • Regular Contributor
  • *
  • Posts: 104
  • Country: in
Re: microcontrollers beginning
« Reply #2 on: December 12, 2015, 04:19:37 am »
Dev-boards are a great way to learn programming, since it comes with all the required parts i.e. crystal, power supply etc. with it. However if you want to get into the intricacies of an MCU and want to develop products around them, then a good way to start is to put the chip on breadboard with the required components and program it this way.

There is a very good tutorial on AVR by Patrick Hood-Daniel - https://www.youtube.com/playlist?list=PLE72E4CFE73BD1DE1
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: microcontrollers beginning
« Reply #3 on: December 12, 2015, 07:37:16 am »
The STM32 discovery boards are cheap, powerful and contain a USB programmer and debugger all in one $10 dev board.
Having skill with ARM core chips is probably a better plan from a employment perspective.

There are opensource IDE's you can use, such as emblocks or coocox.

There's no hand holding like you get with arduino though,  :)
« Last Edit: December 12, 2015, 07:40:20 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline JacquesBBB

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: fr
Re: microcontrollers beginning
« Reply #4 on: December 12, 2015, 09:16:38 am »
If you want to understand how goes the direct programming of a MCU, I strongly recommend to follow the MOOC
from Austin University "Embedded Systems - Shape The World"
by Jonathan Valvano and Dr. Ramesh Yerraballi
https://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-03x

Its not about the Atmel chips, but the Ti Launchpad Tiva C  which are very powerful
 evaluation boards similar to the Arduino, but which you  can get  at low price from Ti or any main distributor.

https://youtu.be/YchfhYsQFPc

The Austin team have done an extraordinary job with their course, as  you will be able to directly program a board using a professional IDE (Keil)  with step to step instructions and automatic correction and evaluation
with their special module.
You will have to buy the  EK-TM4C123GXL board which is only 12.5$, and has a on board debugger.



The good news is that the new release of the lectures starts  January 20, 2016.

Even if after that you want to go back to Atmel  MCU, you will have learn all the fundamentals.
You will learn how to use a debugger,
and will be able to easily adapt to any other MCU. You can also choose to continue on Ti MCU, which you can also
program through an Arduino like interface, Energia.



Here is the Syllabus of the Ti online lectures.

Quote
Module 1: Welcome and introduction to course and staff
Module 2: Fundamental concepts Numbers, Computers, and the ARM Cortex M processor
?Lab 2. Run existing project on LaunchPad with switch input and LED output.
Module 3: Electronics Resistors, Voltage, Current and Ohm’s Law
Module 4: Digital Logic Transistors, flip flops and logic functions
Lab 4. Debug a system with two inputs and two outputs.
Module 5: Introduction to C programming
?Lab 5. Write a C function and perform input/output.
Module 6: Microcontroller Input/Output
?Lab 6. Write C software that inputs from a switch and toggles an LED output.
Module 7: Design and Development Process
?Lab 7. Write C functions that inputs from a switch and outputs to two LEDs, which is a simulated pacemaker.
Module 8: Interfacing Switches and LEDs
?Lab 8. Interface an external switch and LED and write input/output software.
Module 9: Arrays and Functional Debugging
?Lab 9. Write C functions using array data structures that collect/debug your system.
Module 10: Finite State Machines
?Lab 10. Interface 3 switches and 6 LEDs and create a traffic light finite state machine.
Module 11: UART - The Serial Interface, I/O Synchronization
?Lab 11. Write C functions that output decimal and fixed-point numbers to serial port.
Module 12: Interrupts
?Lab 12. Design and test a guitar tuner, producing a 440 Hz tone.
Module 13: DAC and Sound
?Lab 13. Design and test a digital piano, with 4 inputs, digital to analog conversion, and sound.
Module 14: ADC and Data Acquisition
?Lab 14. Design and test a position measurement, with analog to digital conversion and calibrated output.
Module 15: Systems Approach to Game Design
?Lab 15. Design and test a hand-held video game, which integrates all components from previous labs.
This lab will not be graded, but we will provide a way for you to upload your source to a server and download code from other students to study and to play.
Module 16: Wireless Communication and the Internet of Things
?Lab 16. Connect a CC3100 booster pack to the LaunchPad and communicate with an access point.
This lab will not be graded, but we will provide a way for you communicate with a class server.
Note

You will need to purchase either the EK-TM4C123GXL board from Texas Instruments and a set of electronic components. The cost for these parts is about $40 USD plus shipping. We will provide instructions at: http://edx-org-utaustinx.s3.amazonaws.com/UT601x/index.html .

You will need a PC running Windows XP, Windows 7, Windows 8, or Windows 10. You will need to be able to install the Keil uVision integrated development environment, which will require administrative privileges to the PC. We will provide instructions at: http://edx-org-utaustinx.s3.amazonaws.com/UT601x/index.html .
« Last Edit: December 12, 2015, 09:59:10 am by JacquesBBB »
 

Offline AlxDroidDev

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: br
    • Arduino Web Brasil
Re: microcontrollers beginning
« Reply #5 on: December 12, 2015, 02:13:00 pm »
Arduinos are a great starting point. Even though they aren't the most powerful MCUs around - by a long shot - they are powerful enough for lots of projects.

The next step would be ARMs, and that's where things start to get ugly: you have to move from the confort of the Arduino ecosystem, where everything interconnects fine, where all of the libraries work with all boards (mostly, at least), where everything seems to work, where you can go from complete noob to a blinking LED in a few minutes, to the complete mess and warzone that is the ARM arena.

While Arduinos is dominated by a single vendor - Atmel - and everything is standard, you'll know there are no standards in the ARM arena: there are several IDEs to choose from, there are several toolchains, several boards, several chips, several manufacturers, and everything is too specific: a program written for a STM32F10x may not work on the STM32F20x, and that sucks big time. It is a warzone.

My suggestion - if you decide to leave the comfort of Arduino and AVR - is to choose one ARM hardware manufacturer that offers: board, chips and a functional IDE. Although ST Micro has all that, nothing beats TI`s offer in this segment nowadays: their MSP432 MCUs have great specs, excellent support, and are quite cheap at US$ 12.99.

http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/msp/low_power_performance/msp432p4x/overview.page

Sure, ST Micro has lots of different boards, like the Nucleo and Discovery boards, but it doesn't always deliver all the pieces of the puzzle you need and it's up to you to figure out (and create) what is missing.

So, IMHO, start with TI ARM Launchpads (there are several options).

« Last Edit: December 17, 2015, 01:12:03 pm by AlxDroidDev »
"The nice thing about standards is that you have so many to choose from." (Andrew S. Tanenbaum)
 

Offline halloween360

  • Contributor
  • Posts: 10
Re: microcontrollers beginning
« Reply #6 on: December 12, 2015, 02:39:43 pm »
I have done quite a bit with arduinos, and they really can do a lot! They are super easy to interface with just about anything, i.e. leds, sensors, even other mcus. As mentioned previously they do hit a limit unfortunately. Do some research, pick a dev board/software suite, and play! :-+
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: microcontrollers beginning
« Reply #7 on: December 12, 2015, 02:53:23 pm »
choose one ARM hardware manufacturer that offers: board, chips and a functional IDE.

Quote
nothing beats TI`s offer in this segment nowadays: their MSP432 MCUs have great specs, excellent support, and are quite cheap at US$ 12.99.

Except.. there's no chips. You can't buy them yet.

There are vague suggestions of Q2 2016.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: my
  • reassessing directives...
Re: microcontrollers beginning
« Reply #8 on: December 12, 2015, 03:11:59 pm »
AVR with PIC (the later usually wins on technical strengths)
what?!
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Re: microcontrollers beginning
« Reply #9 on: December 12, 2015, 04:00:45 pm »
comparing AVR with PIC (the later usually wins on technical strengths)

Wuttt !!!

IMHO  - Don't go PIC , there's no free (decent) compiler , and you'dd get much more free sourcecode for AVR's or ARM's
Both AVR & ARM have GCC compiler support , for free.

I'd go Arduino for starters (Note that Arduino is AVR with a hardware abstractionlayer on top)  , then maybe switch to pure AVR without the Arduino libs. Reusing the same AVR hardware.

The later on you could try out ARM , there are some neat STM32F103 boards for $4.
And they even have arduino support
http://www.stm32duino.com/

But ARM is quite a bit tougher to wrap your head around for starters, so get your basuc MCU understanding on AVR. And move on later.


/Bingo

 

Offline Roeland_R

  • Regular Contributor
  • *
  • Posts: 62
  • Country: nl
Re: microcontrollers beginning
« Reply #10 on: December 12, 2015, 04:13:31 pm »
I program my arduino completely in assembler, using atmel's studio 7 (free) programming and debugging environment. Works great. Now i know exactly how many clockcycles a routine takes. Compact and fast programs. Only a lot of work writing them.
 

Offline doobedoobedo

  • Regular Contributor
  • *
  • Posts: 212
  • Country: gb
Re: microcontrollers beginning
« Reply #11 on: December 12, 2015, 04:36:31 pm »
I started with Arduino, then started incorporating some non-arduino AVR stuff into my sketches. The Arduino environment takes quite a bit out of the learning curve initially, but then you start to discover it's limitations. Fortunately you can then go to the datasheet for your processor and just bolt things in as you need them.

I've just got a NXP LPC11U35 dev board as the ATMega328p just isn't sufficient for my new project. There is a free IDE (LPCXpresso) and development platform (LPCOpen). The learning curve is much steeper, but with the help of the examples and a bit of googling I've got a blink program running and I'll have UART going later today.

The biggest problem with ARM is deciding which MCU. There are just so many!
 

Offline AlxDroidDev

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: br
    • Arduino Web Brasil
Re: microcontrollers beginning
« Reply #12 on: December 12, 2015, 10:36:29 pm »
choose one ARM hardware manufacturer that offers: board, chips and a functional IDE.

Quote
nothing beats TI`s offer in this segment nowadays: their MSP432 MCUs have great specs, excellent support, and are quite cheap at US$ 12.99.

Except.. there's no chips. You can't buy them yet.

There are vague suggestions of Q2 2016.

They are already available, although in Preview status. You can buy or sample them from http://www.ti.com/product/MSP432P401R/samplebuy

The MSP432 LaunchPad board is also available and in stock, and you can order one for $12.99 from http://www.ti.com/tool/MSP-EXP432P401R#buy

In my opinion, no boards out there beat the MSP432 in bang-per-buck.
"The nice thing about standards is that you have so many to choose from." (Andrew S. Tanenbaum)
 

Offline andre_teprom

  • Regular Contributor
  • *
  • Posts: 71
  • Country: br
    • Aluis-Rcastro
Re: microcontrollers beginning
« Reply #13 on: December 12, 2015, 11:57:09 pm »
Although some interesting options were recommended above, I feel that it is missing define the exact purpose of your request. The process of coding in C/C++ in embedded systems is in a sense the same as you have done in Desktop, so if you choose kits whose platforms support the most advanced resources (eg. OS) in a way isn't anything different than you already know.

If you want taste the electronics in a deep, I strongly recommend you start with 8-bit cores, and just after go to the 16/32 bit cores.
"Part of the world that you live in, You are the part that you're giving" ( Renaissance )
 

Offline LuisLDiasTopic starter

  • Contributor
  • Posts: 13
  • Country: pt
Re: microcontrollers beginning
« Reply #14 on: December 13, 2015, 01:06:25 am »
Thanks a lot both for your quick reply and disponibility. There's quite a lot for me to look and read.
So I will try some Atmal stuff.
What do I need to start? Some crystal, one Atmeal chip and a programmer like Atmel ice or avrisp?
Or its a something like SAM4L Xplained Pro Starter Kit better?

Arduino is ok, I have done some cool stuff with it. But and to do projects high frequency PWM and with Arduino I can't go higher than approximately 940Hz.
 
Just one more thing is DSP that different from a normal microcontroller?
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2544
  • Country: us
Re: microcontrollers beginning
« Reply #15 on: December 13, 2015, 05:05:39 am »
comparing AVR with PIC (the later usually wins on technical strengths)

Wuttt !!!

IMHO  - Don't go PIC , there's no free (decent) compiler , and you'dd get much more free sourcecode for AVR's or ARM's
Both AVR & ARM have GCC compiler support , for free.

I'd go Arduino for starters (Note that Arduino is AVR with a hardware abstractionlayer on top)  , then maybe switch to pure AVR without the Arduino libs. Reusing the same AVR hardware.

The later on you could try out ARM , there are some neat STM32F103 boards for $4.
And they even have arduino support
http://www.stm32duino.com/

But ARM is quite a bit tougher to wrap your head around for starters, so get your basuc MCU understanding on AVR. And move on later.


/Bingo

IMHO, you need a little balance here.
Don't be put off the PICs because of all the AVR and ARM fan-boys here.

The Micochip PICs have a lot too offer and you should have some experience with them in your pocket so you can make informed selections for future projects.  Get a PICkit 3, 5VDC power supply and one of the 8-bt PICs to start.  I would recommend a pic16f886 or pic18f2550 as a mid-level PIC to start.  Lots of features to get you started.

The MPLAB X IDE and XC8 compiler are free to start and will provide you with an easy way to get started.
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: microcontrollers beginning
« Reply #16 on: December 13, 2015, 05:37:56 am »

choose one ARM hardware manufacturer that offers: board, chips and a functional IDE.

Quote
nothing beats TI`s offer in this segment nowadays: their MSP432 MCUs have great specs, excellent support, and are quite cheap at US$ 12.99.

Except.. there's no chips. You can't buy them yet.

There are vague suggestions of Q2 2016.

They are already available, although in Preview status. You can buy or sample them from http://www.ti.com/product/MSP432P401R/samplebuy

The MSP432 LaunchPad board is also available and in stock, and you can order one for $12.99 from http://www.ti.com/tool/MSP-EXP432P401R#buy

In my opinion, no boards out there beat the MSP432 in bang-per-buck.

Another nice thing about TI's MSP430, MSP432 and Tiva C boards is there's an Arduino-like IDE available called Energia.

Energia will even let you directly open and compile Arduino sketches and libraries! (Well, assuming the sketch/library doesn't contain calls to low level AVR functions, but you'd have the same problem with the newer ARM based Arduino boards as well.)

There's also a nice community over at 43oh.com to help you get started.

I'd recommend picking up an MSP432, MSP430-F5529 or Tiva C Connected LaunchPad. They're all cheap and work great!
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline klunkerbus

  • Supporter
  • ****
  • Posts: 162
  • Country: us
  • Electrical Engineer (retired early)
Re: microcontrollers beginning
« Reply #17 on: December 13, 2015, 06:01:23 am »
...There's quite a lot for me to look and read.
So I will try some Atmal stuff.
What do I need to start? Some crystal, one Atmeal chip and a programmer like Atmel ice or avrisp?

If you go the ATMEL route, be sure to check out www.avrfreaks.net.  Possibly the largest resource of Atmel user information out there. As others have already mentioned, if you have Arduino hardware, you already have Atmel AVR hardware you can start with.  I prefer to program with Atmel Studio and an AVRISPmkII, blowing away the Arduino bootloader, but there's probably countless other programming options. For smaller size, check out small boards like AdaFruit Boarduino, AdaFruit Pro Trinket, or SparkFun Pro Mini.  Even though they say they're Arduino, you don't have to run the Arduino libraries on them.     
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Re: microcontrollers beginning
« Reply #18 on: December 13, 2015, 07:09:35 am »

IMHO, you need a little balance here.
Don't be put off the PICs because of all the AVR and ARM fan-boys here.

Well i'm one of the AVR/ARM fanboys.

I can't see anything that would make me chose PIC as my preferred MCU.
They have a neat selection of small 8-pins , but that would not be interesting for a beginner.
But one size doesn't fit all, and if you like PIC do continue using it.

Maybe a i'd consider a PIC32 if i needed a DIP 32bitter, but that's a MIPS based device.
And IMHO it makes the compiler choice and architecture a lot better.

I'd go for AVR or ARM, and if i needed serious lowpower a MSP430 .

In the end we'll all prob. end up with ARM's anyway , unless doing very specialiced or simple things.


/Bingo
« Last Edit: December 13, 2015, 07:11:48 am by bingo600 »
 

Offline ElektroQuark

  • Supporter
  • ****
  • Posts: 1244
  • Country: es
    • ElektroQuark
Re: microcontrollers beginning
« Reply #19 on: December 13, 2015, 08:40:51 am »
Quote from: AlxDroidDev on Yesterday at 23:36:29

In my opinion, no boards out there beat the MSP432 in bang-per-buck.


Freescales Freedom series of boards. IMHO.

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: microcontrollers beginning
« Reply #20 on: December 13, 2015, 08:42:19 am »
It's true.

In 2035 your singing xmas card will be powered by a ARM Cortex A17 with 4k e-ink display and 802.11AACXJOA super ultra speed 15GHz wifi.

The battery however, will still be a CR2032.   :palm:
« Last Edit: December 13, 2015, 08:47:51 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2544
  • Country: us
Re: microcontrollers beginning
« Reply #21 on: December 13, 2015, 10:13:23 am »

IMHO, you need a little balance here.
Don't be put off the PICs because of all the AVR and ARM fan-boys here.

Well i'm one of the AVR/ARM fanboys.

/Bingo

I could tell.

I'm not in either camp.  I have both.

How do you know you've made the best design choice if you've CLOSED your mind to one manufactures entire product line?

In my career, I've seen several cases where poor choices were made because of closed minds to better options.
Case in point:  The Linux and Microsoft camps.  Where an engineer was unable to get a simple serial port working after a 6 month effort.  Using the alternative, the project was completed within several days.  Unbelievable waste!!!

KEEP an open mind! 
DON"T limit you design possibilities. 
Become familiar with as many different products as you can.
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5319
  • Country: gb
Re: microcontrollers beginning
« Reply #22 on: December 13, 2015, 10:50:23 am »

Just one more thing is DSP that different from a normal microcontroller?

You can typically use DSP devices for more mundane tasks like a blinky, but architecturally they tend to support a combination of one or more of the following, typically for example: very large instruction word; multiple parallel data busses, specific instructions useful for repetitive vector maths, ALUs directly supporting single cycle vector operations.

It's not uncommon to find some devices, such as Microchip's dsPIC series for example, making no use of their DSP capabilities, but using some other on-chip facet such as high speed ADCs for data acquisition.

Regettably the AVR/PIC argument typically ends up being a meaningless pissing contest between proponents of each. In some respects the same applies to ARM vs non-ARM. The biggest problem with ARM is understanding that although a given core might be the same across vendors, peripherals between vendors are all different. You can't just lift code, not even a blinky, from one ARM vendor and expect it to even compile for another vendor.

I remember spending countless hours trying to understand just the different ARM cores and what it meant. The amount of information there is to take in and understand how this matches your requirements is just so much, knowing where to start puts you into analysis paralysis.

That last statement about analysis paralysis is key: at this stage you're probably better off restricting yourself to a couple of days' research, pick a device that fits the bill, and go with that. Be careful of going after the latest and greatest device with seemingly endless functionality and performance, the learning curve for these kinds of devices will be gruesome.

In the meantime, back to the AVR/PIC debate...
http://youtu.be/gb_qHP7VaZE
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microcontrollers beginning
« Reply #23 on: December 13, 2015, 09:49:05 pm »
Depending on what you want to do just pick a basic eight bit chip and start to understand it. I started with a small eight pin AVR and started getting basic things working like a blinking LED, then I looked at PWM outputs, then ADC inputs and so on. Once you have learn how to deal with such a simple device you can then look at something bigger like an ARM.
 

Offline savril

  • Regular Contributor
  • *
  • Posts: 66
  • Country: fr
Re: microcontrollers beginning
« Reply #24 on: December 13, 2015, 10:03:25 pm »
Choosing a microcontroller is basicaly a project or personal choice. All ?C has theirs fans.

Personally, I choose to go with STM32 because:
- it is an ARM device which is the dominant architecture. So you could recycle some knowledge on the STM32 on the many other ARM devices.
- it has a nice and cheap set of officials dev kits
- you could find many cheap Chinese boards with it
- it is arduino compatible (see STM32 arduino project)
- the programmer/debugger is relatively cheap (and you could find Chinese clones for nothing)
- the microcontroller chip alone is cheap and ST line is relatively balanced
- it has a full open source IDE solution (GCC ARM, Eclipse, ...)

But there are many other ARM chip which are as good. Some has better ADCs, ... The only other shop which I don't like is Atmel. Their ARM SAM range is overpriced compared to the competition...
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: microcontrollers beginning
« Reply #25 on: December 14, 2015, 11:05:11 am »
once you choose a chipset and toolchains..
after the Blinky, port bits, ADC and PWM basics...
Learn how to write well formed code - not all code has to be purely linear.
Interrupts, sleep, switch() statements... break, continue - will all contribute to more reliable and readable code!
You'll also get a lot more code which is easily portable, and may become your own libraries for future re-use.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline doobedoobedo

  • Regular Contributor
  • *
  • Posts: 212
  • Country: gb
Re: microcontrollers beginning
« Reply #26 on: December 14, 2015, 11:48:26 am »
SL4P makes an excellent point.

Plan your code, split it into meaningful chunks. If you ever need to maintain it or just debug it it will make it loads easier.
 

Offline AlxDroidDev

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: br
    • Arduino Web Brasil
Re: microcontrollers beginning
« Reply #27 on: December 14, 2015, 11:59:59 am »
(...) Atmel. Their ARM SAM range is overpriced compared to the competition...

Although I love AVRs, I have to agree 100% with you on that: everything from Atmel is extremely overpriced for what it is. That's why SAMs are my last choice when it comes to ARM, to the point that I don't even consider them. When you consider performance-per-dollar, AVRs should be everyone's last choice, but their simplicity more than make up for the high price.

Another vendor worth mentioning is SiLabs. They have 2 lines of ARM chips: the SIM3 (focused on performance) and the EFM32 (focused on low power). It's too bad that their dev boards aren't very affordable and hard to come by (unless you order directly from SiLabs). They're not as common as options from STM or TI .

Plan your code, split it into meaningful chunks. If you ever need to maintain it or just debug it it will make it loads easier.

In other words: divide and conquer. That's the best approach for any project, in whatever field.
"The nice thing about standards is that you have so many to choose from." (Andrew S. Tanenbaum)
 

Offline doobedoobedo

  • Regular Contributor
  • *
  • Posts: 212
  • Country: gb
Re: microcontrollers beginning
« Reply #28 on: December 14, 2015, 01:10:33 pm »
(...) Atmel. Their ARM SAM range is overpriced compared to the competition...

Although I love AVRs, I have to agree 100% with you on that: everything from Atmel is extremely overpriced for what it is. That's why SAMs are my last choice when it comes to ARM, to the point that I don't even consider them. When you consider performance-per-dollar, AVRs should be everyone's last choice, but their simplicity more than make up for the high price.

Another vendor worth mentioning is SiLabs. They have 2 lines of ARM chips: the SIM3 (focused on performance) and the EFM32 (focused on low power). It's too bad that their dev boards aren't very affordable and hard to come by (unless you order directly from SiLabs). They're not as common as options from STM or TI .

Plan your code, split it into meaningful chunks. If you ever need to maintain it or just debug it it will make it loads easier.

In other words: divide and conquer. That's the best approach for any project, in whatever field.

You're right, nothing different about coding to anything else, but people new to it tend to dive in do one thing, then add another without thought, then add some more, until without really realising it they've created an unmanageable mess.
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: microcontrollers beginning
« Reply #29 on: December 15, 2015, 06:30:53 am »
I think the Cypress PSoC should also be mentioned here. You can get a PSoC 5 dev board for $10, which even includes the programming dongle. (The dongle doubles as a second dev board, too!)

The PSoC is quickly becoming my favorite MCU to work with. Actually, MCU isn't even a good description of what these devices can do. It's like a Cortex-M knocked up an FPGA and the PSoC is their offspring.

The logic can be programmed in Verilog or you can use the schematic editor in PSoC Creator, which basically lets you drag'n'drop and connect everything from logic gates to counters to look-up tables. The analog components are setup the same way.

Anyway, they're super awesome and very easy to start using.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: microcontrollers beginning
« Reply #30 on: December 15, 2015, 07:37:13 am »
As for one of the big PSoC fanboys in this forum, I couldn't agree more.

From this post here:
https://www.eevblog.com/forum/microcontrollers/grab-a-psoc-4-m-series-proto-kit-for-$10/msg819515/#msg819515

I mentioned:
Quote
Not related to the PSoC 4 M, but for the Arduino fans out there Sparkfun is offering a PSoC 5LP kits called the FreeSoC2 with Arduino support:

https://www.sparkfun.com/products/13229

The Creator 3.3 Arduino project is here:

https://github.com/sparkfun/PSoC_Arduino_Support

And it should be pretty easy to run that on the $10 5LP prototyping board sold by Cypress:
http://www.cypress.com/documentation/development-kitsboards/cy8ckit-059-psoc-5lp-prototyping-kit-onboard-programmer-and

I don't do Arduino much so I haven't had the need to try that.

Also there is the Pioneer PSoC4 ($25) with all these projects (not arduino ported to the PSoC4 I'm afraid but it has compatible headers but the Sparkfun $50 board does.

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

Those projects should run find on the prototype kit after changing the target chip and the output pins.

I'm working on a tutorial about how to display VGA on the $10 prototype kit timb talks about.
Edit3: to clarify, all VGA signals are implemented in hardware but with the use of an R2R VGA module to get the analog out. What this means is that the Cortex M3 ARM is just filling the buffer and not doing any bit banging at all so it has plenty of cycles to do what an MCU is supposed to do (run programs not the hardware)

https://www.eevblog.com/forum/microcontrollers/grab-a-psoc-4-m-series-proto-kit-for-$10/msg814409/#msg814409

It does work fine with the internal oscillator, but after one second from the trigger it's all over the place (thankfully VGA LCD displays are fine with that jitter since this is 60 full frames after the fact it looks horrible).
Edit: I will reiterate that this is a full second after the trigger.


But using a OXCO 26 MHz is steady as a rock (thank you again blueskull), also you can put an XTAL (up to 25MHz I believe) but no space for caps on pins 15.2 and 15.3 but should be easy to put them in there since there is with a small bodge. Funny they did put caps for the RTC pins (15.0, 15.1).
Edit: this is also a full second after the trigger and couldn't be cleaner.


Edit: both captures are done with infinite persistence after about 30 seconds at least.

Edit2: Even if you put an external XTAL (or the built in oscillator or even an external digital clock like the OXCO I used, you can use the built in PLLs to run the master clock up to 80MHz.

This is an Sparkfun engineer making a Video Game chair, since the PSoC5LP does have an HID USB component so you can make your own USB peripherals.



I could go on, believe me.

But then again, the PSoC has a lot of details and the more you dig into them the more doors it opens to the point to despair, but you can stick to the Arduino IDE (if you can port it to the $10 board which should be fairly easy) and then add on to it.

So it's a cool chip, easy to learn but really hard to master (I'm not even close to do so). But as for growth, it does have that.

Again, I didn't look at the Arduino project for the PSoC5LP nor used Arduino much (Got a Intel Galileo I did play around with that uses the Arduino IDE and also a Papilio Duo FPGA/AVR that also uses the Arduino IDE)

Anyways look at the comments from Sparkfun. Is that board worth $50? maybe specially since it has an unpopulated XTAL and caps if you need the precision.

Is the PSoC the cheapest or the best? not really, depends what you want to do, but it's flexible (no doubt about it)

Edit again: just to mention that you can put several voltages on different pins for level translations, say 5V and 1.8V. The chip supports this, not sure if any of the actual boards expose those pins for doing this.

and let me add one more video of the FreeSoc2



« Last Edit: December 15, 2015, 08:20:15 am by miguelvp »
 

Offline LuisLDiasTopic starter

  • Contributor
  • Posts: 13
  • Country: pt
Re: microcontrollers beginning
« Reply #31 on: December 17, 2015, 12:10:17 am »
I've been looking for some AVR microcontrolers and dev boards. But recently discover that Atmeal studio does not work on mac PCs. So I ended buying a 8-bit dev board from microchip that bring the pickit3 included, the pic18 explorer.
I really don't know if I make the best choice, but it's better than nothing.

http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=DM183032

At least Mr. Dick heads from microchip like my choice. When I buy a proper PC I will try some atmeal stuff.

Are there some good book about programming or about microcontrollers?

Thanks for all the comments.
 

Offline ez24

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
Re: microcontrollers beginning
« Reply #32 on: December 17, 2015, 03:55:28 am »
check out PIC's  Microstick II

it is used in some universities to teach MCs

YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3441
  • Country: us
Re: microcontrollers beginning
« Reply #33 on: December 17, 2015, 05:40:17 am »
Hi, everyone!

I want to learn how to program microcontrollers. I already know C and C++ language I'm starting with Arduino but I want to go further. Is there any good starter kit? Should I buy pickit, another programmer or some dev board?
I know nothing.. I don't even know where to search...
Anyone could help me or just put me on the right path?

There are many good advice posted thus far, but few from beginners.  I am fresh from no experience to being able to built a few things, so I relate to your feeling overwhelm at the get go.

Beginner to beginner, Arduino is cheap and it is easy.  If it is your first foray into MCU's, I cannot think of a better choice.  There are lots of resource on the web with Arduino, many of them are based on the UNO.  So if you get that version, you are sure to find some "how-to's" specific to UNO.  It is very comforting when they are demo-ing using exactly what you got so you know it works.  Nano is actually better and a bit cheaper, but when you are uncertain and don't know what is what, having the exact model being demonstrated cuts down the confusion and learning cure.

I suggest:
- get a couple (you will blow something for sure) of Arduino UNO R3 from the cheap Chinese clones,
- get a bunch of generic LEDs and a few resistors (1k, 2k, 3k, 10k, ~600, 470, 300, 100) from places like Tayda.
Make your Arduino do a traffic light for a cross (+) street.  Better have both-green-lights for crossing traffic.
Now that you have that going, you are beginning to know what those pins are, and how the MCU does things (in the Arduino Environment).

Step 2, input
- get a buzzer from Tayda (75cents, so get it with the first group of stuff to avoid long shipping wait)
- get some Photo Resisters from Tayda.  They are also cheap.
- and/or get a PIR motion sensor from the cheap Chinese clones.
With the PIR, now you can have a cat alarm.  Mine is still in use.  I feed homeless cats and I like to see who came.
Or with the photo resister, you can have the Arduino blink something when it gets dark.

Step 3, fancy output
- LCD 20x4 (aka 2004) using I2C
- Dot matrix like the Nokia display
- TFT display (some with SD card reader)
I have a mini photo display using a tiny TFT (about 2 inches)

Step 4, which I just started - getting outside the Arduino Environment
I just took my baby steps in this direction.

- I just completed a project using TINY13A.  For other reasons, I got a flashlight to play with, and I decided to get a driver (NANJG 105c) that uses the TINY13A.  That became my perfect testbed to move away from Arduino.  Perfect environment for learning as there is a ton of info on the Web on that.

I blew away their firmware and using the TINY13A datasheet plus examples on the web, I manage to write my own driver.  AVR coded totally independent from the Arduino Environment.  With Arduino UNO at hand, I have an ISP programmer already, so all I needed to begin doing non-Ardunio software was just to download WinAVR and off I go.  I know have a flashlight operated entirely by my software - with different light levels I want.  It even blink out the battery voltage at my command.  (Blink Hi 3 times and low 4 times means 3.4Volts)

I just completed an upgrade to the TINY85 for more space so I can have more options.

Well, if I want to dig deeper and do more, now I am equipped with more knowledge to choose better tools.

What worked for me may not work for you.  But that is how this beginner got into it.  Hope this info is helpful to you.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf