0
\$\begingroup\$

I'm interested in using the SC16IS740 UART-SPI converter to interface with W5500 Ethernet controller which has SPI inputs. Because the datasheet is unclear to me, I'm asking if anybody knows how is SC16IS740 programmed? By UART or SPI interface, or both?

If it uses the SPI interface for programming, can someone recommend a low cost UART-SPI bridge (or converter)?

UPDATE

W5500 is part of a data acquisition system composed of: several sensors boards with MSP432, each having a communication module which will transmit Ethernet over cable or fiber optic, and a "gateway" which aggregates all data from sensors boards and will connect to a local area network. W5500 will be placed at the gateway since

System diagram

Some modules can transmit over Ethernet cable and other over fiber optic cables. The communication module is the Ethernet interface of the main board.

In case of transmitting over fiber, it has to convert electrical signals from W5500 to optical. Practically, I cannot place W5500 on the communication modules because it outputs 2 differential signals, thus requiring 4 fiber optic cables. So, a solution would be to transmit using UART (from main board to communication module and to gateway via fibers), thus using 2 fibers, and convert it to SPI (using SC16IS740) at the fiber-to-Ethernet converter, where W5500 would be placed. In this case, the master of SC16IS740 would be W5500, but is not acceptable.

Other solutions: transmit SPI data over fiber (unacceptable because it requires 3 fibers), use another controller to make UART-to-SPI translation.

Ideal case: placing on the communication module an Ethernet controller with outputs for fiber optic cables (I do not know any such controllers) and have and appropriate converter at the gateway.

\$\endgroup\$
8
  • \$\begingroup\$ I could answer part of your question, but not all, so I can't write a full answer. That is because your terminology seems confusing. The SC16IS740 would not normally be called a UART-SPI converter, but the exact opposite i.e. it's an SPI (host interface) to UART (outside device). That is not what you want, since your "outside device" is SPI. Therefore IMHO you also don't want to be asking for an "SPI-UART" bridge, but instead for a [something]-to-SPI bridge, to "talk" SPI to your W5500. Is that correct? It would also help to know what is your host device, and why can't it use SPI directly? \$\endgroup\$
    – SamGibson
    Feb 27, 2017 at 17:42
  • \$\begingroup\$ @SamGibson Please see updated question. \$\endgroup\$
    – Cristian M
    Feb 27, 2017 at 20:35
  • \$\begingroup\$ Thanks for the update. Unfortunately there are too many ambiguities for me to understand the system (a diagram would probably help). Also, the update didn't seem to address my question about why whatever MCU is "the gateway" can't connect directly with the W5500 using SPI, and therefore avoid the need for the UART<->SPI conversion you asked about. So the update confirms that I don't understand enough of the overall problem for it to be sensible for me to try to answer. Hopefully someone else understands your system better than I do! \$\endgroup\$
    – SamGibson
    Feb 27, 2017 at 20:59
  • \$\begingroup\$ @SamGibson Because the gateway will act basically like a retransmission unit, converting fiber optic Ethernet to cable Ethernet used by the LAN. Its outputs will connect to a switch. I wanted to avoid placing a controller here, where only a physical medium conversion is required. Thus, the ideal scenario would be: W5500 placed on the communication module and using 2 fibers to connect to retransmission unit, but it is not possible since it outputs 2 differential signals. So to use 2 fibers a solution would be to tx UART and convert to SPI at retrans. unit where W5500 will be placed. \$\endgroup\$
    – Cristian M
    Feb 27, 2017 at 21:08
  • 1
    \$\begingroup\$ @CristianM I'm also having trouble understand how you are trying to build this, please do the people here and yourself a favor and draw a diagram in which you specify the different links and connection types (ie Ethernet, SPI etc) and your sensors etc. Try to be as detailed as possible. \$\endgroup\$ Feb 27, 2017 at 21:32

1 Answer 1

1
\$\begingroup\$

Your problem is due to a misconception, you claim that:

Practically, I cannot place W5500 on the communication modules because it outputs 2 differential signals, thus requiring 4 fiber optic cables.

But this is not true, standard Ethernet (10BASE-T, 100BASE-TX etc) uses differential signaling over twisted pairs to lower interference, two pairs of the four available to be exact. One pair to transmit and one to receive. Differential signaling means that the wires in each pair carry the same data but inverted polarity. Wikipedia has an article on the subject.

But doing stuff in the physical ethernet layer is not trivial, may I suggest you buy a pair of Fiber Media Converters instead? That way you can design "nodes" with a standard ethernet connection and use optical fiber when necessay using only "off the shelf" stuff.

Also you might want to consider wireless which is much cheaper than optical unless the fiber is already in place.

Oh I almost forgot the original question! SC16IS740 is a UART with and SPI interface (slave). It is not (nor does such a component make much sense) an "SPI-to-UART converter". How one goes about "programming" it I have no idea but it obviously needs a master (your microcontroller) that is programmed to interface with it. Microcontrollers commonly have UARTs built in these days so I don't really see much point in using one anyway.

Best of luck!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.