Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SPI to UART converter

Status
Not open for further replies.

elfrec

Newbie level 6
Joined
Sep 17, 2009
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
singapore
Activity points
1,416
spi to uart converter

A micro controller only has one UART port. Therefore, we decide to use microcontroller SPI port as another UART2.

We need a SPI to UART converter (such as MAXIM3100 or NXP - 161S752), however, this IC only supports SPI slave mode only. When we use it with this configuration:

a) Micro controller’s SPI (master) ------ “SPI (slave) to UART”-- PC’s UART
• The communication is allowed.

b) PC’s UART ----- “UART to SPI(slave)” -- Micro controller’s SPI (master)
• The communication is not allowed as slave is unable to initiate talk with master.

May I know any SPI to UART converter IC can support Master SPI? Or do you all have other solution, thank you!
 

spi uart

I think better way of doing this is using a Micro controller with SPI and UART peripherals.
you can use both Master and Slave modes
 

Sorry for making you confusing. Let me explain again: I have a micro controller which only has one UART port. But I need to have 2 UART for a certain project. Therefore, i need to create a UART port from the micro controller's SPI port.

We need a SPI to UART converter (such as MAXIM3100 or NXP - 161S752), however, this IC only supports SPI slave mode only. When we use it with this configuration:

a) Micro controller’s SPI (master) ------ “SPI (slave) to UART”-- PC’s UART
• The communication is allowed.

b) PC’s UART ----- “UART to SPI(slave)” -- Micro controller’s SPI (master)
• The communication is not allowed as slave is unable to initiate talk with master.

May I know any SPI to UART converter IC can support Master SPI? Or do you all have other solution, thank you!
 

You can try using SP207EH by SIPEX. It is a multi channel transceiver so you can interface it to your micro controller having 5 outputs.


Also you can try one of the following:

1. SP3222E/3232E (SIPEX)
2. MAX3110E (MAXIM)
3. MAX3140 (MAXIM)

Data sheet are attached below.
 

• The communication is allowed.
...
• The communication is not allowed as slave is unable to initiate talk with master.
This consideration is basically missing the point, I think. In RS232 communication, there's nothink like init a talk. It's simply a bidirectional transmission of characters. But the UART parameters must be initialized, and slave mode is the "natural" way to receive this initialisation. To avoid permanent polling of the MAX3100 status by the uP, the device provides an interrupt output.
 

elfrec said:
May I know any SPI to UART converter IC can support Master SPI? Or do you all have other solution, thank you!

Why don't you use bit-bang routines for the second uart? Or get a microcontroller with two uarts.
 

Could you please let us know which microcontroller are you using? Don´t you think it may help us finding a solution?
 

FvM said:
• The communication is allowed.
...
• The communication is not allowed as slave is unable to initiate talk with master.
This consideration is basically missing the point, I think. In RS232 communication, there's nothink like init a talk. It's simply a bidirectional transmission of characters. But the UART parameters must be initialized, and slave mode is the "natural" way to receive this initialisation. To avoid permanent polling of the MAX3100 status by the uP, the device provides an interrupt output.


Ya, In RS232 protocol both party are allow to initiate communication. But if the situation is like this:

UART ----(a)------> UART to SPI converter (Slave) --(b)---> Microcontroller's SPI master
(a) "communication OK" (b) "I doubt the communication here!"


Hope you could get what I mean, thank you.

Added after 3 minutes:

howie said:
You can try using SP207EH by SIPEX. It is a multi channel transceiver so you can interface it to your micro controller having 5 outputs.


Also you can try one of the following:

1. SP3222E/3232E (SIPEX)
2. MAX3110E (MAXIM)
3. MAX3140 (MAXIM)

Data sheet are attached below.


Thank for your guide!
However I still doubt whether MAX 3110E support SPI in master mode.

Added after 6 minutes:

ctownsend said:
elfrec said:
May I know any SPI to UART converter IC can support Master SPI? Or do you all have other solution, thank you!

Why don't you use bit-bang routines for the second uart? Or get a microcontroller with two uarts.


This is a project special request from a customer. We have used the microcontroller with one UART for quite long. Bit-Bang routines are one of the intelligent way but our software engineer prefers hardware engineer to explore first :)

Added after 1 minutes:

pauloynski said:
Could you please let us know which microcontroller are you using? Don´t you think it may help us finding a solution?


I am using TI's Locosto Platform.

Added after 18 minutes:

