Let's Make Robots!

Picaxe as an I/O expander for Arduino

As I was thinking of new features for my robot, I realised how painfully short I was on pins! The Arduino Mini just doesn't have enough! I'm not thinking of upgrading to a Mega, seeing how pricey it is and also because it's pretty huge. That's when I though of I/O expanders. Unfortunately, most are designed to be shields for anything but the Arduino Mini, so, again, I didn't know what to do. That's when I thought of using a Picaxe for expanding! I'm thinking of using a PWM or an analog pin from the Arduino as an output to a Picaxe input pin. Different ranges of PWM/Voltage the pin issues correspond to different pins on the Picaxe being turned HIGH or LOW. Let's say 1 to 10 PWM means Pin 1 and a 255 PWM signal following in the next milliseconds signals HIGH, while a 0 PWM signal means LOW. Just a basic idea of a communication protocol using 1 pin. 

Also, why Picaxe? I think Picaxe boards are very cheap and small, which gives them an advantage over the bulky and more expensive I/O expanders I've looked at. 

This is just a thought I wanted to share, and I also wanted to get some comments on the feasability of such a thing. If it works, I end up saving LOTS AND LOTS of pins on the Arduino.

Also, I can't recall seeing a method like this used for any robot I've seen. Is it because there's a more convenient way of expanding? Maybe is there something obvious I missed?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

You could also use regular ol' serial communication to talk to that picaxe as well. Much faster than reading a pulse-in all day, and you could send as much data as you wanted.

I know there's a library to turn two random pins on the Arduino into Tx Rx, but isn't that sort of intensive considering I already have a Serial set up? Also I save one more pin if I go the Picaxe way :) . Anyways, if serial is faster and less ressource-intensive, I'll be glad to do it that way. 

You are talking about the soft serial library and yes, it will add extra serial connections, but there is no reason you could not just use the regular serial pins. There are a ton of advantages serial gives you. More data, faster, is a start. But there are also ways to be sure your data is not corrupted, you can receive data in the background and buffer it for later,  you can even talk both directions. A ton of other stuff (LCD's and the like) also use serial comms --it is wicked good stuff to know.

Thanks a lot guys! I think I really like the 1$ MCP23017 and the Ti launchpad. Will definetely check them out!