Author Topic: Additional Digital I/O  (Read 1175 times)

crites

  • Newbie
  • *
  • Posts: 2
Additional Digital I/O
« on: November 28, 2009, 08:12:19 AM »
In looking around the site it appears the best way to increase the digital I/O of the ioBridge to more than 4 channels is through a Serial Smart Board and some additional hardware.  Does anyone have any experience increasing the I/O (digital or analog) in this fashion?   

nick

  • Full Member
  • ***
  • Posts: 174
Re: Additional Digital I/O
« Reply #1 on: November 29, 2009, 07:31:45 PM »
I've been using the Teensy arduino implementation. http://www.pjrc.com/teensy/

For less than $20 you get a complete arduino development environment.  The chip itself has 25 digital i/o pins, 12 analog inputs and 7 analog outputs.

For six bucks more you can get the Teensy++ with 46 i/o pins.

The Teensy has  built in  RS-232 serial communications, and hooks directly to the ioBridge.  For bidirectional communications you need the serial smart board, but if you are just sending to the iobridge you can use one of the digital outputs as a serial output.

The way I use it is to use the serial web services api.  This allows me to construct a URL on the teensy, which gets passed to the ioBridge servers to call a page on my web site.  The output of the web page is passed to my teensy, which parses it.  For this I had to write two programs: an Arduino sketch that runs on the teensy, and a php page that runs on my web server.  Neither of these programs is very complicated, they're about one page each.

If all you were interested in was logging data you could use the serial logging function of the web services API.

irkgreen

  • Newbie
  • *
  • Posts: 48
Re: Additional Digital I/O
« Reply #2 on: December 22, 2009, 01:15:35 PM »
I am doing something very similar with an ATmega168 chip. 

You could really use a development kit with a debugger and an oscilloscope to help work through it.  Scope123 is a pretty solid computer-based scop that uses your sound card's input as a scope.  I used it to capture the ioBridge's digital out signal after sending the letter "A" out one of the channels. 

I'm having some timing issues.  Does the teensy's dev kit have an onboard crystal?

nick

  • Full Member
  • ***
  • Posts: 174
Re: Additional Digital I/O
« Reply #3 on: December 23, 2009, 12:44:22 AM »
I'm curious what you mean by "timing issues." I didn't have to do any synchronization, the Teensy has a built-in UART and I just connected it to the serial smart board and let it rip.  An oscilloscope was handy in figuring out what "inverted" and "true" meant on the ssb configuration.  I haven't tried using the digital output.

irkgreen

  • Newbie
  • *
  • Posts: 48
Re: Additional Digital I/O
« Reply #4 on: December 23, 2009, 01:54:03 AM »
i need to set the actual Mhz value of my clock speed.  I've tried the internal clock on the atmega but it isn't very reliable.  the dev kit i have has an external clock socket (which i haven't used) and a configurable clock.  I'm trying to use the configurable clock.

nick

  • Full Member
  • ***
  • Posts: 174
Re: Additional Digital I/O
« Reply #5 on: December 24, 2009, 10:23:42 AM »
The teensy has a 16mhz crystal on board.  A schematic is here: http://www.pjrc.com/teensy/schematic.html