I just obtain this reply from other forums.

"I think, that is interrut with the SPI to UART converter when PC\'s UART send data to it.You can detect the interrupt bit and use SPI to read the SPI to UART converter.Therefore,you can connect the SPI to UART converter\'s interrupt Pin with the Micro controller\'s external interrupt Pin.You can detect the SPI to UART converter\'s interrupt in real time through the external interrupt."



Another question arise... How to software initiate this interrupt signal? Is the signal generated from the RTS or CTS signal? Thank you.
 

Hello,

i`m working with the same architecture than you...and i found your same problem:

when i wanna transfer a file to micro from a device it can`t work: device speak upon UART protocol and then there is a bridge spi/uart (MAX3100) and the port on micro is spi port!

viceversa is working correctly instead!!

if you have understood something new about this kind of communication can you tell me please????
 

_cris said:
Hello,

i`m working with the same architecture than you...and i found your same problem:

when i wanna transfer a file to micro from a device it can`t work: device speak upon UART protocol and then there is a bridge spi/uart (MAX3100) and the port on micro is spi port!

viceversa is working correctly instead!!

if you have understood something new about this kind of communication can you tell me please????


THIS IS THE REPLY FROM MAXIM TECHINCAL SUPPORT TEAM:

Mail 1:

I wanted to make sure my research was relatively thorough before
| responding so I apologize for the slight delay.
|
| We only have 4 UART products currently. As you already pointed
| out the MAX3100 SPI interface is slave only. The MAX3140 uses
| essentially the same SPI to UART interface but has built in
| RS422/485 transceivers. The MAX3110E/11E similarly do the same
| but have built in RS232 transceivers.
|
| Unfortunately none of these products was designed with the type
| of application you described in mind. I will submit the idea for
| a new product intended to allow an SPI port to be converted to a
| fully functioning UART port. This idea may or may not ever bear
| fruit and that would come down to what kind of market interest
| there is.
|
| In the short term - unfortunately - this means I cannot offer you
| a maxim solution to your design goal. However, if you don't mind,
| if you could provide an estimated yearly volume you'd see for
| such an application it would be useful in evaluating whether or
| not such a product should be created in the future.
|
| If you have any additional questions about any maxim product
| please do not hesitate to ask.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MAIL 2

This response is phrased with regards to the MAX3100 - but may
| apply to the other products mentioned with slight modification.
|
| The /IRQ open drain output is indeed used as a signal to the
| micro-controller. The structure of the interrupt logic and
| function is explained on page 11 of the data sheet (it refers to
| other sections as well). It can respond to 5 different types of
| interrupts based upon 4 different mask bits (two function are
| tied together).
|
| One of the functions is a data available function which might be
| useful to you in your application. The MAX3100 would still be
| operating as a slave (since it cannot directly control the chip
| select or sclk - but you may be able to use this to signal the
| master (the micro-controller) that data is available. The slave
| devices behavior would then be determined by how your programmed
| the micro controller to react to the interrupt.
|
| If your using the /IRQ this was it may limit your ability to
| detect other sources of interrupt requests - but this comes down
| to how you code your software to treat the /IRQ signals and which
| mask bits you have set. The /RM bit needs to be set to use this
| type of interrupt, as it is the mask for this type of detection,
| and can be set with a configuration write command to the
| configuration register (16-bit command, detailed on pages 7-8
| initiated with 11 as the first two DIN bits sent).
|
| As far as programming your micro-controller to interact with our
| device, beyond the data sheet and the documents/code provided, we
| cannot supply any micro-controller software level support. The
| application notes and sample software is found here - though the
| sample is for a specific configuration:
|
| **broken link removed**
|
| The part conforms to the SPI/microwire standards for
| communication and you should consult the support for that
| standard if you need help with its implementation. The device
| implements all its commands in 16 bit transmissions and 4
| commands are supported (Write Config, Read Config, Write Data,
| Read Data). If you have any questions about what particular
| settings/registers do we can assist with these but we cannot
| design a new application or provide software support for your
| micro-controller. This is the sole responsibility of your design
| team.
|
| If you have any other questions about this or any other Maxim
| IC, please do not hesitate to ask. Just keep in mind high level
| design of an application or programming is outside the realm of
| the assistance we can offer.




Elfrec: Hopefully this can help~
 

sorry,
i didn`t understand about you: so how do you solve your problem???

have you changed IC??

thanks!!!!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top