Shop OBEX P1 Docs P2 Docs Learn Events
I/O expansion co-processor options? — Parallax Forums

I/O expansion co-processor options?

I would like to offload certain lower priority tasks from the Prop that require PWM outputs and analog inputs along with digital I/O. I have been considering the Picaxe 20M2, only because I have one laying around. Thinking of stringing 2 or 3 of these devices as I2C slaves.

What alternatives are recommended?

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-12-10 11:53
    Do you really need to offload tasks or is it a matter of I/O? I've found that rarely do I need to offload tasks, most of the time it is simply a matter of I/O. Sometimes it's a matter of memory in the case of video graphics and most I/O expansion can be done by assigning low priority I/O to I2C expansion chips. In other cases I use multiple Props networked over half-duplex serial because they need to be where they need to be and serial is an easy way to connect them. If that distance is more than a few metres or in a noisy environment I will simply use two I/O to make a RS-485 channel.

    Now I am designing a system with 40+ processors and it just makes good sense to make them all Props. That way the software development environment is the same for all of them plus the fact too that Props are the only processor I know of whereby I can use an I/O pin as it suits me, not according to a complicated function pinout which by the way you never seem to get the mix you want anyway.

    I know I can use all these beaut little ARM doodads but for the sake of a couple of dollars extra I am so much better off with the Prop than with all these enticing little wonders.
  • I would absolutely prefer to keep it all Prop but I am looking for an easy, clean solution. I am already up to 8 Props for handling the high priority tasks. The Picaxe has hardware I2C (IIRC) and doesn't require an external clock & eprom.
    I need to drive a few hydraulic-valve solenoids (PWM) and receive 0-10v feedback from linear transducers. I am talking rough positioning, in this case. The Picaxe pins are very flexible/configurable and apparently the ADCs are 10 bit (although 8 bit would suffice). On-chip programming could also be useful for in-the-field tweaking.
  • I like TI's MSP430 as well, since it's a puny 25 cent chip (and low power if you care). However, a full ARM Cortex-M chip is still quite cheap and gives you a ton more power.
  • Micromite - LOTS of power, programmed in BASIC, pretty stupid simple to get it to do things like I2C, PWM, etc.

    $4 chip and a tantalum capacitor adds it to your project.
  • David BetzDavid Betz Posts: 14,516
    edited 2015-12-10 14:56
    mindrobots wrote: »
    Micromite - LOTS of power, programmed in BASIC, pretty stupid simple to get it to do things like I2C, PWM, etc.

    $4 chip and a tantalum capacitor adds it to your project.
    Does Micromite BASIC support named functions and subroutines with parameters?

    Edit: Just checked mmbasic.com and it looks like the answer is "yes"! Actually, MMBasic looks very complete. I'll have to brush off one of my MMC boards and try it out.

  • Like so?

    Subroutine Arguments
    Defined subroutines can have arguments (sometimes called parameter lists). In the definition of the subroutine they look like this:

    SUB MYSUB (arg1, arg2$, arg3)
    <statements>
    <statements>
    END SUB

    or this?

    Defined Functions
    Defined functions are similar to defined subroutines with the main difference being that the function is used to return a value in an expression. For example, if you wanted a function to select the maximum of two values you could define:

    FUNCTION Max(a, b)
    IF a > b
    Max = a
    ELSE
    Max = b
    ENDIF
    END FUNCTION

    Plus you can add your own functions written in C - CFunctions.

    You can collect all this into a library and extend the language.

    The LIBRARY Feature


    Using the LIBRARY feature it is possible to add user written features to MMBasic and make them permanent and part of the language. For example, you might have written a series of subroutines and functions that perform sophisticated bit manipulation; these could be stored as a library and become part of MMBasic and perform the same as other built in functions that are already part of the language.

    It has become a very powerful BASIC implementation with LOTS of usable memory now on the PIC32MX170 - but you do need to buy a $4 chip and a capacitor, :)
  • mindrobots wrote: »
    Like so?

    Subroutine Arguments
    Defined subroutines can have arguments (sometimes called parameter lists). In the definition of the subroutine they look like this:

    SUB MYSUB (arg1, arg2$, arg3)
    <statements>
    <statements>
    END SUB

    or this?

    Defined Functions
    Defined functions are similar to defined subroutines with the main difference being that the function is used to return a value in an expression. For example, if you wanted a function to select the maximum of two values you could define:

    FUNCTION Max(a, b)
    IF a > b
    Max = a
    ELSE
    Max = b
    ENDIF
    END FUNCTION

    Plus you can add your own functions written in C - CFunctions.

    You can collect all this into a library and extend the language.

    The LIBRARY Feature


    Using the LIBRARY feature it is possible to add user written features to MMBasic and make them permanent and part of the language. For example, you might have written a series of subroutines and functions that perform sophisticated bit manipulation; these could be stored as a library and become part of MMBasic and perform the same as other built in functions that are already part of the language.
    Do you have to be able to reprogram the flash in the PIC32 to add libraries? In other words, do you need JTAG access to the PIC32 chip?

    It has become a very powerful BASIC implementation with LOTS of usable memory now on the PIC32MX170 - but you do need to buy a $4 chip and a capacitor, :)

    $4? You've got to be kidding. That's a blocking issue for me. I can't spend more than $3.99! :-)

  • Sure, ask me about something I haven't done....nobody just wants to blink an LED anymore or talk to a sensor!! :)

    It looks like they have you covered:
    To install a library you need to write and test the routines as you would with any normal BASIC routines. When you are satisfied that they are working correctly you can use the LIBRARY SAVE command. This will transfer the routines (as many as you like) to a non visible part of flash memory where they will be available to any BASIC program but will not show when the LIST command is used and will not be deleted when a new program is loaded or NEW is used. However the saved subroutines and functions can be called from within the main program and can even be run at the command prompt (just like a built in command or function).

    There's also a LIBRARY DELETE command. Maybe you should check out the 91page PDF in the ZIP file? Of course, I've already copied a good portion of it to this thread!! :D

    $3.99? Maybe in quantity??? :)

  • This looks like a perfect complement for the Propeller. Memory, FP math, etc.

    That's it, never making a decision without consulting this forum again.

    Many thanks!
  • I thought you might appreciate a BASIC solution :D

    It will set you back some portion of your lunch money to try it though!

    If you want the total retro BASIC experience, try a MMC w/ Propeller as I/O coprocessor for the uMite. A fun BASIC platform if you like retro computing.

    If you just need a modern BASIC engine, just put the PIC32 on a breadboard and hook up some serial connections.
  • jmgjmg Posts: 15,173
    Mickster wrote: »
    I/O expansion co-processor options? I would like to offload certain lower priority tasks from the Prop that require PWM outputs and analog inputs along with digital I/O.

    What package(s) and price points ?

    If you want DIP, and price is less important, then the Microchip host mentioned above is hard to go past.
    That packs a lot into DIP28.

    If price matters more, (sub $1) and SMD packages are ok, then the SiLabs EFM8 series give the most Peripheral for your dollar. The new EFM8BB3 include 12b DACs as well as 12b ADCs, and are pin-compatible with the LB1 which has 14b ADC. With SPI / UART x2 / i2c x 2, that's a lot of IO expansion connection choices.
    BB3 can also output 4.802~4.998MHz signal to clock the Prop, if needed, from the 49MHz osc.


    EFM8 series Packages available, in order of decreasing pin-pitch, are

    SO16N
    TQFP32
    QSOP24
    QFN20/24/32 in 0.5mm and 0.4mm & even a 0.4mm BGA ~1.7mm sq.

  • jmg wrote: »

    What package(s) and price points ?

    Heck, I'm already getting carried away and looking at the new 64pin and upcoming 100pin Micromite+ to conserve the Prop's precious resources. :-D
Sign In or Register to comment.