Microcontroller after Arduino - Page 1
Forum section: electronics / general

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: November 19, 2013, 07:41:28 am
content: HiI want to try other microcontroller systems other than the PICAXE and Arduino. Which microcontroller should I use?Please take in consideration which ones are going to be the next industry standard, have a low price etc.Thanks

author: PeterG
author_rank: Frequent Contributor
timestamp: November 19, 2013, 08:04:05 am
content: PICAXE is overpriced for what it is. Arduino however seems to be doing a good job of keeping pace with the times.For now Arduino seem to be the benchmark with enough plug in bits to keep most people happy.There was talk of an ARM based Arduino clone but i don't know if it ever eventuated.RegardsPeterG

author: AndyC_772
author_rank: Super Contributor
timestamp: November 19, 2013, 08:29:50 am
content: You'd be crazy to. Ready-made, ready-programmed stuff like Arduino is great to play with and learn on, but it's a whole world away from the professional market.At the very least, download MPLAB X and learn to use a PIC without needing someone's pre-programmed boot loader. If you're at all serious about professional development, look into the enormous range of ARM based microcontrollers from companies like NXP, ST, TI and Freescale. It might also be worth looking at MSP430 if you need the lowest power, or one of the Far Eastern manufacturers like Generalplus for the lowest cost. (Good luck with that last option!)

author: westfw
author_rank: Super Contributor
timestamp: November 19, 2013, 08:37:09 am
content: Well, you could start programming the Arduino using a more professional development environment, like Atmel Studio.Which would also open up the other AVR microcontrollers, and perhaps the Atmel ARM chips as well.QuoteMaybe. It depends on "how professional", how much of the environment you wanted to use, and how many lawyers you have impeding you. (The Arduino folks have SAID that you're allowed to develop commercial not-open-source products based on the environment. But then they (and many of the 3rd party library developers) have pinned on SW licenses that really are not well-matched (or "appropriate at all") to deeply embedded products. Mostly from ignorance of the implications... IMO, the Arduino libraries are on-par (quality-wise) with some of the libraries from chip vendors (which is to say, "not awful." And you have source so you can maintain them yourself. (OTOH, they're probably a bit below the libraries that you get from the better compiler vendors.))The Arduino environment now encompasses AVR, PIC32 MIPS (ChipKit mpide), TI MSP430 (Energia), and several ARM chips (Maple (STM), Due (Atmel), Teensy3 (Freescale)), so any of those offers a similar "jumping off" point to non-Arduino development on those chips.Studying the Arduino code that supports a particular chip (remember, all open-source) is also a good way to learn a fair amount about how that chip works.

author: BravoV
author_rank: Super Contributor
timestamp: November 19, 2013, 08:50:47 am
content: If you still insisting on Arduino like environment, google for the word "Energia", its a "Arduino Clone" runs on powerful TI Arm M4F core.Again, as others have suggested, try to leave Arduino if you're going to get the "serious" performance out of your mcu. Arduino is good only as introduction tool into MCU world, but thats it, once you reached certain level, Arduino will be like "Lego" vs "real bricks & cement".My 2 cents.

author: Corporate666
author_rank: Unknown
timestamp: November 19, 2013, 09:27:23 am
content: I don't think you can really talk about "next industry standard" without talking about which industry.If you look at the biggest microcontroller companies, Atmel isn't even in the top 10. Neither is Microchip. But both of them dominate the hobby world. The truly big boys are NXP, Renesas, ST, Panasonic, TI, Freescale, etc. But many of their chips are used in specific applications.I think that if you want to pick something, definitely go with someone who has ARM chips. I personally don't like Atmel but they aren't a bad chip - same with Microchip/PIC.My personal preference is Cypress PSoC because they have programmable blocks, much like an FPGA... and they have M8, 8051 and ARM core versions available, plus the dev software is excellent. Once you know how how to code a MCU in C, it's not that much different moving between them. But the FPGA-like functionality is a big leaning bonus that will help you get into real FPGA work in the future, or at least familiarize you with the concepts and relieve you of the constraints of how many built-in devices a certain chip has.

author: Stonent
author_rank: Super Contributor
timestamp: November 19, 2013, 11:25:16 am
content: Quote from: BravoV on November 19, 2013, 08:50:47 amEnergia also works with the MSP430 which is a 8bit MCU like the AVRs and lower end PICs.There's also MPIDE which works with the Chipkit boards.

author: Monkeh
author_rank: Super Contributor
timestamp: November 19, 2013, 11:35:46 am
content: Quote from: Stonent on November 19, 2013, 11:25:16 amThe MSP430 is 16-bit.

author: dannyf
author_rank: Super Contributor
timestamp: November 19, 2013, 12:03:14 pm
content: QuoteIt generally doesn't matter, if you are a hobbyist. If you want to make a living off of it in the future, it would be crazy for you to invest in an 8-bit platform - ARM or some industry-specific platforms (from Renesas or Freescale or Infineon for example) would be far better.As long as you code in a high level language like C, all mcus are pretty much the same from a coding perspective. You are far better off thinking about your ability to dissect a large project into little pieces and then integrate them together into a workable product.

author: dannyf
author_rank: Super Contributor
timestamp: November 19, 2013, 12:10:22 pm
content: I would also be very cautious investing in platforms whose futures are less certain, like xmega, avr32 (the home-grown version, not their ARM offerings), or pic32.

author: dannyf
author_rank: Super Contributor
timestamp: November 19, 2013, 12:12:03 pm
content: As for ides, if you are into the ARM products, I would recommend CoIDE: fully functional, with the best project wizards I have ever seen. spotty device support, however.

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: November 19, 2013, 12:15:34 pm
content: So is there a certain development board/microcontroller and software that you recommend in the range of ARM products?

author: dannyf
author_rank: Super Contributor
timestamp: November 19, 2013, 12:30:45 pm
content: For rich features, I would pick TI's launchpads - for its value proposition (low price and the CCS IDE). The analog part of early versions of the chip has some bugs.For varieties, I would pick ST's offerings - all those discovery boards are inexpensive and loaded with hardware debuggers.

author: JoeO
author_rank: Frequent Contributor
timestamp: November 19, 2013, 12:50:41 pm
content: They are inexpensive because TI knows it will make money when their parts are used in a product.

author: Berni
author_rank: Super Contributor
timestamp: November 19, 2013, 01:08:41 pm
content: It does not really matter what chip you go to, once you have worked with a few different ones you see that they are all the same thing, just the peripherals are slightly different.The most important thing is that you use C. All professional MCU programming is done in C, not basic or any weird amalgamation of languages. Did i mention to use C?Also try to not use peripheral libraries. Read the datasheet and write your own SPI or UART driver so you learn how it works more in depth. Also sometimes writing your own driver is more efficient or gives you access to features that you otherwise don't. Also writing your own peripheral code means you are not bound to the compilers internal libraries so your code will compile fine in any version of the compiler, and in all other ANSI C compilers in the world. (Also it manufacturers alaways provide example code of how to interface to peripherals to help you out if you get stuck)Also try making higher level libraries your self like a graphics library that can draw shapes,bitmaps and text on to a graphical screen or something to get experience writing actual C code instead of just making a little main loop where you call a few arduino librarys and magic happens.Getting in to the correct mindset of a programmer is the most valuable thing to learn. Anyone can look up what a certain library function does in a user manual, but you will encounter a lot of problems that there is no magic library you can call to do it and you need to write it your self. In that case you need to be able to break down a complicated problem in to a series of smaller programs that C is capable of solving. I see this problem with newbie programmers a lot, when there is no function they can call to do what they want they throw up there arms and say its impossible instead of thinking a bit and noticing that if you combine a few functions and add a loop for example that could solve the problem.

author: amyk
author_rank: Super Contributor
timestamp: November 19, 2013, 01:18:18 pm
content: I would recommend PICs and some 8051s (Silabs make some interesting ones.)

author: gocemk
author_rank: Regular Contributor
timestamp: November 19, 2013, 01:56:54 pm
content: Hi,I also recommend you to start learning C for embedded work. You can check the Microchip PIC range of 8, 16 and 32 bit micros. Once you've learned one of them, it is much easier to migrate from 8->16->32 bit. (not necessarily in that order). Also, there are plenty of books out there for them. I'm not so sure about the statements that the future of the 32 bit PICs is uncertain, although they seem to lag in some fields behind the ARM competitors. Nevertheless, they offer some really powerful chips in their portfolio. If you want to go the ARM way, consider the Discovery boards from ST. They are very feature packed (IMHO, better than TI) for their price. I bought brand new F3 Discovery board off ebay with STM32F303 (ARM Cortex M4) and ST MEMS Gyroscope and Accelerometer on board for 15$ or so.As for software, if you choose Microchip stick with MPLAB X, it's much better now than before. For ARM i would recommend you IAR Embedded Workbench for ARM or Keil, both of them have free licenses with code restriction to 32kB(which is more than enough for small to medium projects). I've tried CoIDE, which is based on Eclipse, but i didn't like it too much. The range of supported processors is awfull. Also, ST offers some autocode generation tools for their micros (like MicroXplorer) which help you to setup IOs, ADC and etc. very quickly and easily.

author: nctnico
author_rank: Super Contributor
timestamp: November 19, 2013, 02:57:05 pm
content: Quote from: Berni on November 19, 2013, 01:08:41 pmThe device libraries for simple stuff like SPI et al are usually pretty useless. However when it comes to ethernet, USB, filesystems, etc I do recommend to just look for suitable libraries. The amount of work involved is just too much. Ask yourself how sensible is it to re-invent the wheel? Writing stuff from scratch can be fun but building on other people's work leaves you time to fine-tune the task at hand and come up with better and new ways. Imagine you have to put your car together every time you go shopping. Just some food for thought.Learning C is a good starting point but I'm sure we'll be seeing scripted languages in microcontrollers soon.

author: westfw
author_rank: Super Contributor
timestamp: November 19, 2013, 05:08:18 pm
content: QuoteOh, an Arduino is probably a pretty good start. The "Arduino language" *is* C (well, C++, but these days when someone says "learn C", they probably also want you to learn some of the C++ concepts that have been back-ported.)The whole "don't use libraries" thing is pretty controversial, BTW. Yes, you can learn a lot by writing all of your low-level code, library functions, and device drivers. But that's relatively contrary to "modern programming practice" and "industry trends" - as peripherals increase in complexity, you're more likely to be be using libraries provided by someone else. Whether you use arduino libraries, or ASF libraries, or Imagecraft libraries, or TivaWare (nee StellarisWare) libraries, or CMSIS libraries; they all have advantages and disadvantages. Writing your own LCD driver is ok, though full of possible mistakes that you really don't need to make if your goal is a sous vide cooker controller. Writing your own tcp/ip stack, or ignoring a perfectly good set of posix standard libc functions (like avr-libc or newlib) would be pretty foolish unless you have a particularly strong reason.

author: filip_cro
author_rank: Regular Contributor
timestamp: November 19, 2013, 05:35:31 pm
content: It's not so much about making libraries, it's about understanding how uC works. Same reasons why we study assembler in high school. I personally also find Ardruino harder to use then avr-gcc C.I think that you should know what register is doing.

author: Berni
author_rank: Super Contributor
timestamp: November 21, 2013, 07:24:59 pm
content: Quote from: nctnico on November 19, 2013, 02:57:05 pmYes for those you want to use a library for sure. I have my personal favorite FAT32 library (by Elm Chan) that i ported to many many things by now.I was mostly talking about writing libraries for simple things where you can write it in a few hours. Stuff like SPIs, UARTs, graphics etc. But if you are learning C stay away from those complex protocols for now, start small and work your way up.Im not so sure about seeing interpreted scripts getting common on MCUs yet. Even today C still remains the way of doing real world stuff. Most high performance PC applications are still done in C/C++ like games and large programs like photoshop. The nice thing about C is that it still keeps you pretty low to the hardware while not being cumbersome assembler, also compilers can optimize C code to run pretty damn fast.Also yes doing a bit of assembler is quite helpful since it gives you a good understanding of how a commuter works internally, do a few simple things like loops and such in it, just don't write a big complicated program in it. Nobody writes whole programs in assembler when they have to get something done. In practice assembler just comes in as a supplement to C for doing wierd sneaky things that C wont let you do or want something cycle accurate.As for chips to learn C on i would recommend the PIC18F family and the 16bit PICs. One of those little ARMs would also be a good choice.

author: AndyC_772
author_rank: Super Contributor
timestamp: November 21, 2013, 08:14:26 pm
content: I learned C on a PIC18F device, and although trying to learn the language + the IDE + the architecture of the PIC all at the same time felt like a brick wall at the time, it was well worth the effort. The time has paid for itself many times over and continues to do so.More recently I decided to learn an ARM based microcontroller (STM32, Cortex-M0 series), on the simple basis that they're much faster, much more capable, and absolutely no more expensive than 8 bit PICs. (Seriously, just take a look at the difference in price/performance ratio for a similar set of memory and peripherals between, say, PIC18 and STM32... it's crazy! Microchip, take note...)I decided to use manufacturer-supplied libraries when learning the ST part, but with hindsight, I'm not sure that was such a good idea. The peripherals in the STM32 are quite complicated, of course, but they need to be learned anyway. Adding a layer of abstraction in the form of the library didn't really help, it was more like a layer of obfuscation; most of the library functions boil down to a check that their parameters are valid followed by some bit twiddling, and I think it would have been easier (and faster) to twiddle the bits directly.

author: IanB
author_rank: Super Contributor
timestamp: November 21, 2013, 08:40:26 pm
content: Quote from: Thane of Cawdor on November 19, 2013, 07:41:28 amArduino is a friendly wrapper around core Atmel micros. So I think a convenient and accessible next step would be to start programming the Atmel micro directly using something like Atmel Studio (as indeed others have mentioned).When you are a student it is important not to focus too much on learning "this micro" or "that micro", but rather try to learn the general concepts and principles of how microcontroller development environments work. As a professional you should be able to switch from one system to another with relative comfort as a large part of your knowledge should be transferable.Incidentally I have opened up consumer products and seen Atmel micros inside them, so they do get used commercially.

author: ddavidebor
author_rank: Super Contributor
timestamp: November 21, 2013, 09:22:05 pm
content: Just use the micro you want.I'd sugges you start with 8 bit. Is cheap, simple, well documented.A pic or avr will do fine, just pic is a bit cheaper to start due to the pickit.If you want to do things pretty "electronic" that is ok. A basic C and a bit of assembly will do it. (assembly is boring but it really help)If you want to do more "computer" thing you will need something like arm or 32 bit and more complex development platform (with 8 bit you just need a pickit, a pic, a few component and a breadboard to build up the world, with bigger chip is more complex)Arduino is great if you are a computer guy. But if you want to become serious in EE stop using it.It will burn you brain after a certain level. With arduino you can't solve some real-world problem because they're alredy solved for you.And, company don't want another arduino guy. The mental attitude you use on a arduino IS NOT THE ONE YOU WILL USE TO DESIGN, TEST AND DEBUG PRODUCT.You will notice it as soon as you've done a bit of "serious" assembly.

author: dannyf
author_rank: Super Contributor
timestamp: November 22, 2013, 12:50:03 am
content: QuoteA library allows you to get it going quickly. If you write your code right, you can always replace the library blocks with your own code piece by piece.

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 22, 2013, 12:51:25 am
content: I highly recommend PIC once you're ready to move on. It's very diverse (from 6 pin devices to 100+ pin ones) but there are still plenty of devices that are easily breadboardable. I suggest the PIC24, dsPIC, and PIC32 since those are the ones that are substantial upgrades over the classic Arduinos. ARM gives you many vendor choices but most of them are only available in surface mount packages.

author: dannyf
author_rank: Super Contributor
timestamp: November 22, 2013, 12:53:09 am
content: Low-end PICs aren't good from a modular programming point of view.I like PIC24 as well.Wouldn't touch PIC32 at all.

author: ddavidebor
author_rank: Super Contributor
timestamp: November 22, 2013, 06:10:15 am
content: I think he'a moving on because he want to learn more, not do more.

author: Stonent
author_rank: Super Contributor
timestamp: November 22, 2013, 09:58:58 am
content: Quote from: Thane of Cawdor on November 22, 2013, 09:00:15 amMy recommendation really is AVR because you can prototype the code in Arduino format and then easily translate to AVR C.Then grab a TI MSP430 Launchpad and write some C code in Code Composer Studio. If you get stuck, the MSP430 launchpad works with Energia which is a Arduino environment for the MSP430. Then grab some PICs and a PIC programmer and have fun with that. I've got them all and also TI's ARM launchpad boards.And one of these days I'll start using them all.

author: rverm
author_rank: Newbie
timestamp: November 23, 2013, 12:58:54 am
content: I have only used pic chipsThats something I'm interested in doing. Learning how to use a arm processor. the arduino due with the sam3 chip looked good. but there libraries don't really let you learn anything about the chip. at least in basic with the pic chips you can address the registers directly.the info everyone has provided has been interesting. food for thought.

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 23, 2013, 05:13:36 am
content: If you like the Arduino platform but don't like the IDE, you could use vi (or whatever text editor you like) and make your own Makefiles...

author: senso
author_rank: Frequent Contributor
timestamp: November 23, 2013, 06:13:14 am
content: Arduino is just a breakout board for the atmega chips, think of it just as of a breadboard, if on windows, download avr studio(now using Visual Studio, a nice IDE, if a little heavy when opening), download the datasheet and off you go...No need to change micro-controller family or brand just because the Arduino IDE is a piece of crap and the libraries are no better, seriously, who the hell puts code on .h files and makes that a convention?If you want to dip your toes, I have started a line of tutorials aimed to make the transition from Arduino to real mans C, it started out in the older AvrStudio 3.something, but the concept is there:http://hekilledmywire.wordpress.com/Yeah, I haven't posted nothing for a while, but the code is all proven, give it a go

author: westfw
author_rank: Super Contributor
timestamp: November 23, 2013, 07:01:13 am
content: BTW, a good start is:1) Read the Arduino core source code!2) OK, now go read the mpide source code that implements the same functions on PIC32. Or the Energia code for MSP430. How is it different? Why?3) Now, improve something in one of those. Write a digitalWriteFast function (yet another one, but that doesn't matter.) Implement a pin as a c++ template/object instead of the current version. Make it so that the serial port data structures for the 4 serial ports on a MEGA are dynamically allocated at begin() time and don't use up so much RAM; shucks, go ahead and make the buffer sizes user-configurable. There's lots of "bad" code in the Arduino core and libraries that's not getting fixed because of "momentum." But that shouldn't stop YOU from fixing it!4) port the Arduino/mpide/Energia core to a "similar" environment, like an Atmel "XPlained" board, or an NXP LPCXPresso board.5) port the core to a NOT similar environment, like one of those Renesas eval boards that they like to give away, or a Freescale Coldfire Tower Board.People tend to treat systems like Arduino as either Evil because "they're too easy", or Wonderful because "they're so easy." But it is a useful LEARNING EXPERIENCE to STUDY such systems!

author: Sasja
author_rank: Contributor
timestamp: November 23, 2013, 01:32:43 pm
content: Seems you're ready for a next step beyond the gateway drug that is arduino. good!The direction i would recommend is a step down (as in deeper) towards baseline 8-bit microcontrollers.take a look at these tutorials:http://www.gooligum.com.au/tutorials.htmlPrint em all out, buy a PicKit3, buy all the pic's he uses and get to work for a few weeks.Once you've done that you'll be able to do things with a tiny 0.5$ chip that you used to do on an arduino, and more.and then go design and build some stuff!

author: dannyf
author_rank: Super Contributor
timestamp: November 23, 2013, 03:15:30 pm
content: QuoteIt is the best, par none.QuoteHe used some very old PICs. You can get more powerful PICs at much lower price points and with better availability today.

author: Unknown
author_rank: Unknown
timestamp: November 23, 2013, 03:39:10 pm
content: I would say that for learning C on small micros AVR (8-bit), MSP430 and PIC18+ are all equally fine choices with good community and tool support. Unless you already have the hardware or friends with experience I don't see a compelling reason to choose either, so the Arduino that you already have would be a fine AVR devboard. If you want to move to a breadboard, the ATmega328p is available in DIP and the Arduino can be configured to program it. Nothing wrong with buying a Launchpad or Pickit 3 either, but why spend the money if you already have the hardware? Platform is pretty much irrelevant if you understand the fundamentals.

author: Sasja
author_rank: Contributor
timestamp: November 23, 2013, 06:45:13 pm
content: Quote from: dannyf on November 23, 2013, 03:15:30 pmi guess you're right about the old PICs but after messing around with a few of those old PICs in the tutorial you should be comfortable picking up any modern PIC. And coming from arduino it's really awesome to be able to browse a microchip catalog and select exactly the pic for the job. Before you know it you'll be the one looking at arduino based projects and going:dude why use an arduino for such a trivial thing i can use a 1$ pic for.(and then someone else will point out: duuude i can do that with a 20cent 555)(and thenwho still uses 555? and so on...)by the way my strategy to learn electronics is basically this:1) find out what you would like to build2) then find out what you need to learn to do that3) build iti have to admit, i kind of wondered before if i would enjoy learning FPGA stuff but honestly i cant really come up with something i want to do yet that would actually need an FPGA. So none of that stuff for me at the moment. I still like reading about that stuff though, the whole FPGA concept is just er "to pornographic" as dave puts it.

author: dannyf
author_rank: Super Contributor
timestamp: November 23, 2013, 10:09:46 pm
content: QuoteThat strategy (making a mcu that fits the job exactly, no more and no less) works in the old days where mcus were expensive, or in mass production. That strategy is increasingly irrelevant in a days of cheap mcus and for high software cost / low hardware cost jobs. I personally think that there is a lot of merits in utilizing mcus with more features you need so to reduce software costs (by reducing the number of mcus your software has to support).

author: nctnico
author_rank: Super Contributor
timestamp: November 24, 2013, 01:40:34 am
content: I agree. When looking for an MCU for low to medium volumes (<1000 pieces) the price is often driven more by the popularity of an MCU from a certain family-branch than its memory size. Distributors buy popular MCUs in such large quantities that they can keep the price low.

author: Sasja
author_rank: Contributor
timestamp: November 24, 2013, 07:37:30 am
content: I also agree, a mcu you already know with more features/memory than you need at the moment would be a wise choice in most cases. I guess "exactly the pic" was an unlucky choice of words. i just meant that if the op wanted to go, for instance, for low power, or just small footprint, or a quick proof of concept, or high volume/low cost, or anything, he will be able to choose an appropriate tool for the job. Hell, sometimes i still grab my old arduino to do smth just because i happen to know how to do it fast with it.

author: macboy
author_rank: Super Contributor
timestamp: November 25, 2013, 01:43:28 pm
content: Quote from: Corporate666 on November 19, 2013, 09:27:23 amWhat complete nonsense.In 2011, Atmel was ranked 3 in the world (by $) and Microchip ranked 4. Only Freescale and Renesas were higher than these guys. Both Atmel and Microchip are growing while Renesas is losing share. Atmel and Microchip didn't earn a combined $2.6 Billion from hobbyists!! (Source)I have at least 3 commercial products on my bench with a PIC inside that I know of.With microcontrollers, everyone has an opinion. But if you are going to state facts, make sure they are facts.

author: Sasja
author_rank: Contributor
timestamp: November 25, 2013, 06:07:38 pm
content: Quote from: Thane of Cawdor on November 25, 2013, 01:39:29 pmare you asking for everyone in this thread to agree on something?i'm afraid you'll have to do the conclusion part yourself.Have you checked out dave's pic vs atmel rant video yet? i'm sure you'll find some wisdom in there that may help you, even if you decide not to do pic or atmel microcontrollers. And its good entertainment also.

author: ddavidebor
author_rank: Super Contributor
timestamp: November 26, 2013, 06:26:34 am
content: Well we all agree that if you want to learn more about good programming you need to leave arduino ide.

author: dannyf
author_rank: Super Contributor
timestamp: November 26, 2013, 12:05:46 pm
content: QuoteMaybe they defined "market" differently; maybe they used different criteria to rank; maybe they ranked different products, etc.

author: Kappes Buur
author_rank: Regular Contributor
timestamp: December 04, 2013, 07:18:53 am
content: The Arduino boards, such as UNO or Leonardo, are excellent for learning. But, the way they are implemented as BOBs, severely curtails the functionality of the microcontroller.Used on their own, as already mentioned they can easily be programmed with an AVRISP mkII, ATmega328s are extremely powerful little buggers. Coupled with Atmel Studio 6.1 one can do a lot of things with them to keep one occupied for a long time.

author: westfw
author_rank: Super Contributor
timestamp: December 04, 2013, 09:49:31 am
content: QuoteI'm missing something. What's a "BOB" ?

author: Crazy Ape
author_rank: Regular Contributor
timestamp: December 04, 2013, 01:03:41 pm
content: Quote from: westfw on December 04, 2013, 09:49:31 amBits n Bobs almost fits. Pluggings bits into bobs.However, I think in this case the BOB in question is aBreakOutBoard.

author: dannyf
author_rank: Super Contributor
timestamp: December 05, 2013, 12:19:41 pm
content: QuoteThat's a bloated piece of nice software.I use CB; or if I have to use a piece of bloatware, I would go with IAR.

author: miceuz
author_rank: Frequent Contributor
timestamp: December 05, 2013, 04:27:36 pm
content: Quote from: Thane of Cawdor on November 19, 2013, 01:13:23 pmIf you are used to arduino, you can start learning to do that right away. Get the datasheet for the onboard atmega, pull out any arduino example and just do it - first get rid of digitalWrite and digitalRead -- read and write registers directly, then get rid of analogRead, then of analogWrite (this will take a while - setting up timers for PWM is pretty hairy) then replace Serial.*.Arduino environment is plain simple C++ and you can write plain simple C in it using all the avr-libc macros or functions.www.nongnu.org/avr-libcOnce you get a grip of what's inside of a microcontroller (registers, timers and other peripherals) it's really easy to move to other MCUs.ARMs might look a bit too complicated at first though. You have more granular control over things, but you have to do more - say, if you want to use uart, you have to enable clock to uart module, set up it's speed, set up the module itself (it will probably have multitude of different modes it can work in), enable specific pins for it and maybe do more stuff like that. On AVR the same is much simpler - enable UART, write byte to a register and bam - it's already banging your byte out on a designated pin.

author: AndersAnd
author_rank: Frequent Contributor
timestamp: December 06, 2013, 03:47:42 pm
content: Since you are already familiar with the AVR based Arduino boards, I see not point in switching to another platform like MSP430 or similar at his point.Instead just reuse your Arduino board(s), but learn to program them in C and/or assembly instead of using the Arduino environment.Just download the free Atmel Studio 6 and start to learn C and assemblyhttp://www.atmel.com/microsite/atmel_studio6/There's a large online community for Atmel AVR here:http://www.avrfreaks.netOnce you have learned C and assembly on AVR, you can then move on to another microcontroller or stay with AVR if it still fits all your needs.The ARM 32-bit MCUs has become really popular and very cheap lately with the introduction of the Cortex-M3 and M0/M0+ cores, so this could be your next step once you have learned C/assembly for the development boards you already got. You can even use Atmel Studio 6 for for Atmel ARMs too to make the transition easier. Assembly language commands are quite different from MCU- to MCU family, but C is very portable. So once you have learned C for one MCU family it's not a big step to start programming another MCU family in C.Another thing to take into consideration is that Atmel AVR can operate at 5 V, which makes it very easy to interface to e.g. standard 5 V character displays.Most 32-bit MCUs like ARM etc. (and most of the 16-bit MSP430s) can't run at voltages above 3.6 V.

author: krenzo
author_rank: Regular Contributor
timestamp: December 06, 2013, 05:26:28 pm
content: Quote from: AndersAnd on December 06, 2013, 03:47:42 pmI've always seen that as a negative. All ICs I've ever used run at 3.3V or lower, and to get an AVR to interface with it, you have to reduce the clock speed in order to run it at 3.3V or use a level shifter to convert between 3.3V and 5V. All boards specifically designed for use with an Arduino that I've personally used have had a level shifter in order to interface with the AVR.

author: nctnico
author_rank: Super Contributor
timestamp: December 06, 2013, 06:13:33 pm
content: Quote from: AndersAnd on December 06, 2013, 03:47:42 pmThen again many controllers have 5V tolerant I/O pins.

author: AndersAnd
author_rank: Frequent Contributor
timestamp: December 06, 2013, 06:18:08 pm
content: Quote from: nctnico on December 06, 2013, 06:13:33 pm5 V tolerant pins are only good for inputs. You still need level converters for outputs, if you wan't to interface 5 V logic.

author: dannyf
author_rank: Super Contributor
timestamp: December 06, 2013, 11:19:36 pm
content: QuoteWhether you need one is highly dependent on the applications / devices involved.

author: nctnico
author_rank: Super Contributor
timestamp: December 06, 2013, 11:37:54 pm
content: Quote from: AndersAnd on December 06, 2013, 06:18:08 pmIn most cases its not really a problem. For TTL compatible logic ViH is 1.4V. The only problem child is I2C where ViH is at 0.85*VCC (IIRC).

author: Unknown
author_rank: Unknown
timestamp: December 07, 2013, 01:33:58 am
content: CMOS logic inputs (eg. 74HC) are also tricky. From what I recall VoH of a 5 V micro is just below ViH of common 3.3 V CMOS logic. Which means that it will often work, but not reliably, not to mention the non-existent noise margin. Are TTL-compatible inputs still common outside 74-series logic?

author: cthree
author_rank: Frequent Contributor
timestamp: December 14, 2013, 05:58:36 am
content: AVR/Arduino and Ti 335X ARM Cortex A7/BeagleBone Black. That takes you from an ATTiny45/85 right up to running Linux and everywhere in-between.

author: tszaboo
author_rank: Super Contributor
timestamp: December 14, 2013, 11:26:02 am
content: Quote from: nctnico on December 06, 2013, 11:37:54 pmOh, c'mon, I2C is open drain. That is one of the communication interfaces which will never have problem with 5V-3.3V as long as the 3.3V is 5V compatible.

author: TheMask
author_rank: Newbie
timestamp: December 16, 2013, 11:54:06 am
content: Hi, im new here...I started learning microcontrollers with Zilog eZ8. Too bad these chips are hard to come by.For students, I would highly recommend the PIC16. The venerable 18-pinPIC16F84Aand 40-pinPIC16F877Aare still very nice to learn. Start with C right away. The MPLAB IDE (and now MPLAB X) and Hi-Tech C compiler (and now the XC8) are excellent to use. There are plenty of books and online resources.For tutorial site, thisPIC16 Tutorialis a good introduction.

author: nctnico
author_rank: Super Contributor
timestamp: December 16, 2013, 10:51:56 pm
content: Quote from: NANDBlog on December 14, 2013, 11:26:02 amYou could be in for a nasty surprise here. To achieve the high speeds the transmitter must push the line high for a short period. So a 3.3V device would just push up to 3.3V and leave the rest to the (slow) pull-up resistors.

author: westfw
author_rank: Super Contributor
timestamp: December 17, 2013, 06:41:42 am
content: What percentage of I2C receiver circuits actually require the spec'ed 0.85*VCC ?I rather expect it's like rs232: V+ should be > 3V and V- should be < -3V, but the most popular receiver chips seem to do fine if you power the transmitter from +5/0V.

author: nctnico
author_rank: Super Contributor
timestamp: December 17, 2013, 07:27:26 am
content: Quote from: westfw on December 17, 2013, 06:41:42 amI don't know and I'm not going to find out by designing a board which violates the specs. It may work for a prototype or small batch but problems can remain hidden for a long time. Recently one of my customers had a batch of boards on which part of the circuit didn't work. It turned out to be a silicon bug in the SoC for which a software work-around exists. Hundreds of boards have been produced already which didn't had this problem. Somewhere something changed which caused the issue to surface. Fortunately it can be fixed by a simple software update.

author: AndyC_772
author_rank: Super Contributor
timestamp: December 17, 2013, 08:23:20 am
content: It's easy enough to find out, just look at the Vil and Vih specs for your particular devices - just as you would for any other digital signal.An "I2C spec" is really just an amusing artefact which probably exists on a floppy disc somewhere in a filing cabinet at NXP. 99% of designs which use "I2C" have nothing to do with the "official" I2C specification at all, they're just digital I/O pins which happen to run a similar protocol over a two wire, open drain link.

author: tszaboo
author_rank: Super Contributor
timestamp: December 17, 2013, 09:33:01 am
content: Quote from: nctnico on December 16, 2013, 10:51:56 pmThere you go, strait from the ATMega168 datasheet, it is open drain. Not proof enough? Ti is doing the same.How on earth could they use clock stretching, multi master and other features if they would pull up the lines? 400 Kbit is not "high speed" nor 1 megabit. So unless you have any proof that someone is skimming on specification...

author: AndersAnd
author_rank: Frequent Contributor
timestamp: December 17, 2013, 11:57:01 am
content: Quote from: AndyC_772 on December 17, 2013, 08:23:20 amHere's the official I2C specifications:NXP UM10204 - I2C-bus specification and user manualhttp://www.nxp.com/documents/user_manual/UM10204.pdf

author: nctnico
author_rank: Super Contributor
timestamp: December 17, 2013, 01:22:55 pm
content: Quote from: NANDBlog on December 17, 2013, 09:33:01 amYou are twisting my words. All I said was: be sure to stay within the specifications! And there are ways to enhance the drive of an 'open collector' output. Look at this chip for example (I2C accelerator):http://www.linear.com/product/LTC4311

author: tszaboo
author_rank: Super Contributor
timestamp: December 17, 2013, 01:43:17 pm
content: Quote from: nctnico on December 17, 2013, 01:22:55 pmThat usually never happens as I pointed out. Yes, Linear makes an IC for 4 USD, which can replace two 1 cent resistors.

author: AndyC_772
author_rank: Super Contributor
timestamp: December 17, 2013, 02:48:54 pm
content: Quote from: AndersAnd on December 17, 2013, 11:57:01 amI think you're missing my point. If you have a system in which two devices communicate with each other using "I2C", the chances of that 'official' I2C spec actually applying to either of them are minimal. Much more likely is that one device has a broadly I2C-compatible two wire serial interface, and the other will have a pair of GPIO pins which are driven by software in a way which mimics the approximate behaviour of a 'real' I2C-compliant master.Neither will actually be 'officially' I2C compliant. If they were, then they'd have to pay patent royalties to NXP.Quote from: NANDBlog on December 17, 2013, 01:43:17 pmIt can and does happen, I've done it myself. If you have a heavily loaded bus, the capacitance makes for a very slow rise time when the lines are released and allowed to be pulled high. Achieving a faster rise time means using a lower resistance (smaller RC time constant), but that means more DC current is drawn when the lines are at logic 0. Depending on the drive capabilities of the devices on the bus, this can mean the logic 0 level ends up too high to be valid.To work around the problem, the driver can actively drive SCL and SDA high, just for a moment, before releasing the pin and allowing it to be driven low by other devices. This very brief period of active driving is all that's needed to charge the bus capacitance, so the signal rise time can be short and the overall throughput can be increased.All you need to be aware of is that nothing else should be driving the bus low at the instant the 'active' device drives high - but even then, a few ns of bus contention is unlikely to do any harm. It would only happen if a slave device were trying to do clock stretching - but it's rarely needed, and most "I2C" components don't support this feature anyway.

author: nctnico
author_rank: Super Contributor
timestamp: December 17, 2013, 04:20:35 pm
content: Most of these slew rate ehancement schemes work by detecting the start of an edge and take over from there so there is no bus contention if one device decides to stretch the clock. However when you power a slew rate enhancer (internal or external) from 3.3V on a 5V I2C bus they won't be able to pull the bus up high enough (Vih= 0.7 * 5V=3.5V). AFAIK most I2C devices have slew rate enhancers these days. When I look at an I2C bus I see sharp edges instead of RC charging curves. The pull-ups are just there to have a defined level when the I2C bus is idle.

author: free_electron
author_rank: Super Contributor
timestamp: December 17, 2013, 09:30:55 pm
content: Quote from: nctnico on December 16, 2013, 10:51:56 pmNo it doesn't.None of the traditional devices on I2C push high. SM FM / FM+ and HS mode are purely passive pull-up based. if bus capacitance becomes too high you must apply active pull ups externally.UFM is a push pull driver an UNIDIRECTIONAL. you can not READ on UFM. here no pull ups are neded. such a device is recognisable because it does not use SDa and SCL as pin names but USDA and USCL

author: tszaboo
author_rank: Super Contributor
timestamp: December 18, 2013, 08:11:39 pm
content: Quote from: nctnico on December 17, 2013, 04:20:35 pmAFAIK not. With a 3 Kohm resistor and 100 pF loading, fast mode (1 mbaud) is working on a 3,3V or 5V system without problem according the specs and my memory. 100 pF is about 1,5 meter 0.2mm track on a four layer standard stackup board (on a solid ground plane). The specification talks about the switched pull-up circuit, but only for fast mode, and 300pF loading. 1,5m is already ridiculous amount of capacitance, and I2C is really slow, even the "fast". And manufacturers put everything on the top page if they were able to put 3 extra transistors wherever if they think it has a cool name or function.

author: roli
author_rank: Regular Contributor
timestamp: December 19, 2013, 08:20:42 pm
content: I've been a huge fan of Arduino since I was in high school. I have a bunch of projects realized with arduinos all over my house. And they are great when you want something quick and cheap - perfect for home use.About three years ago I finally made a jump from Arduinos to ARM. And we jumped directly to assembler which looks terribly complicated at first. Then you find out that it is perfectly simple to understand. We worked on an ATM91SAM which is an Atmel ARM chip - a very powerful thing but it was big and quite expensive. And assembler just isn't that useful when you need to do a big project.And I'm currently in my last year of university (I'm studying computer science) and we have a class called embedded systems there. We finally stared using C and we moved to a different micro. A much more modern ARM M4 core - stm32f4. The discovery board costs about 15€ and it just blows a simple Arduino out of the water when it comes to performance. And the code is pretty simple to understand if you use the provided STM peripheral libraries. So I would definitely recommend something like the stm32f4 discovery board. It is perfect to get yourself into basic ARM development.But I do have one question for those that are more experienced - how often do you use these peripheral libraries in a real project? Some libraries are pretty simple and just write a few bits into some registers but some are a bit more complex. Do you write these things from scratch for your specific project or just use them so you can save some time (and maybe increase code readability)?

author: dannyf
author_rank: Super Contributor
timestamp: December 20, 2013, 12:42:43 am
content: QuoteFor quality and reliability reasons (and time to market, etc.), you pretty much have to re-use code. That means libraries.In case where there are oem libraries, I tend to start with my own functional blocks - like setting a timer to interrupt after a user specified interval. Initially, I would implement that through oem libraries; later on, i may selectively implement the same functional blocks via direct registers.This allows you to get your code to work quickly, and reasonably reliably. The resulting high level code can still be used when you replace the functional blocks with your own code.

author: westfw
author_rank: Super Contributor
timestamp: December 20, 2013, 12:57:38 am
content: QuoteOften, I think. Until they've show themselves to be inadequate.Note that this causes a bit of version management work; yet another thing to track, and test after each "upgrade."

author: dannyf
author_rank: Super Contributor
timestamp: December 20, 2013, 01:11:50 am
content: QuoteAssemblers are very useful if you ever want to do with your mcu is to blink an led, or you have lots of time / money to a limited number of projects.Otherwise, it is a total waste of one's time.

author: pyrohaz
author_rank: Regular Contributor
timestamp: December 20, 2013, 06:37:41 pm
content: Since you've already learnt the Arduino, i'd recommend moving to the Maple which is pretty much an ARM version of the standard Arduino. It really helps to learn the "near" lower level commands with arm processors like accessing GPIO registers. After you've got a feel for the Maple such as the higher speed and increased functionality, I'd really recommend getting an STM32Fx discovery board, they're utterly brilliant and really cheap! After spending some time on the Maple, moving to the discovery boards is pretty easy.