Shop OBEX P1 Docs P2 Docs Learn Events
AVR complementing Propeller (Everyone contribute Please). — Parallax Forums

AVR complementing Propeller (Everyone contribute Please).

davidsaundersdavidsaunders Posts: 1,559
edited 2011-05-16 11:00 in General Discussion
AVR complementing Propeller.

I have seen so many debates on the virtues of the Propeller vs. AVR on these forums, I am now going to flip this.

The purpose of this thread is for everyone to show how the Propeller complements the AVR, and how the AVR complements the Propeller.

The AVR and Propeller are two quite different micros, each with its own strengths and weaknesses. The AVR is good when you need timing by interrupt, a good low speed bit banger, etc.

I ask that every one contribute the positive nature of both, and how they can be used to complement each other. For my contribution see my AVR GG VGA thread in the Propeller forum (I know that it is a little extreme, though it is a way to bring these two onto common ground).

Comments

  • LeonLeon Posts: 7,620
    edited 2011-05-14 09:20
    It should be "complementing" in the title and the first line!

    Here is a little sensor I/F and prototyping board I designed for someone using an AVR ATtiny45:

    http://www.leonheller.com/ATtiny45%20Sensor%20Board/Interface.gif

    I've just been testing one of the boards he sent me, in lieu of payment. It might make a useful peripheral, I could modify the board to provide an I2C interface connector.

    I use an Atmel AVR Dragon for programming and debugging AVRs, the board has a six-way connector for one.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-05-14 10:06
    Two things the AVR can do that require extra effort (or pins) with a Prop:
    1. Unattended PWM.
    2. ADC.

    For these reasons, AVRs could be considered as viable Prop peripherals. And they're certainly less expensive than dedicated ADCs. I would not classify interrupts as a plus, in comparing to a Prop, though. Interrupts are nothing more than a work-around for single-processor micros. People miss them in the Propeller only until they come up to speed with the architecture and realize they're not needed.

    -Phil
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-05-14 12:15
    Do Atmel's recent troubles with broken ADC's in their XMega series have any bearing on their AVR line?
  • LeonLeon Posts: 7,620
    edited 2011-05-14 12:22
    It's not exactly recent, the XMEGAs have been full of bugs since they were launched some years ago and they have never been fixed. The ADCs on ordinary megaAVR devices and other AVRs are mostly OK.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-05-14 13:11
    I've never had issues with the ADCs in the Tiny13 AVRs.

    -Phil
  • jazzedjazzed Posts: 11,803
    edited 2011-05-14 14:59
    Tiny AVRs and other devices can provide nice custom peripherals for Propeller using I2C. I wrote a Keyboard/Mouse handler last year that is shipping on a Gadget Gangster Propeller Platform board. There was some interest in loadable infrastructure on AVRs around that time, but as always something *more interesting* came up.
  • kwinnkwinn Posts: 8,697
    edited 2011-05-14 16:15
    Two things the AVR can do that require extra effort (or pins) with a Prop:
    1. Unattended PWM.
    2. ADC.

    For these reasons, AVRs could be considered as viable Prop peripherals. And they're certainly less expensive than dedicated ADCs. I would not classify interrupts as a plus, in comparing to a Prop, though. Interrupts are nothing more than a work-around for single-processor micros. People miss them in the Propeller only until they come up to speed with the architecture and realize they're not needed.

    -Phil

    In general I agree with what you say, but there are times when having an interrupt is beneficial. Two uses that come to mind at the moment are for a watchdog timer and an interrupt for processing an infrequent but critical event. And yes I am aware that a cog can do this, but that ties up a cog or a substantial number of a cog's cycles.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-14 17:23
    I would not classify interrupts as a plus, in comparing to a Prop, though. Interrupts are nothing more than a work-around for single-processor micros. People miss them in the Propeller only until they come up to speed with the architecture and realize they're not needed.

    -Phil
    For 99% of everything I agree that interrupts are 100% unneeded. Now there are tasks that are infrequent enough, though need to be handled 'NOW' that interrupts are the only efficient way to do so. Or on another view, Why do we waste a Cog for KB and Mouse? These are events that are very infrequent (mouse movement, and typing), that they could just as easily be handled by a Cog that is doing Video output, or any of many other things, though It is inconvenient to do so, because of the lack of interrupts. Now maybe in 15 years when we are all using the Propeller XX (20) with its 256 Cogs, then interrupts on other micros will no longer be an advantage. As it stands for some isolated tasks Interrupts is one of the areas that the AVR can compliment the Prop. Yes we can do all the same things with out interrupts on the Prop, but some times it is better to have them (unless you happen to have a 256 Core micro).
  • jazzedjazzed Posts: 11,803
    edited 2011-05-14 18:13
    Another ignored interrupt advantage (no trying to start some interrupt war since we've had plenty of those over the years) ....

    Aren't some MCUs able to sleep in super low power mode until an interrupt event happens? SX chips? Maybe AVR ... I forget. Such a sleep mode is a definite plus if you're running on batteries. Having to use interrupts can be painful, but for many applications indeterminance (just one key factor) is not relevant.

    Propeller can be battery powered too of course and will last a long time on 2AA's with the right kind of regulation, but it is relatively energy inefficient compared to some MCUs.
  • RossHRossH Posts: 5,519
    edited 2011-05-14 18:39
    jazzed wrote: »
    Another ignored interrupt advantage (no trying to start some interrupt war since we've had plenty of those over the years) ....

    Aren't some MCUs able to sleep in super low power mode until an interrupt event happens? SX chips? Maybe AVR ... I forget. Such a sleep mode is a definite plus if you're running on batteries. Having to use interrupts can be painful, but for many applications indeterminance (just one key factor) is not relevant.

    Propeller can be battery powered too of course and will last a long time on 2AA's with the right kind of regulation, but it is relatively energy inefficient compared to some MCUs.

    Hi jazzed,

    I may be wrong on this (not being a hardware expert) but if the slow internal clock is in use, only one cog is currently running, and that cog is essentially doing a waitpeq, isn't it acting very much like a processor in low power mode waiting for an external interrupt?

    Of course, I realize the Prop is not designed for ultra low power applications - but neither are most MCUs. The company I currently work in makes devices which are battery operated and expected to last for 5 or more years in the field - but this means we have to buy special low power versions of the chips we use which are more expensive than the normal versions.

    Maybe a low powered prop would be a good thing once the Prop II is out?

    Ross.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-05-14 19:48
    Heck, why not turn all the cogs off? Except for the response time, /RST make a great NMI! :)

    -Phil
  • jazzedjazzed Posts: 11,803
    edited 2011-05-14 21:22
    Heck, why not turn all the cogs off? Except for the response time, /RST make a great NMI! :)

    -Phil

    Nice idea. You'd almost have to leave it up to the EEPROM to drain the battery in that state.
  • LeonLeon Posts: 7,620
    edited 2011-05-14 23:07
    The 8-bit and 16-bit XLP PICs typically take 20 nA in deep-sleep mode.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2011-05-15 12:16
    I love using AVR alongside the Prop.

    The Prop is certainly far more capable, and has the wonderful
    precision timing and video services...but I have MUCH more
    experience with AVR and ARM so it is a perfect match for me.

    I especially enjoy using the Atmega1284p with a Prop. The 1284p
    can hold an enormous C program in its 128kb of flash. It's just 5.00USD
    and runs from 1.8 to 5.5V and is very stingy in some of its sleep modes.

    It may be a while before I get to play with my uC's though. We have big trouble
    brewing here :-( We are all carrying our weapons everywhere we go.

    My time here on the forum may be limited or non-existent for a time :-(
  • ctwardellctwardell Posts: 1,716
    edited 2011-05-15 12:55
    It may be a while before I get to play with my uC's though. We have big trouble
    brewing here :-( We are all carrying our weapons everywhere we go.

    My time here on the forum may be limited or non-existent for a time :-(

    Sorry to hear that, be safe.

    C.W.
  • kwinnkwinn Posts: 8,697
    edited 2011-05-15 14:39
    Heck, why not turn all the cogs off? Except for the response time, /RST make a great NMI! :)

    -Phil

    Heck, if response time is not critical you could turn the whole circuit on and off. Good for remote monitoring where readings are taken at low rates.
  • kwinnkwinn Posts: 8,697
    edited 2011-05-15 14:45
    I love using AVR alongside the Prop.

    The Prop is certainly far more capable, and has the wonderful
    precision timing and video services...but I have MUCH more
    experience with AVR and ARM so it is a perfect match for me.


    I especially enjoy using the Atmega1284p with a Prop. The 1284p
    can hold an enormous C program in its 128kb of flash. It's just 5.00USD
    and runs from 1.8 to 5.5V and is very stingy in some of its sleep modes.

    It may be a while before I get to play with my uC's though. We have big trouble
    brewing here :-( We are all carrying our weapons everywhere we go.

    My time here on the forum may be limited or non-existent for a time :-(

    Sorry to hear you are having problems. Please be careful. You would be sorely missed on the forum.

    I wonder if it is possible to have the Atmega emulate the eeprom and load the prop software. That would add flexibility and save a chip.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-15 19:08
    HollyMinkowski:
    tII I hope things begin to improve where you are.

    I find the intent of starting this thread a complete failure. The initial intent was to try to get people to agree on both of these micros in a non disputive manner. The opposite seems to have happened.
  • ctwardellctwardell Posts: 1,716
    edited 2011-05-15 19:47
    David,

    I'm not sure what your goal is, are trying to build a bridge between "fan clubs"?

    It sounds like you have your work cut out for you on your VGA project, I would focus on that without worrying about all the silly Prop this, AVR that, I wanna be an Arduino stuff.

    C.W.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-15 20:09
    ctwardell:
    Good call. I was hoping to shine a little light on the fact that one does not have to exclude the other. Though I do not that I even fully agree with my own point, I keep finding myself asking why can't I just do that in another core while doing the AVR side of my VGA project, only to wish that the AVR were a Prop.

    I come to the forums both to learn and to relax, as for me a little bit of intellectual interaction is quite soothing to the soul.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-05-15 20:29
    Holly,

    I was feeling sorry for myself today, having to deal with soul-sucking Windows crash issues. Then I read your post and realized how how much worse things could be. Please be careful! And please report back from time to time, so we know you're okay!

    -Phil
  • potatoheadpotatohead Posts: 10,261
    edited 2011-05-15 22:07
    Yeah I was brewing here too. Life gets in the way, and I get grumpy. A quick comparison tells me, I've got no real worries. Thanks for that!

    Stay safe. I know many of us enjoy your contributions here.
  • kwinnkwinn Posts: 8,697
    edited 2011-05-16 11:00
    I find the intent of starting this thread a complete failure. The initial intent was to try to get people to agree on both of these micros in a non disputive manner. The opposite seems to have happened.

    I don't really see this thread as a failure. At least two of us agree with you (Holly and I), and others seem to implicitly agree that the features available on other chips (interrupts, adc's, etc) are useful in conjunction with the prop. Unfortunately folks who disagree with you are far more likely to post a response than those who agree. Human nature......sigh.
Sign In or Register to comment.