Shop OBEX P1 Docs P2 Docs Learn Events
Deciding on a Platform — Parallax Forums

Deciding on a Platform

Orca94Orca94 Posts: 3
edited 2007-07-30 22:16 in Propeller 1
So I'm sort of a newbie when it comes to microcontrollers and such. I've programmed some proprietary setups using motorola chips in C via a mechatronics class I took for my undergrad coursework last year. I'm relatively well versed in C, Java, and VB, and am relatively knowledgeable with regard to electronic design for a Mechanical Engineer.

Basically I'm trying to get more familiar with microcontrollers via some projects I'd like to work on independently and was hoping to get some feedback on which platform you guys think would be best for me to start off with.

I had originally narrowed my list down to PIC and AVR. But recently I became aware of the propeller chips and thought they might be a viable alternative to either the PIC or AVR given the multiple COG structure and libraries for video and such. I realize there are easier choices to become familiar with microcontrollers but I'm a quick learner and prefer to get my hands dirty/invest in something that's most flexible.

So I guess people here are probably going to be somewhat gung ho on the Propeller chips but what are some advantages to the chip over the AVR chips in particular. I realize the propeller chips are more expensive but that's not really a big deal seeing as how either chip would be under $20.

Some projects/capabilities I'm looking to work on/with are:

Video output
Motor control using PWM
Sensor readings using A/D converters and serial
Running stepper motors
Running servos
Building a feedback control system for a self balancing robot setup (would the propeller be fast enough for this?)
Building a CNC
Building some sort of robotics platform

Also I see that a lot of mentions of EEPROM being interfaced with the propeller chips, is this because they generally don't have enough space to store the average project compiled in SPIN? Also are the libraries available/guide on how to do this effectively?

Is the multiple processor scheme difficult to work with?

How difficult is it to interface the chip with devices that work with 5V logic highs for outputs? (for input signals I realize all that is needed is a resistor)

Thank you all in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-30 03:21
    To answer some of these questions in a different order:

    Re: EEPROM. The Propeller chip has no persistent memory (like EEPROM), only RAM and ROM. This is mostly because the process (technology) used to make the chips can't be used to make EEPROM on the same chip. There is a boot loader in ROM that will automatically load up to 32K of RAM from either an attached PC or an attached EEPROM. The PC has to be running a program that resets the Propeller, then carries on a specific conversation with the Propeller boot loader before downloading the program. The PC can instruct the boot loader to copy this program in RAM to the attached EEPROM. It can also instruct the boot loader to start either copy of the downloaded program (in RAM or EEPROM). That's how the Propeller Tool (Spin/assembler IDE) downloads a program and can start it.

    The multiple processor scheme is not hard to work with. You can pretty much ignore it if you want and just use other cogs as peripheral processors running I/O routines like for a video display, serial I/O, and a PS/2 keyboard and mouse.

    It's easy to interface the chip with 5V devices. Most of them require only a 1K resistor in series with the Propeller pin. There's a whole thread (listed as HOW TO SAFELY INTERFACE A 5V SIGNAL TO THE PROPELLER?) on how to do this.

    Most of the contributed libraries are in the Propeller Object Exchange which is linked to off the main Propeller Page. Have a look.

    There are preexisting examples and contributed libraries for many of the things you want to do.

    The Propeller is very fast. In Spin, it can do half-duplex serial I/O at 19.2KBaud with maybe 1/2 page of code. VGA video at 1024 x 768 resolution, mostly text with some small areas of graphics mixed in can be done using 2 cogs and only a couple of resistors for external hardware.

    Post Edited (Mike Green) : 7/30/2007 3:27:37 AM GMT
  • Orca94Orca94 Posts: 3
    edited 2007-07-30 03:28
    Thanks, I'm assuming at those speed you could probably get a pretty decent PWM signal out of it as well?

    Also, what do you think the propeller's advantages/disadvantages are versus chips like the PIC and AVR are(if you've used them before)?

    Thanks Again
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-30 04:08
    I've used some of the small to medium size PICs and there's really no comparison. The Propeller is a very fast 32 bit processor while the PICs I've used are all 8 bit processors. The PICs have some nice peripheral devices (like timers, ADCs, and UARTs) built-in, but sometimes they're buggy or messy to use, like you have to use certain pins for certain functions. Addressing can be a pain if you need to use assembly since the work registers are bank switched. It's hard to get a compiler to put out compact code if you use a high level language (like Basic or C). The Propeller is programmed in Spin which is functionally similar to C and in its assembly language. Spin is pretty easy to use, particularly if you're not doing fancy multiprocessor stuff. As I mentioned, using the multiprocessing aspects of the Propeller with "canned" I/O drivers is straightforward. Doing your own assembly stuff is a bit different than with the PICs since you're really writing whole assembly programs, not subroutines called from high level code as you might do with the PICs. These programs run in parallel in their own cog and you have to plan for communication with the rest of the program. It's not as hard as it may sound, but it's different.

    Regarding PWM ... There are special purpose counters (2 of them) built into each cog. They're accessible from Spin as well as from assembly and, if you use them for pulse generation, you can control the width to the nearest clock cycle which is 12.5ns with an 80MHz clock. Have a look at the application note on the counters (AN001 ... from the download area off the main Propeller page).

    Post Edited (Mike Green) : 7/30/2007 4:14:44 AM GMT
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-07-30 05:26
    As one who develops with both the AVR's and Propeller's, if I could, I'd give up the AVR's after having worked with the prop. I am CONSTANTLY going back to the data sheets trying to determine what resgister bit I need to set to make something happen. To have to deal with interrupt oriented events, worry about and debug interrupt issues, and being locked into only having specific pins perform specific functions drives me batty now. The ability of the Propeller to use any pin for any function, to have control of the hardware and what it does, and the ease of spin makes me dread both teaching and using 'traditional architectures'.

    Why do I still use AVRs? One, I don't like surface mount work, and a 40-pin PDIP is huge. I'm working with a company who wants the code secure (at least moderately), so the off-chip EEPROM is a killer on the Prop, and while the delta-sigma ADC of the prop may be nice, I don't fully trust it or my ability to lay things out correctly, and neither do some companies I consult for, so an AVR with internal traditional ADC's is my choice many times.

    Now if the application needs a good interface... my choice is simple [noparse]:)[/noparse]

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-07-30 05:29
    Oh, quick example, I have an application that requires 3 UARTs. Do you know how long I spend pouring over the specs of the AVR family to try to find the fit for the hardware and peripherals I need?? With a propeller, I'd simply use 3 cogs as the 3 UARTs. End of search! Unfortunately, the code protection is a bigger issue in this case...

    -Martin
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-30 17:13
    After working with the Propeller for about two weeks, I'm hardly an expert, but this seems like a good thread to throw in my 2 cents worth.· I've programmed PICs, AVR's, and some more exotic stuff as well.· The prop beats them all, hands down.· The number one thing that blew my mind was getting serial comm to work, it was easier on the prop, without a built-in UART, than it was on any other chip with a built-in UART.· The SPIN language and the pre-made objects supplied with the compiler are what's going to make the prop a success.· The only other system out there that kinda comes close is Freescale's HC9S08's with Code Warrior and Processor Expert, but I still found myself with my nose buried in the data sheets constantly.· Before I retired I did build some quick and dirty test equipment that made my job (service tech for a computer vendor) quite a bit easier.· Nothing too exotic, just a network wiring tester that pushed enough current through the wires to make a weak connection show up, and an exerciser for async terminals that gave them a good workout before we took them out to a customer.· That was a PIC and an AVR.· I could have built both of them into a prop with room for a few more things, and still spent less time on the software.
  • Orca94Orca94 Posts: 3
    edited 2007-07-30 22:16
    Thank for all your help guys.
Sign In or Register to comment.