Pic,Avr,or MSP430 for my needs?

Discussion in 'Embedded Systems and Microcontrollers' started by elissaios, Jun 24, 2014.

  1. elissaios

    Thread Starter New Member

    Nov 7, 2012
    14
    0
    Hallo to all,

    I am a student in university of greece in electrical engineering department.
    By now i have only use arduino.

    I want to move to lower lvl.I wanna start to learn about architecture of a microcontroller,timers to write some assembly or low lvl C to learn about how to connect peripherals,GPIO,SPI,interrupts how to connect uart usart)(or how they works if they are already connected) and many others(i know about them but in general),(things that in arduino dont handle so much or all are libraries and is very easy).
    I wanna write some assembly and C.

    Then i would like to move to a MCU with a simple and usefull OS or real time operating system like ZSTACK or Contiki or any other.so to program in higher lvl but to know what happens in lower.

    i wanna suggest me a Mcu with:
    1)"Simple" architecure
    2)Not many assembly instructions
    3)Able to take some simple RTOS
    4)Be popular and many proffesionals use it and it has many applications.

    or maybe is better to start with a mcu and after learn some thing to find an other more complex with an OS?

    Some possible options are MSP430,Cortex avr(i dont know if the are simple for starting out"),or some Pics.

    Thanks very much.
     
    Last edited: Jun 24, 2014
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Without attempting to rekindle the AVR vs. PIC debate, I would go with PIC, simply because among the lower to mid-range PICs, there are both very simple controllers and very complex ones. You can start simple and move to bigger PICs with more features.

    Really, there are plenty of learning materials for each, and each are well suited for beginners (the 16-bit architecture of the MSP430 might be a little more daunting, but not impossible to learn). All of these are professional grade and I've seen each in a number of commercial products.

    These controllers are typically considered too small to get much out of using a RTOS, but that isn't too say that it can't be done, or done with reason.

    Since you've already used Arduino, you may want to look at AVR, as the Arduino is built from the AVR (the chip on your Arduino is an AVR, with the exception of the Due, I think).

    (AVR is the architecture not cortex, that would be an ARM processor and a much more complicated part than the AVR...)
     
  3. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I'm a PIC user, but if I were just starting out, I'd go with AVR. Not that I think there's anything wrong with Microchip's processors, but the simple practical reason is that the best compiler for AVR is free whereas for the PIC there are multiple competing compilers, and to get the most useful ones you have to pay. And before you reach that point you have to evaluate all of them and figure out which one you want to buy, and then live with the situation where only a subset of users will be fully able to understand the problems you'll run into. And then, once you've made your choice and laid out your cash, you have to worry about new processors arriving that your version of the compiler won't support, and updates coming along for which more money is demanded.

    Really, I'm surprised that Microchip processors are so dominant given the software advantage that Atmel has.
     
    absf likes this.
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Best answer is "any of the above."

    Each has advantages and disadvantages, but "not working" is not a disadvantage of any.

    I would suggest you start with a development kit for whatever you begin with, preferably with some sort of lesson plan too. Microchip (the brand I use and am most familiar with) has such for under $75 USD which comes with a very useful programmer and debugger (the PICkit 3). I have a link on my other system if you wish.

    For most simple tasks (including all those you mention) there is no need for any OS.
     
  5. elissaios

    Thread Starter New Member

    Nov 7, 2012
    14
    0
    Thanks very much for the answers.

    Later i need an OS to microcontroller because my interests are smart energy building ,car automation and wireless sensor networks,distributed systems,zigbee which i think they need an OS.
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Those applications do not necessarily require an OS...
     
  7. josip

    Member

    Mar 6, 2014
    63
    12
    If you want to run OS, than best choice is micro that support nested interrupts.

    If I am starting from zero right know, will chose ARM (also for assembly programming). There are plenty of companys, big competition, and starting boards (and also micro itself) cost less than nothing (for example 4$ for cortex M0 USB stick http://www.cypress.com/?rID=92146).

    I am working with TI MSP430F5xx USB chips. There is support for 20-bit registers / address space, and executing 20-bit instructions in 1 cycle. 1 MByte/s USB transfer rate, over 1 Mbps UART transfer, and over 200 KByte/s writing to internal flash. Starting board cost 12$ (including fedex shipping), and it is based on open source software / hardware.

    http://www.ti.com/tool/msp-exp430f5529lp
     
  8. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    i know there are many brands out there, ST and TI to name two important one's, and all the Atmel stuff (Arduino's, and also regular blank chips).

    I started with a very primitive PIC, and learned how to get along with them.

    Tried STM8 recently, of course I got it working, but I figured out it takes me too much effort to re-learn the new IDE, and the different hardware architecture.

    I could do it, but I will stick with PICs. There are many new, interesting one's.

    An OS is not neccessarily better, it can also crash, hang and malfunction.

    And you get an application/library layer for most controllers these days.

    Yes the STM8 and STM32 boards are very low cost, but I'd say, more complex than PICs. Sure even the simple STM8 boards can be used as device programmers, but the chip names are hard to remember.

    The latest PICs include a lot of new functionality, such as logic cells, and 8bit D/A converter, OpAmp, and so on.

    Don't become trapped with old PICs from 15 years ago, with small memories, and few pheripherals.
     
  9. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    Hola takao,

    Could you name a few of those? Gracias.
     
  10. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    For instance the 16F1705 (also 1709 with more memory).
    I have them here as LF (low voltage).

    It has 3x CLC (logic cell), OpAmp, and very useful, 8bit D/A converter.
    Also it only costs around $1 (or 1 Euro).

    For instance the 16F1454- standalone USB controller, crystalless, no need for a crystal, large FLASH memory.

    For instance the 16F1503- one logic cell, built in oscillator, and very cost effective (about 50 cents).

    There are some relatively new 24F PICs too with smaller FLASH, only about $1- with all the 16bit power. Also have a few here.

    There are many new PICs, some still marked as "future products". It is worth to study the Microchip website (Products).
     
  11. elissaios

    Thread Starter New Member

    Nov 7, 2012
    14
    0
    I think rtos is important for interRupt ,task handling and iterrupt priorities.
    I dont know if i am wrong but i think that in field like modern buildings,automations they write to higher level such as an rtos not direct to the microcontroller.Is that true?

    One negative about pics is that the RTOS "AVIX" isnt free like Zstack from ti for example.
     
  12. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    Hola eli,

    I am puzzled because you are asking for advice on what micro to choose to start with the basics while you insists on the necessity of rtos.

    What if you try to blink a LED (by no means a derogatory o contemptuous suggestion but an honest and valid one from my part) and then move to more complex designs?

    Is there something that you know justifying that early concern?

    Intrigued.
     
  13. elissaios

    Thread Starter New Member

    Nov 7, 2012
    14
    0
    I wanna learn a mcu achitecture and instructions that maybe a similar i will use at near future.
    So if i will start with a pic i will not be able to load a RTOS "AVIX" because its not free.
    For example maybe msp430 is a better choice because it takes ZSTACK with some RF.
    I dont know if RTOS is so important as i think i would like someone more experienced to tell me(i think that for Wireless sensor networks,zigbee applications,smart buildings,energy and others it is important).
    For example to learn use GPIOs and turn on a led i dont think it would take more than an hour to do it.
    If it would take me for example 4 months to learn basic architecture and basic assembly with the tools later i want to load some RTOS on the mcu.
     
    Last edited: Jun 24, 2014
  14. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    absf likes this.
  15. MrChips

    Moderator

    Oct 2, 2009
    12,441
    3,361
    Why are you so hung up on learning to use RTOS?
    I would shelve that idea and get on with the basics.

    Pick a microcontroller, any microcontroller, and learn how to make an LED flash using ASM.

    Which controller would you select? That's a different story. Ask ten experienced programmers and you could very likely get ten different answers.

    Conclusion: Don't believe anything anyone says. Everyone has a bias one way or another. You need to come to your own conclusion.
     
    Last edited: Jun 24, 2014
    absf and DerStrom8 like this.
  16. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Absolutely true.
     
  17. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    Flashing LEDs is no shame, I am still doing it (with style of course).

    When you buy a complicated board, flash a RTOS and somehow get a demo working or an additional sensor, you prevent yourself from really learning microcontrollers.

    Some say this needs to include assembler.

    There are many aspects making a small microcontroller circuit:

    -Assembly
    -Power supply
    -Linking the ICSP and mastering the IDE, debugger, compiler options
    -Learning C language
    -Getting some idea of electronic circuit and basic formula

    This is why so many good books with courses are sold, and so many training boards are available.

    Baseline PICs are very simple to use, only 50 pages of which many are not required to read. Cheap too. And they can run small C programs.

    There are no pheripherals, so if it does not work, it won't be the configuration :)

    I still sometimes use the 16F5x, even if I don't need to do it, more than enough advanced chips here.

    It only takes me a few hours to make a small circuit, write a small C program, and make it working.

    I still do this to try out new ideas, new components, and so on.

    A circuit costs me 3 dollars or even less than that.

    Other approaches are to use prefabbed Arduino boards, to breadboard it, or to wire it on a developement board.

    Or you can try STM8/STM32, Freescale, yes why not, flash a RTOS and learn it on a high-level, without touching machine language, USB bootloader already installed.

    Why not, all these things?

    Maybe you have budget, and want to make the best use out of it.

    When you just start with a RTOS, it's like if you start with writing scripts using Eclipse on a small laptop.

    I never used any books for microcontrollers, but I'd recommend to go through the exercises from a book, and get a developement board too, for instance from Mikroelektronika.

    The source code even for the STM8 boards can be hard to understand, for instance the touch library.
     
  18. josip

    Member

    Mar 6, 2014
    63
    12
    As I already mention, micro that don't have nested interuppts is not good choice for RTOS. For me MSP430 is best for many things (regarding competition), but it is not good choice for RTOS.

    http://forum.43oh.com/topic/5521-anyone-using-ti-rtos/

    Any ARM is good base for RTOS.
     
  19. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Potato Pudding likes this.
Loading...