Author Topic: Microcontroller after Arduino  (Read 21756 times)

0 Members and 1 Guest are viewing this topic.

Offline Thane of Cawdor

  • Regular Contributor
  • *
  • Posts: 87
Microcontroller after Arduino
« on: November 19, 2013, 07:41:28 am »
Hi

I 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
« Last Edit: November 20, 2013, 08:47:18 am by Thane of Cawdor »
 

Offline PeterG

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
Re: Microcontroller after Arduino
« Reply #1 on: November 19, 2013, 08:04:05 am »
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.

Regards
PeterG
Testing one two three...
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3685
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Microcontroller after Arduino
« Reply #2 on: November 19, 2013, 08:29:50 am »
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!)

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
Re: Microcontroller after Arduino
« Reply #3 on: November 19, 2013, 08:37:09 am »
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.

Quote
would you be able to use the Arduino environment when making a professional product?
Maybe.  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.
 

Online BravoV

  • Super Contributor
  • ***
  • Posts: 6989
  • Country: 00
  • +++ ATH1
Re: Microcontroller after Arduino
« Reply #4 on: November 19, 2013, 08:50:47 am »
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.

Offline Corporate666

  • Supporter
  • ****
  • Posts: 2007
  • Country: us
  • Remember, you are unique, just like everybody else
Re: Microcontroller after Arduino
« Reply #5 on: November 19, 2013, 09:27:23 am »
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.
It's not always the most popular person who gets the job done.
 

Offline Thane of Cawdor

  • Regular Contributor
  • *
  • Posts: 87
Re: Microcontroller after Arduino
« Reply #6 on: November 19, 2013, 09:32:34 am »
Thanks

I just can't get my head around FPGA's, they seem very difficult to program and use to me. How would one get started in FPGA's?
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Microcontroller after Arduino
« Reply #7 on: November 19, 2013, 11:25:16 am »
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.

Energia 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.

The larger the government, the smaller the citizen.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 6604
  • Country: gb
Re: Microcontroller after Arduino
« Reply #8 on: November 19, 2013, 11:35:46 am »
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.

Energia 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.

The MSP430 is 16-bit.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #9 on: November 19, 2013, 12:03:14 pm »
Quote
Which microcontroller should I use?

It 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.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #10 on: November 19, 2013, 12:10:22 pm »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #11 on: November 19, 2013, 12:12:03 pm »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline Thane of Cawdor

  • Regular Contributor
  • *
  • Posts: 87
Re: Microcontroller after Arduino
« Reply #12 on: November 19, 2013, 12:15:34 pm »
So is there a certain development board/microcontroller and software that you recommend in the range of ARM products?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #13 on: November 19, 2013, 12:30:45 pm »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline JoeO

  • Frequent Contributor
  • **
  • Posts: 525
  • Country: us
  • I admit to being deplorable
Re: Microcontroller after Arduino
« Reply #14 on: November 19, 2013, 12:50:41 pm »
They are inexpensive because TI knows it will make money when their parts are used in a product.
The day Al Gore was born there were 7,000 polar bears on Earth.
Today, only 26,000 remain.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 3027
  • Country: si
Re: Microcontroller after Arduino
« Reply #15 on: November 19, 2013, 01:08:41 pm »
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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6871
Re: Microcontroller after Arduino
« Reply #16 on: November 19, 2013, 01:18:18 pm »
I would recommend PICs and some 8051s (Silabs make some interesting ones.)
 

Offline gocemk

  • Regular Contributor
  • *
  • Posts: 84
  • Country: mk
Re: Microcontroller after Arduino
« Reply #17 on: November 19, 2013, 01:56:54 pm »
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.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #18 on: November 19, 2013, 02:57:05 pm »
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 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.
The 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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
Re: Microcontroller after Arduino
« Reply #19 on: November 19, 2013, 05:08:18 pm »
Quote
you have successfully convinced me to start learning C. Where do I start(complete beginner)?
Oh, 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.
 

Offline filip_cro

  • Regular Contributor
  • *
  • Posts: 71
  • Country: hr
Re: Microcontroller after Arduino
« Reply #20 on: November 19, 2013, 05:35:31 pm »
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.
« Last Edit: November 19, 2013, 05:38:03 pm by filip_cro »
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 3027
  • Country: si
Re: Microcontroller after Arduino
« Reply #21 on: November 21, 2013, 07:24:59 pm »
The 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.

Yes 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.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3685
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Microcontroller after Arduino
« Reply #22 on: November 21, 2013, 08:14:26 pm »
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.

Offline IanB

  • Super Contributor
  • ***
  • Posts: 9733
  • Country: us
Re: Microcontroller after Arduino
« Reply #23 on: November 21, 2013, 08:40:26 pm »
Hi

I 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

Arduino 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.
I'm not an EE--what am I doing here?
 

Offline ddavidebor

  • Super Contributor
  • ***
  • Posts: 1168
  • Country: gb
    • Fermium
Microcontroller after Arduino
« Reply #24 on: November 21, 2013, 09:22:05 pm »
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.



Davide Bortolami,
Fermium LTD
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #25 on: November 22, 2013, 12:50:03 am »
Quote
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.

A 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.

================================
https://dannyelectronics.wordpress.com/
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 6554
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Microcontroller after Arduino
« Reply #26 on: November 22, 2013, 12:51:25 am »
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.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #27 on: November 22, 2013, 12:53:09 am »
Low-end PICs aren't good from a modular programming point of view.

I like PIC24 as well.

Wouldn't touch PIC32 at all.
================================
https://dannyelectronics.wordpress.com/
 

Offline ddavidebor

  • Super Contributor
  • ***
  • Posts: 1168
  • Country: gb
    • Fermium
Microcontroller after Arduino
« Reply #28 on: November 22, 2013, 06:10:15 am »
I think he'a moving on because he want to learn more, not do more.
Davide Bortolami,
Fermium LTD
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Microcontroller after Arduino
« Reply #29 on: November 22, 2013, 09:58:58 am »
Quote
I think he'a moving on because he want to learn more, not do more.


Yep! Basically I know that Arduinos are good to learn with but I want to learn programming in C which it seems is vital in todays industry  :-+

My 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. :P
The larger the government, the smaller the citizen.
 

Offline rverm

  • Contributor
  • Posts: 8
  • Country: us
Re: Microcontroller after Arduino
« Reply #30 on: November 23, 2013, 12:58:54 am »
 I have only used pic chips























Thats 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.









 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 6554
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Microcontroller after Arduino
« Reply #31 on: November 23, 2013, 05:13:36 am »
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...
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
Re: Microcontroller after Arduino
« Reply #32 on: November 23, 2013, 06:13:14 am »
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?  |O |O |O |O

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

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
Re: Microcontroller after Arduino
« Reply #33 on: November 23, 2013, 07:01:13 am »
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!
 

Offline Sasja

  • Contributor
  • Posts: 49
  • Country: 00
Re: Microcontroller after Arduino
« Reply #34 on: November 23, 2013, 01:32:43 pm »
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.html
Print 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!
« Last Edit: November 23, 2013, 02:39:21 pm by Sasja »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #35 on: November 23, 2013, 03:15:30 pm »
Quote
take a look at these tutorials:

It is the best, par none.

Quote
buy all the pic's he uses

He used some very old PICs. You can get more powerful PICs at much lower price points and with better availability today.
================================
https://dannyelectronics.wordpress.com/
 

alm

  • Guest
Re: Microcontroller after Arduino
« Reply #36 on: November 23, 2013, 03:39:10 pm »
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.
 

Offline Sasja

  • Contributor
  • Posts: 49
  • Country: 00
Re: Microcontroller after Arduino
« Reply #37 on: November 23, 2013, 06:45:13 pm »
Quote
take a look at these tutorials:

It is the best, par none.

Quote
buy all the pic's he uses

He used some very old PICs. You can get more powerful PICs at much lower price points and with better availability today.

i 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:  :palm: 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 then  :wtf: who 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 build
2) then find out what you need to learn to do that
3) build it

i 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 :).
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #38 on: November 23, 2013, 10:09:46 pm »
Quote
select exactly the pic for the job.

That 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).
================================
https://dannyelectronics.wordpress.com/
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #39 on: November 24, 2013, 01:40:34 am »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Sasja

  • Contributor
  • Posts: 49
  • Country: 00
Re: Microcontroller after Arduino
« Reply #40 on: November 24, 2013, 07:37:30 am »
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.
« Last Edit: November 24, 2013, 07:46:00 am by Sasja »
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2021
  • Country: ca
Re: Microcontroller after Arduino
« Reply #41 on: November 25, 2013, 01:43:28 pm »
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.

What 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.
 

Offline Sasja

  • Contributor
  • Posts: 49
  • Country: 00
Re: Microcontroller after Arduino
« Reply #42 on: November 25, 2013, 06:07:38 pm »
Can we come up with a conclusion though, I keep on tossing back and forth between different systems  ;)
are 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.
 

Offline ddavidebor

  • Super Contributor
  • ***
  • Posts: 1168
  • Country: gb
    • Fermium
Microcontroller after Arduino
« Reply #43 on: November 26, 2013, 06:26:34 am »
Well we all agree that if you want to learn more about good programming you need to leave arduino ide.
Davide Bortolami,
Fermium LTD
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #44 on: November 26, 2013, 12:05:46 pm »
Quote
What complete nonsense.

Maybe they defined "market" differently; maybe they used different criteria to rank; maybe they ranked different products, etc.

================================
https://dannyelectronics.wordpress.com/
 

Offline Kappes Buur

  • Regular Contributor
  • *
  • Posts: 136
  • Country: ca
Re: Microcontroller after Arduino
« Reply #45 on: December 04, 2013, 07:18:53 am »
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.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
Re: Microcontroller after Arduino
« Reply #46 on: December 04, 2013, 09:49:31 am »
Quote
implemented as BOBs
I'm missing something.  What's a "BOB" ?
 

Offline Crazy Ape

  • Regular Contributor
  • *
  • Posts: 181
Re: Microcontroller after Arduino
« Reply #47 on: December 04, 2013, 01:03:41 pm »
Quote
implemented as BOBs
I'm missing something.  What's a "BOB" ?

Bits n Bobs almost fits. Pluggings bits into bobs.  ;D

However, I think in this case the BOB in question is a Break Out Board.
 
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #48 on: December 05, 2013, 12:19:41 pm »
Quote
Coupled with Atmel Studio 6.1

That'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.
================================
https://dannyelectronics.wordpress.com/
 

Offline miceuz

  • Frequent Contributor
  • **
  • Posts: 376
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: Microcontroller after Arduino
« Reply #49 on: December 05, 2013, 04:27:36 pm »
Berni, you have successfully convinced me to start learning C. Where do I start(complete beginner)? Is the Launchpad coded in C as well?

If 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-libc

Once 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.

Offline AndersAnd

  • Frequent Contributor
  • **
  • Posts: 568
  • Country: dk
Re: Microcontroller after Arduino
« Reply #50 on: December 06, 2013, 03:47:42 pm »
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 assembly http://www.atmel.com/microsite/atmel_studio6/
There's a large online community for Atmel AVR here: http://www.avrfreaks.net

Once 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.
 

Offline krenzo

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
Re: Microcontroller after Arduino
« Reply #51 on: December 06, 2013, 05:26:28 pm »
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.

I'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.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #52 on: December 06, 2013, 06:13:33 pm »
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.
Then again many controllers have 5V tolerant I/O pins.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline AndersAnd

  • Frequent Contributor
  • **
  • Posts: 568
  • Country: dk
Re: Microcontroller after Arduino
« Reply #53 on: December 06, 2013, 06:18:08 pm »
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.
Then again many controllers have 5V tolerant I/O pins.
5 V tolerant pins are only good for inputs. You still need level converters for outputs, if you wan't to interface 5 V logic.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #54 on: December 06, 2013, 11:19:36 pm »
Quote
I've personally used have had a level shifter in order to interface with the AVR.

Whether you need one is highly dependent on the applications / devices involved.
================================
https://dannyelectronics.wordpress.com/
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #55 on: December 06, 2013, 11:37:54 pm »
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.
Then again many controllers have 5V tolerant I/O pins.
5 V tolerant pins are only good for inputs. You still need level converters for outputs, if you wan't to interface 5 V logic.
In 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).
« Last Edit: December 06, 2013, 11:47:51 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

alm

  • Guest
Re: Microcontroller after Arduino
« Reply #56 on: December 07, 2013, 01:33:58 am »
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?
« Last Edit: December 07, 2013, 01:36:57 am by alm »
 

Offline cthree

  • Frequent Contributor
  • **
  • Posts: 258
  • Country: ca
Re: Microcontroller after Arduino
« Reply #57 on: December 14, 2013, 05:58:36 am »
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.
 

Offline NANDBlog

  • Super Contributor
  • ***
  • Posts: 4750
  • Country: nl
  • Current job: ATEX certified product design
Re: Microcontroller after Arduino
« Reply #58 on: December 14, 2013, 11:26:02 am »
In 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).
Oh, 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.
 

Offline TheMask

  • Newbie
  • Posts: 2
Re: Microcontroller after Arduino
« Reply #59 on: December 16, 2013, 11:54:06 am »
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-pin PIC16F84A and 40-pin PIC16F877A are 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, this PIC16 Tutorial is a good introduction.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #60 on: December 16, 2013, 10:51:56 pm »
In 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).
Oh, 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.
You 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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
Re: Microcontroller after Arduino
« Reply #61 on: December 17, 2013, 06:41:42 am »
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.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #62 on: December 17, 2013, 07:27:26 am »
What percentage of I2C receiver circuits actually require the spec'ed 0.85*VCC ?
I 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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3685
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Microcontroller after Arduino
« Reply #63 on: December 17, 2013, 08:23:20 am »
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.

Offline NANDBlog

  • Super Contributor
  • ***
  • Posts: 4750
  • Country: nl
  • Current job: ATEX certified product design
Re: Microcontroller after Arduino
« Reply #64 on: December 17, 2013, 09:33:01 am »
In 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).
Oh, 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.
You 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.

There 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...
 

Offline AndersAnd

  • Frequent Contributor
  • **
  • Posts: 568
  • Country: dk
Re: Microcontroller after Arduino
« Reply #65 on: December 17, 2013, 11:57:01 am »
An "I2C spec" is really just an amusing artefact which probably exists on a floppy disc somewhere in a filing cabinet at NXP.
Here's the official I2C specifications:
NXP UM10204 - I2C-bus specification and user manual http://www.nxp.com/documents/user_manual/UM10204.pdf
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #66 on: December 17, 2013, 01:22:55 pm »
In 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).
Oh, 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.
You 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.
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...
You 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
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline NANDBlog

  • Super Contributor
  • ***
  • Posts: 4750
  • Country: nl
  • Current job: ATEX certified product design
Re: Microcontroller after Arduino
« Reply #67 on: December 17, 2013, 01:43:17 pm »
To achieve the high speeds the transmitter must push the line high for a short period.
That usually never happens as I pointed out. Yes, Linear makes an IC for 4 USD, which can replace two 1 cent resistors.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3685
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Microcontroller after Arduino
« Reply #68 on: December 17, 2013, 02:48:54 pm »
Here's the official I2C specifications:

I 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.

That usually never happens as I pointed out. Yes, Linear makes an IC for 4 USD, which can replace two 1 cent resistors.
It 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.

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19839
  • Country: nl
    • NCT Developments
Re: Microcontroller after Arduino
« Reply #69 on: December 17, 2013, 04:20:35 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7510
  • Country: us
    • SiliconValleyGarage
Re: Microcontroller after Arduino
« Reply #70 on: December 17, 2013, 09:30:55 pm »

You 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.
No 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
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline NANDBlog

  • Super Contributor
  • ***
  • Posts: 4750
  • Country: nl
  • Current job: ATEX certified product design
Re: Microcontroller after Arduino
« Reply #71 on: December 18, 2013, 08:11:39 pm »
AFAIK most I2C devices have slew rate enhancers these days.
AFAIK 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.
 

Offline roli

  • Contributor
  • Posts: 43
  • Country: si
Re: Microcontroller after Arduino
« Reply #72 on: December 19, 2013, 08:20:42 pm »
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)?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #73 on: December 20, 2013, 12:42:43 am »
Quote
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)?

For 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.
================================
https://dannyelectronics.wordpress.com/
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
Re: Microcontroller after Arduino
« Reply #74 on: December 20, 2013, 12:57:38 am »
Quote
how often do you use these [vendor provided] peripheral libraries in a real project?
Often, 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."
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Microcontroller after Arduino
« Reply #75 on: December 20, 2013, 01:11:50 am »
Quote
And assembler just isn't that useful when you need to do a big project.

Assemblers 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.
================================
https://dannyelectronics.wordpress.com/
 

Offline pyrohaz

  • Regular Contributor
  • *
  • Posts: 186
  • Country: gb
    • Harris' Electronics!
Re: Microcontroller after Arduino
« Reply #76 on: December 20, 2013, 06:37:41 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf