UART to SPI/I2C

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

UART to SPI/I2C

Postby shahrul » Sat May 05, 2012 9:22 pm

Hi,
PIC16 only have 1 UART. If we need to use more than 1 UART, the way
1) Change higher PIC.
2) Do software UART.
3) Use multiplexer/demultiplexer ex 74HC4052.

If I don't want use higher PIC, there is very difficult to do software UART with high accuracy and use multiplexer/demultiplexer still have problem that it's can't operate at the same time.

So, I want to know if there is exist converter IC from UART to SPI or I2C? It's like I/O Expender ex MCP23017 that can increase input/output through SPI/I2C.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: UART to SPI/I2C

Postby ABSF » Mon May 07, 2012 9:40 am

shahrul WROTE:PIC16 only have 1 UART. If we need to use more than 1 UART, the way
1) Change higher PIC.
2) Do software UART.
3) Use multiplexer/demultiplexer ex 74HC4052.


There are PIC16 with 2 UART but all in SMT 64 pin package.
eg 16F1526, 1527,1546,1547.

Since you dont like plan 1 and plan 3 is hard to implement. Looks like your only choice is plan 2.
The i2c IO expander has been there for a long time. MAXIM, TI and Philips all have their one version of this chip.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: UART to SPI/I2C

Postby shahrul » Mon May 07, 2012 9:50 am

Thanks Allen.
Seems, no product yet for this type of converter.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: UART to SPI/I2C

Postby takao21203 » Mon May 07, 2012 2:28 pm

you can use smaller PICs with hardware USART, and software synchronous serial transfer to the master PIC.
Quite a hassle to program even for only 2 PICs.

If you only need RX, you can also use TX to send to the master PIC.

Some PICs support addressable USART.
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: UART to SPI/I2C

Postby shahrul » Mon May 07, 2012 3:08 pm

takao21203 WROTE:Some PICs support addressable USART.

How operation addressable USART? First time I heard this. Or it's just software id master send to selected slave..
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: UART to SPI/I2C

Postby takao21203 » Mon May 07, 2012 10:28 pm

It's kind of a multi-slave mode. I have not used it myself, only saw it in the manual.
Only some PICs support it.

You include the address, and only the selected slave responds.

See screenshot from the PDF.

16f884.jpg
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: UART to SPI/I2C

Postby sich » Wed May 09, 2012 3:12 am

This addressable usart is actually using a bit (9-bit) to determine that the received byte is the address byte or data byte. Both master and slave(s) need to be set to the same mode and the address matching is done in user software.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 604
Joined: Tue Apr 21, 2009 2:15 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 1 guest