Author Topic: Microcontroller after Arduino  (Read 21042 times)

0 Members and 1 Guest are viewing this topic.

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: 18277
  • 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: 18277
  • 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: 4513
  • Country: nl
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: 18277
  • 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: 3099
  • 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: 18277
  • 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: 3503
  • 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: 4513
  • Country: nl
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: 18277
  • 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: 4513
  • Country: nl
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: 3503
  • 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: 18277
  • 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: 7261
  • 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: 4513
  • Country: nl
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: 35
  • 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: 3099
  • 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."
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf