Author Topic: microcontrollers beginning  (Read 13214 times)

0 Members and 1 Guest are viewing this topic.

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