6 Replies Latest reply on Mar 16, 2015 3:28 PM by duBe68

    Can this be done with Edison?

    duBe68

      Hello,

      I have no experience at all with Edison & very little experience with electronics / programming, so please accept my apologies up-front.

       

      I have a need to create a device that:

           a.  Has ONE (1) incoming RS232 port

           b.  Has FOUR (4) separate outgoing RS232 ports

           c.  "reads" an incoming RS232 stream,

           d.  look at the first 2 Bytes of info

           e.  check for the "address" (2nd byte)

            f.  if it is addressed "FF 01 .........", forward the complete original data out PORT 1 ONLY

           g.  if it is addressed "FF 02 ........." re-address the data to "FF 01 ........" and forward the complete data out PORT 2 ONLY

           h.  if it is addressed "FF 03 ........." re-address the data to "FF 01 ........" and forward the complete data out PORT 3 ONLY

            i.  if it is addressed "FF 04 ........." re-address the data to "FF 01 ........" and forward the complete data out PORT 4 ONLY

       

      Here is a drawing of this for those who are more "visual" like me.

       

      PelcoD---prototype.jpg

       

      Is this possible with the Edison?

      If so, would anyone be willing to "tutor" me in learning how to get this done?

       

      If not, would anyone be able to suggest a more suitable platform to achieve it?

       

      Many thanks in advance,

      duBe

        • 1. Re: Can this be done with Edison?
          Frederick Blais

          Short answer would be no. The Edison has only 2 hardware serial port. With the Linux overhead, it would be probably too slow to make software serial. Your application is really simple and the Edison is really overkill for this. This could be easily done with a microcontroller with 5 serial port (which is no so common IMO). It would be really easy to do with a Propeller chip from Parallax. Try to re-post your question on their forum : http://forums.parallax.com/ and I'm sure there will be 3-4 persons willing to help you. You could also do that on a small FPGA or CPLD.

           

          Fred

          • 2. Re: Can this be done with Edison?
            duBe68

            Many thanks Fred,

            I really don't know where to start with it, so I'm very appreciative of the pointer.

             

            Cheers,

            duBe

            • 3. Re: Can this be done with Edison?
              Bunsen

              If there isn't unexpected data coming back from those cameras, you can do it with any microcontroller with 2 UARTs and a 4:1 multiplexer or two (depending on whether the data is unidirectional or bidirectional, though the microcontroller wouldn't be able to simultaneously monitor all 4 camera ports).  Maybe even one UART and software emulation for the others, if the data rate is low enough.  Those will be cheaper than a Propeller, and might have a shallower learning curve than FPGAs. 

              • 4. Re: Can this be done with Edison?
                duBe68

                Thanks Bunsen,

                I'm gonna "fake it till I make it" with this, so if I make a fool of myself, feel free to poke fun at me.

                 

                So the purpose of the device I need is because the 4 cameras I have cannot be "addressed", they are hard-coded to be "ADD 01", I can't change that.

                However, the camera controller I have to operate the cameras uses ONE single RS232 D9 connector OUT, using multi-camera "addressing" to single-out the PTZ commands to the appropriate camera.

                 

                With normal cameras (which can be "addressed") this doesn't pose a problem; I just "parallel" connect to all the cameras RS232 to the OUT of the controller, each camera only responds to it's given "addressed" commands.

                 

                But with these "ADD 01" hard-coded cameras, this system fails, as they ALL respond to the same "ADD 01" PTZ commands, thus they all drive at the same time, which I don't want.

                 

                So, to overcome this, I thought such a device would take the single controller OUT RS232 command, interrogate it & based on what "address" it is, simply re-address it to "ADD 01" & output it to the appropriate "PORT".

                 

                I'm not sure if there is any bi-directional info coming back from the cameras, would that present a problem if there was & I simply ignored it?

                 

                As best I can tell (not being either an electronics or a programming dude), the data rate is 9600, 8, N, 1 (no flow control).

                 

                I've had a look around & I found a STM32F103ZE which lists 5 UARTS (google search "micro controller 5 uarts"), is this something I should look at??

                I guess this is no longer about Edison, so I guess I shouldn't be asking anymore such questions, but you guys seem to know some stuff, so it would be great to get one more final push in the right direction.

                 

                Cheers,

                duBe

                • 5. Re: Can this be done with Edison?
                  Bunsen

                  A bit of googling suggests that the PELCO D protocol is unidirectional, so you can do this with a simple, cheap microcontroller.  Pick your favorite chip with two UARTs (at 9600 baud, software emulation for the output isn't hard, so you could get away with only one hardware UART -- note that this makes Arduinos an option), and hang something like a 74HC139 (a dual 1:4 demultiplexer, but those seem more common than singles) or 74HC4052 (similar, but bidirectional and supports analog signals, a few cents more expensive but probably a handier thing to have in your box of parts) off of the output UART.  Have the micro receive the incoming command, inspect the address, set the multiplexer's address lines, and repeat the readdressed command on the output UART.  You shouldn't even need to connect the RX lines, if I've read correctly.  Parts cost for just the chips can be under $2, or under $10 for a newbie-friendly version (knockoff Arduino Pro Mini, FTDI breakout, and 74HC4052 in DIP for breadboarding).

                  1 of 1 people found this helpful
                  • 6. Re: Can this be done with Edison?
                    duBe68

                    Hi again Bunsen,

                    thanks a HEAP for the advice, I'm kind of following what you're saying & I'm excited!

                     

                    I'm not going to lie; I don't know how to get it done, but at least with the info both you & Speccy88 have given me, a least I'm further up the road than I was yesterday.

                     

                    THANKS HEAPS

                     

                    duBe