Author Topic: Serial board using bitbang  (Read 1928 times)

jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • ioBridge.com
Re: Serial board using bitbang
« Reply #15 on: November 17, 2009, 08:28:08 PM »
irkgreen,

I guess I was a little confused as to what exactly you had hooked up.  The true/inverted setting is actually sent to the serial smart board itself.  So it needs to be connected to the IO-204 to change that.

If all you need is serial output, have you considered using the "serial output over digital output pin" option?  It gets over looked often since the serial board provides the same function and it was released first.

You may be wondering why a "serial smart board" even exists.  It's necessary when serial input is involved.  The IO-204 is doing a lot of things all at the same time.  Listening for data on a serial port would require all of the processor's attention and keep it from managing the Ethernet stuff.  The serial board basically acts as buffer for serial data.  When the serial board receives data, it holds it in an internal buffer. The IO-204 checks with the serial board periodically to see if there is any data in the buffer to be passed on to the server.

We don't publish the specs on the "smart channel" protocol because it's not very useful by itself.  Every "smart" device requires heaps of back-end code on our server to be configured and run properly.  When you set a I/O channel for a servo board, for example, it lets our server know to load up all those libraries for your module and widgets.        
« Last Edit: November 18, 2009, 03:13:12 PM by jason »
Jason Winters
ioBridge Developer

ohararp

  • Newbie
  • *
  • Posts: 34
    • OHARARP LLC
Re: Serial board using bitbang
« Reply #16 on: November 17, 2009, 09:12:58 PM »
As it stands now the triac board interfaces to the iobridge via the DO line only.  Nothing to say that a small uProcessor couldn't sit on a board and light up more of them if needed.  A previous post mentioned using an arduino to do this, but a $20-$30 processor is not required for this.  A ~$1 pic processor could easily listen to a serial line and activate 8 plus digital io lines.

Pulling the line high turns the light on and pulling it low turns it off.
--------------------
Ryan O'Hara
$25 SMT Stencils - www.ohararp.com/Stencils.html

irkgreen

  • Newbie
  • *
  • Posts: 48
Re: Serial board using bitbang
« Reply #17 on: November 18, 2009, 01:13:53 PM »
cool.  I am trying something similar with an atmega8 chip.  I've gotten it to work fine in i/o mode.  In a test case if the DO goes high then my code executes which causes a pin to go high for 5 sec and then low for 5 sec repeating.  Pretty cool, but now i want to interpret the serial pulse coming out of the DO on the iobridge.  I'm told that there is a way to use this via a widget as I am not using the serial board.  My goal is to send a serial message (lets say "A") and have my atmega8 pull high the corresponding pins that represent "A" as 8-bit.  I'm close but i am having some setting issues.

I'm using a loop that watches for the IO bridge DO to go high (start bit in true mode) and then it will read the status (high or low) of that pin 8 times in increments of 833 microseconds (1200 baud rate).  Then it will wait 833 us for the stop bit and then turn on the corresponding pins to the 8 bit message then exit.

Does this seem like the right approach?

nick

  • Full Member
  • ***
  • Posts: 174
Re: Serial board using bitbang
« Reply #18 on: November 18, 2009, 01:40:26 PM »
The atmega8 has a built-in UART.  I would use that. Getting the timing right for serial comms is tricky, using the UART is much easier.

ohararp

  • Newbie
  • *
  • Posts: 34
    • OHARARP LLC
Re: Serial board using bitbang
« Reply #19 on: November 18, 2009, 01:47:43 PM »
Using picbasic there is a serial command that will allow you to listen for a start byte and will timeout if it does not receive this. I am sure there is something similar for your compiler. I would consider adding both a start byte and end byte to your serial message from the iobridge.
--------------------
Ryan O'Hara
$25 SMT Stencils - www.ohararp.com/Stencils.html

irkgreen

  • Newbie
  • *
  • Posts: 48
Re: Serial board using bitbang
« Reply #20 on: November 18, 2009, 01:50:52 PM »
ah.  I think you are both referring to the same thing.  I will look into it.

So do you think the same could be accomplished in the reverse?  That is, via code based on the status of pins on the atmega - create a serial message and send it to the DI of the ioBridge.  It seems that if you are not using the serial board the DO is the only active pin.

nick

  • Full Member
  • ***
  • Posts: 174
Re: Serial board using bitbang
« Reply #21 on: November 18, 2009, 02:10:11 PM »
ah.  I think you are both referring to the same thing.  I will look into it.

So do you think the same could be accomplished in the reverse?  That is, via code based on the status of pins on the atmega - create a serial message and send it to the DI of the ioBridge.  It seems that if you are not using the serial board the DO is the only active pin.

I think Jason answered that a few posts ago:
Quote
You may be wondering why a "serial smart board" even exists.  It's necessary when serial input is involved.  The IO-204 is doing a lot of things all at the same time.  Listening for data on a serial port would require all of the processor's attention and keep it from managing the Ethernet stuff.  The serial board basically acts as buffer for serial data.  When the serial board receives data, it holds it in an internal buffer. The IO-204 checks with the serial board periodically to see if there is any data in the buffer to be passed on to the server.


We don't publish the specs on the "smart channel" protocol because it's not very useful by itself.  Every "smart" device requires heaps of back-end code on our server to be configured run properly.  When you set a I/O channel for a servo board, for example, it lets our server know to load up all those libraries for your module and widgets.         
 
 
 

irkgreen

  • Newbie
  • *
  • Posts: 48
Re: Serial board using bitbang
« Reply #22 on: November 18, 2009, 02:25:13 PM »
whoops... i completely missed jason's post.  So i need to create a serial out widget.  I think I've been using the serial channel widget.

Makes sense.

ohararp

  • Newbie
  • *
  • Posts: 34
    • OHARARP LLC
Re: Serial board using bitbang
« Reply #23 on: November 27, 2009, 05:49:35 PM »
A request was made to post the schematic for the previously mentioned triac board.  Please see .pdf below for details.
--------------------
Ryan O'Hara
$25 SMT Stencils - www.ohararp.com/Stencils.html