Let's Make Robots!

Arduino --I need more serials

Ever sense I was gifted an arduino to learn with by a very kind LMR member, I have loved the thing. I like the language, power and available libraries. Right now, I am pulling the guts out of a VEX transmitter to convert it to Arduino and X-bee (Vex'duino). I am also replacing the little monochrome LCD with a proper one. BAM! Right in the face with a very basic problem... I need 2 serial outs and  perferably, 2 inputs as well. Obviously, without a mega, it seems I just don't have that option. This leads to 2 options in my mind... I can simply use 2 arduinos, one for the screen and one to read the pots on the joysticks, the input buttons and to send data off to the X-bee. These 2 arduinos can easily share data via i2c with each other.

Option number 2 is to do everything with a Picaxe. At 8Mhz, the picaxe should be plenty quick to be a "dedicated" transmitter but I (right or wrong) will still long for the 16Mhz of the Arduino, not to mention it's ability to work with negitive numbers and use the map and constrain commands. --All of which is a God-send when converting a X-Y joystick to "tank steering". Picaxe can do this conversion, but it is a major pain, it is "sloppy" and GREAT care must be taken to keep variables from overflowing. It really is a mess to do this with picaxe. I guess I could send raw data and let the propeller on the robot do all the conversions I need, but I just can't seem to bring myself to waste thinking power on the robot's brain when I have a perfectly good uC in the TX that has plenty of time to be doing it.

I welcome any thoughts on the subject.

Comment viewing options

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

Do you mean something like this Chris !!

Have a quick peek  ..... over Here

I am using this library and the coding is very straightforward.....

Newserialsoft.h will win the day for you Chris

PM me if you want the coding........

now, i've really got absolutely no experience with the arduino, but after a quick look at the specs for the lcd screen, i noted the ability to use dallas 1-wire, andf it appears that the arduino is capable of that, too. so would it not be possible to pass off the communications to the lcd over 1-wire instead of using the serial comms? as i said, i know very little about the arduino, so if those pins are already dedicated to something else, then disreguard my suggestion. just putting it foraward as an option...

IME, output rocks with NewSoftSerial, input not so much. It works, but caveats seem to abound. On my Fio, I had to download the Servo2 library and I am limited to PWM on only a couple of specific pins when using NSS. It's annoying how many things are serial when it is limited.

This 8-bit parallel to serial converter IC is worth checking out, but software serial is where its at in my opinion. 

split the serial using transistors. The transmission is easy to do this with, but if you are doing inputs, that can get tricky. This trick also requires a couple of extra pins to use for switching which transistor you want active but it would work. Just a thought. Also, you could use an interrupt for the inputs. SW serial might be easier though...

--Pat broke the rules and answered me in the shoutbox. I am downloading libraries as we speak --Will get to playing with them after dinner tonight.

If you don't need the second serial to have a high baud, you can use the (New)SoftwareSerial library. The New one has interrupts and I think it can use higher baud than 9600.

The second alternative would be to use a different chip, a ATmega644 has 2 hardware UART ports and 40 pins total, so it would be perhaps easier to work with. Look for the Sanguino, it is based on this chip.

Hehe, you beat me to it by 2 minutes!