24 Replies Latest reply on May 15, 2019 7:52 AM by shabaz

    USB to RS232

    s1buell

      Does anyone here have any experience with this topic?

       

      I`m going from a TUSB2077APTRTUSB2077APTR controller to two FT232RL-REELFT232RL-REEL IC`s just to test this prototype idea.

        • Re: USB to RS232
          shabaz

          Hi,

           

          I'm not sure those two together will meet your requirement.

          You've posted in the Arduino space, are you looking to attach the Arduino serial pins to a PC via USB?

          If so, then the functionality you need is just a USB-to-UART chip.

           

          If you're looking to attach the Arduino serial pins to a RS232 device, then USB is not required, just a 'RS232 transceiver' chip.

           

          If it is completely unrelated to Arduino and you're looking to create some adapter to connect a PC to a RS232 device then the functionality you need is a USB to UART chip, and a RS232 transceiver chip.

          If you want two RS232 interfaces, a dual UART USB chip can be used (no need for a USB hub chip). and the RS232 transceiver chip(s).

          1 of 1 people found this helpful
            • Re: USB to RS232
              balearicdynamics

              I have the same doubt of you Shabaz. Then it is not a USB chip but a USB HUB chip, that makes the difference. As far as I know, from the hub you connect USB devices. To at least one piece is missing in the design idea.

               

              Enrico

              • Re: USB to RS232
                s1buell

                Ok....

                 

                 

                 

                The idea is to connect 7 RS232 connections. Then access them via Arduino (or similar type proto board) in the end.

                 

                I`m just starting with two channels for  testing. USB ---> TUSB2077APTRTUSB2077APTR-> FT232RL-REELFT232RL-REEL ---> ADM213EARUZADM213EARUZ 

                 

                In the end I would like to have Arduino --> TUSB2077APTRTUSB2077APTR->  FT232RL-REELFT232RL-REEL ---> ADM213EARUZADM213EARUZ

                 

                Now one thing to keep in mind each channel requires a separate ground so I will only have one channel per set ( FT232RL-REELFT232RL-REEL and ADM213EARUZADM213EARUZ)

                 

                Does this help?

                2 of 2 people found this helpful
                  • Re: USB to RS232
                    shabaz

                    Hi Tom,

                     

                    If it's possible to sketch what you wish to do (and specify the end equipment and purpose too) it will make it easier to follow, rather than specifying parts, because then I need to go looking at what each part does.

                    The Arduino isn't a USB host, so it cannot attach to a hub to connect out to USB devices.  The Arduino plays a USB device role, not a host role (and technically not even that - the embedded programmer/debugger on the Arduino is the thing that is playing the USB device role).

                    Unless you're using some unusual Arduino that I'm not aware of (I'm assuming Arduino Uno, but there are hundreds of Arduino variants/copies out there, so I'm not sure).

                    2 of 2 people found this helpful
                    • Re: USB to RS232
                      s1buell

                      Guy`s let me get back to you on this.

                       

                       

                      The first test we did was Arduino to USB proto board then into a 8 channel RS232 hub and everything worked great. We could read all the RS232 data from all channels.

                       

                      Now for me the request is to make a shield to connect direct to the Arduino proto board. Let me check.

                       

                      Thanks for the responces

                       

                      T

                      1 of 1 people found this helpful
                        • Re: USB to RS232
                          mp2100

                          If I understand, you've used a hub something like this (easysync) device, except you want 8 ports ?  I've use this previously, with good results.

                          It's been a while since I opened this up, I can look into my parts bin and tell you what chip is inside that does the 'magic' converting 1 USB into multiple RS232.  I think it was an FTDI chip, which is  common.  https://www.ftdichip.com/

                          2 of 2 people found this helpful
                        • Re: USB to RS232
                          beacon_dave

                          "The idea is to connect 7 RS232 connections. Then access them via Arduino (or similar type proto board) in the end."

                           

                          Perhaps take a look at the ATxmega A1U or A3U family of AVR 8-bit microcontroller which appear to have 8 / 7 USARTs to play with.

                          http://ww1.microchip.com/downloads/en/DeviceDoc/30010135D.pdf

                          Add some MAX232's and away you go.

                           

                          Unfortunately the XMEGA A1U Xplained Pro evaluation kit only appears to break 5 of them out to headers but it may still be useful for proof of concept.

                          ATXMEGAA1U-XPRO - Evaluation BoardATXMEGAA1U-XPRO - Evaluation Board

                          2 of 2 people found this helpful
                      • Re: USB to RS232
                        michaelkellett

                        It looks as if you want an Arduino with 8 RS232 ports.

                         

                        The neatest way to do this is to use an FPGA - something fairly small will do. You can connect the FPGA to the Arduino via UART or SPI at logic level (care needed if it's a 5V Arduino).

                         

                        If you need true RS232 ports at correct levels then you'll need level shifters like the TI device you mentioned.

                         

                        The FPGA work will be challenging if you've never done any before, but you would be able to get true simultaneous operation of all 8 ports with buffering and good control of latency.

                         

                        If you are more used to processors consider using a fast ARM based part which will be able to do 8 UARTs in software at 9600 baud quite easily.

                         

                        As is so often the case, it would be much easier to make good suggestions if you would describe what you actually want to achieve in a bit more detail.

                         

                        For example, you might be able to use an ST Nucleo board (NUCLEO-F429ZI would be suitable)

                        with a nice fast processor to do everything you need, including simulate 8 UARTS.

                         

                        MK

                        5 of 5 people found this helpful
                        • Re: USB to RS232
                          s1buell

                          Ok, Had a talk with the guy`s and here`s what they would like to see in the end.

                           

                           

                          • We will also need to produce a prototype PCB in the end. So I like to keep it simple the first go round.
                          • True simultaneous operation of all ports with buffering and good control of latency.

                           

                           

                          Michael Kellett I like the idea of the FPGA I will look into this. I`m a little worried about the programming I`m not sure we have the skills/knowable at this point to pull this off. Are they easy to program? I have one guy here that is/has some knowledge of them

                          • If you are more used to processors consider using a fast ARM based part which will be able to do 8 UARTs in software at 9600 baud quite easily.(This was our original idea).

                           

                           

                          Allen Russell 

                          Yes we used this version for the first testing and everything worked quite nice.

                          2 of 2 people found this helpful
                            • Re: USB to RS232
                              michaelkellett

                              Hello Tom,

                               

                              I quite like FPGAs - but then that's what I do quite a bit.

                               

                              If this is a commercial project I could help you with FPGA design for money !

                               

                              If not, then I'll be able to help a bit on E14 with some advice but in the end you'll need to do the actual work. As FPGA applications go this is not a bad one to start with - nothing too fast or horribly complex.

                               

                              If you will make a lot of these the cost of the FPGA will be important, if only up to a few hundred then I would look at Lattice XP2 parts or Altera MAX 10, if lots and lots then look at Lattice ice40 parts.

                               

                              Do you just need RX and TX on the RS232 or do you need some or all of the handshake pins as well ?

                               

                              MK

                              3 of 3 people found this helpful
                                • Re: USB to RS232
                                  s1buell

                                  Well you have thrown a wrench into my plans.....

                                  But after looking at things a FPGA would be a nice solution that we could use in other applications (RS485 for example)

                                  Im looking at the Lattice XP2.

                                   

                                  In the end the circuit will look a little like this.

                                   

                                   

                                   

                                  Sure simplifies what I had already started using the conventional method. This will reduce the cost and IC count for sure.

                                   

                                   

                                   

                                   

                                  I`m going to buy the proto board to get things moving. In the background I`ll create the PCB and maybe intigrate the CPU.

                                   

                                    • Re: USB to RS232
                                      abrain

                                      Looks like you're making some progress Tom - am I right in thinking you wanted separate grounds though for the serial ports?

                                       

                                      If you want isolated ports, I've used onto-isolators in the past for the Tx and Rx signals, and a dc-dc convertor to isolate the power supplies for each channels MAX232 chip. You need to be wary of the speed of signals through the opto-isolators (limited myself to 2400baud once.... don't want anyone to repeat that mistake! ).

                                       

                                      TI have done a reference design using a capacitive isolator, and powered that from the RS232 line itself, which might be an interesting read and something to consider - http://www.ti.com/lit/ug/tidu298/tidu298.pdf

                                       

                                      A

                                      • Re: USB to RS232
                                        michaelkellett

                                        I think I have one of those dev boards - although with Lattice I usually go straight to a custom pcb because I know the parts quite well.

                                        You'll need a clock and a debugging port (can be used to program it on board as well)  for the FPGA in the final design.

                                         

                                        MK

                                  • Re: USB to RS232
                                    s1buell

                                    abrain

                                    Yes I need separate grounds for sure.

                                    • Did you mean opto-isolators?
                                    • I will look at that link for sure

                                     

                                    michaelkellett

                                    • My thoughts exactly!!  I have started the board layout already
                                    • If you guys like I will post each part of the project as I move forward

                                     

                                     

                                     

                                    Thanks for the feed back......

                                     

                                    Tom

                                    • Re: USB to RS232
                                      s1buell

                                      Well I started to setup the model for the RS232

                                       

                                       

                                       

                                      Then after a morning meeting the project was cancelled.....

                                       

                                      I`m a little sad. I was looking forward to building an FPGA...... Maybe next time.

                                       

                                      • Project Closed

                                       

                                      Thanks all for the great feedback. I’m always building something. I`ll post the next project.

                                       

                                      I like the feed back.

                                       

                                      Tom

                                      • Re: USB to RS232
                                        s1buell

                                        You guys (anyone) interested in building an industrial CPU? I already have the proto board produced but I still have lots to do and extra eyes are always welcome.

                                         

                                        I would love some more experience on this one. 

                                         

                                        I really need someone to make me some firmware…. Lol

                                        • Re: USB to RS232
                                          s1buell
                                          • I wanted to start off with some simplicity and then evolve into a full industrial board.
                                          • I used the ATSAMD21G18 this processor is great (in my view) for IIOT applications
                                          • I love the sercom`s and the two internal DAC`s
                                          • I also made it Circuit Python capable (I think)

                                          The other idea I have is to componentize the architecture making easy to change processors or sensor communications  etc. That is why you see the power supplies very separate from the CPU

                                           

                                          After proving the concept, I will make it much more appealing to the eye. I like space and lots of test points when proving concepts 

                                           

                                           

                                          I did evolve it into a concept board already.... To much Coffee! (not produced). Need to prove the basics first.

                                           

                                          That get your interest?

                                           

                                          Anyone work with this CPU before? I`m having a bitch of a time with the boot loader and firmware?

                                           

                                          T

                                            • Re: USB to RS232
                                              michaelkellett

                                              Hello Tom,

                                               

                                              I haven't used Atmel ARMs for a very long time - I did one project which was successful with a pretty early part (pre- Cortex) but I wasn't thrilled with the support at the time.

                                               

                                              I moved over to ST ARM based micros more than 10 years ago and I haven't seen any reason to change.

                                               

                                              On a board like this the cost of the processor is trivial - why not use something like an STM32F407 or even an STMH7xx part (400MHz, lots of RAM, 16bit ADC etc etc.)

                                               

                                              It looks as if your IO goes direct to the processor - OK for playing but no good for real life in industrial settings.

                                               

                                              I have a vague plan for a board for my own use - I'm a bit busy right now but I'll try to set down a few notes and we can see if there is any common ground.

                                               

                                              MK

                                              • Re: USB to RS232
                                                shabaz

                                                Hi Tom,

                                                 

                                                Is it for production, or for others to self-assemble? The QFN package may be hard for others.

                                                It definitely needs some isolation, which could be done using (say) opto-isolators or relays. The board I'm working on is constrained in size, so it's only got two inputs and two outputs (using opto and relays in this case), but it's got an option to attach another board. It's described here at high-level, but full details and BoM will be published at some stage. It uses a Pi i.e. Cortex-A, and has the advantages and disadvantages of that, there's a market for Cortex-M controllers as you've noticed too.

                                                1 of 1 people found this helpful
                                              • Re: USB to RS232
                                                s1buell

                                                Michael Kellett

                                                 

                                                The first CPU project is just a project to test the CPU, create firmware etc. Its my first go at a cpu so I started with the basics (Just to play)

                                                The mian issue we are having now is the firmware. I`ve ordered a Atmel-ICE to start this part.

                                                 

                                                I actually picked this processor mainly to work with circiut python and onboard memory storage. No more compiling. But the target was to make the CPU easy to program and for operations people to have access to the last code used (hence circuit python)

                                                https://en.wikipedia.org/wiki/CircuitPython

                                                https://github.com/adafruit/circuitpython

                                                 

                                                 

                                                And the application of this unit will be more for IIOT sensor reading with long range data transmission.

                                                The STM32F407/417 looks is really nice! The price is also good $11.06000 Digikey. I will put this on my radar.

                                                • I have a ton of questions but need to do some reading on the cpu first.

                                                 

                                                shabaz

                                                In the end it will be for production (If no one cancels the project.....again lol)

                                                 

                                                Size is important but not a constraint for us (smaller the better). Im going to use 20pin connectors to allow for any type of expantion board to be added

                                                 

                                                Here a picture of the concept:

                                                These have a two channel DAC to allow for 4-20ma boards to be added (concept picture only). Well its an actual PCB but untested.

                                                 

                                                 

                                                Shabaz

                                                 

                                                BTW love the project!!!!!   (https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fmedium.com%2F%40shabaz_yousaf%2Fviki-an-open-so… )

                                                 

                                                I would be interested in producing and playing with this project....

                                                 

                                                We use a PI addon boad to connect to the PI`s only for reading sensors and a little control if needed (basic stuff)

                                                 

                                                T

                                                  • Re: USB to RS232
                                                    shabaz

                                                    Hi Tom,

                                                     

                                                    That makes sense, the dual-module approach looks neat.

                                                    Also, it's great to hear you find the VIKI project interesting. it should just be a matter of weeks and then we'll hopefully have the documentation, BoM, etc published.