Searching \ for '[PIC] Need external UART or a 16F PIC with 3 UARTs' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'Need external UART or a 16F PIC with 3 UARTs'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Need external UART or a 16F PIC with 3 UARTs'
2010\02\03@124203 by Dwayne Reid

flavicon
face
Good day to all.

I'm about to look at a project where I need to communicate with 3
serial devices.  All 3 ports will be communicating at 38,400
baud.  Although all three ports need to be able to receive data
simultaneously, transmission can be to one device at a time.

I see that some of the larger (16-bit) PICs have up to 4 UARTs on
board.  However, I haven't used those devices yet and don't have a C
compiler for them.

I recall discussion in the past where people have used external UARTs
with 16F PICs, connected via SPI or I2C.  Can someone remind me of
what those UARTs were?

The largest packet size appears to be less than 16 bytes.  It would
be cool if these external UARTs had at least a 16-byte receive buffer.

Thanks for any advice you can offer!

dwayne

--
Dwayne Reid   <spam_OUTdwaynerTakeThisOuTspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax
http://www.trinity-electronics.com
Custom Electronics Design and Manufacturing

2010\02\03@132343 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 15:42, Dwayne Reid escreveu:
> Good day to all.
>
> I'm about to look at a project where I need to communicate with 3
> serial devices.  All 3 ports will be communicating at 38,400
> baud.  Although all three ports need to be able to receive data
> simultaneously, transmission can be to one device at a time.
>  

Too bad, if it was the contrary, two simultaneous receive and three
transmit, you could use some PIC18F or the new enhanced PIC16F with two
UARTS, plus one interrupt-driven transmit-only UART. At this speed it
would be hard to do software UART receiving, but transmitting would be
possible (using a large percentage of CPU time though).

> I see that some of the larger (16-bit) PICs have up to 4 UARTs on
> board.  However, I haven't used those devices yet and don't have a C
> compiler for them.
>  

Some PIC32 have up to 6 UARTs.
For C compiler, use the Microchip's student editions, the only thing
they lack is some higher optimization levels.


> I recall discussion in the past where people have used external UARTs
> with 16F PICs, connected via SPI or I2C.  Can someone remind me of
> what those UARTs were?
>  

Check the final cost of the PIC plus external UART, perhaps some dsPIC,
PIC24 or PIC32 may get close in cost and are much more powerful.


> The largest packet size appears to be less than 16 bytes.  It would
> be cool if these external UARTs had at least a 16-byte receive buffer.
>
> Thanks for any advice you can offer!
>
> dwayne
>  


Best regards,

Isaac
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\03@135833 by Jan-Erik Soderholm

face picon face


Dwayne Reid wrote:
> Good day to all.
>
> I'm about to look at a project where I need to communicate with 3
> serial devices.  All 3 ports will be communicating at 38,400
> baud.  Although all three ports need to be able to receive data
> simultaneously, transmission can be to one device at a time.
>
> I see that some of the larger (16-bit) PICs have up to 4 UARTs on
> board.  However, I haven't used those devices yet and don't have a C
> compiler for them.
>
> I recall discussion in the past where people have used external UARTs
> with 16F PICs, connected via SPI or I2C.  Can someone remind me of
> what those UARTs were?
>
> The largest packet size appears to be less than 16 bytes.  It would
> be cool if these external UARTs had at least a 16-byte receive buffer.
>

Here is one with 128 byte send and rec buffers :
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/6463

> Thanks for any advice you can offer!
>
> dwayne
>

2010\02\03@140117 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 16:23, Isaac Marino Bavaresco escreveu:
> Em 3/2/2010 15:42, Dwayne Reid escreveu:
>  
>> Good day to all.
>>
>> I'm about to look at a project where I need to communicate with 3
>> serial devices.  All 3 ports will be communicating at 38,400
>> baud.  Although all three ports need to be able to receive data
>> simultaneously, transmission can be to one device at a time.
>>  
>>    
> Too bad, if it was the contrary, two simultaneous receive and three
> transmit, you could use some PIC18F or the new enhanced PIC16F with two
> UARTS, plus one interrupt-driven transmit-only UART. At this speed it
> would be hard to do software UART receiving, but transmitting would be
> possible (using a large percentage of CPU time though).
>  

Worse, the new enhanced PIC16F devices with two UARTs are future
products yet.

More than one UART only in PIC18F (2 UARTS max.), PIC24H (2 or 4 UARTs)
and PIC32 (2 or 6 USARTs).


Regards,

Isaac
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\03@142322 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 16:58, Jan-Erik Soderholm escreveu:
{Quote hidden}

At $4.00/unit @ 1k, it is more expensive than most PIC24 with 4 UARTs.
Adding the cost of the MCU, it becomes more expensive than a PIC32 with
6 UARTs.


Regards,

Isaac
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\03@143038 by William Bross

picon face
Dwayne Reid wrote:

{Quote hidden}

Dwayne,

Have you considered using two smaller PICs with UARTs connected to a
'master' PIC by SPI bus?  That solution would be cheaper than using a
proprietary part from another mfr.  And you already know how PIC UARTs
work.  You can make the buffers as large as you like (you have room for)
in each device plus use the extra port pins for signaling or I/O.  Worth
a look anyway.

Bill

2010\02\03@144302 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 17:01, Isaac Marino Bavaresco escreveu:
{Quote hidden}

I'm using the PIC32MX575F256H-80.

Oh! the joy of having 6 UARTs, 64k RAM, 256k of FLASH and 80 MIPS for
toying around.

All this for $6.25/unit @ 25 units at Digikey ($4.94/unit @1k according
to Microchip).

Don't forget that it is much easier to design a system when you don't
have to worry about lack of resources...


Regards,

Isaac


__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\03@144422 by Jan-Erik Soderholm

face picon face


Isaac Marino Bavaresco wrote:
{Quote hidden}

There was no mention about price limit, but a larger
send/receive buffer *was* mentioned.

Anyway, noone else then Dwayne knows the tradeoffs in
this project... :-)


2010\02\03@151920 by M.L.

flavicon
face
On Wed, Feb 3, 2010 at 3:43 PM, Isaac Marino Bavaresco
<.....isaacbavarescoKILLspamspam@spam@yahoo.com.br> wrote:

> Don't forget that it is much easier to design a system when you don't
> have to worry about lack of resources...
>
>
> Regards,
>
> Isaac

It's always good fun to look at spec sheets and decide what features
would be nice to have. Writing the code for systems with many
complicated features quickly becomes tedious.

--
Martin K.

2010\02\03@154615 by Bob Axtell

face picon face
Isaac Marino Bavaresco wrote:
{Quote hidden}

Dwayne,

Why don't you connect 4 PIC16Fs in an I2C arrangement? Each one would be
a UART port?
The PIC16F87 comes to mind...One as I2C master, 3 slaves...

--Bob

2010\02\03@192145 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 18:19, M.L. escreveu:
> On Wed, Feb 3, 2010 at 3:43 PM, Isaac Marino Bavaresco
> <isaacbavarescospamKILLspamyahoo.com.br> wrote:
>
>  
>> Don't forget that it is much easier to design a system when you don't
>> have to worry about lack of resources...
>>
>>
>> Regards,
>>
>> Isaac
>>    
> It's always good fun to look at spec sheets and decide what features
> would be nice to have. Writing the code for systems with many
> complicated features quickly becomes tedious.
>
>  


I just moved into PIC32, and found the migration path very straightforward.

The peripherals are almost the same of the lesser parts, with some
improvements. Somebody already familiar with PIC16 and PIC18 won´t have
trouble in figuring-out the configurations.
Better than all, the peripheral library is very complete and the
configuration values are provided by macros with very intuitive names.

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\03@193814 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 18:46, Bob Axtell escreveu:




{Quote hidden}

Some points against this idea:

1) You would need to write two different firmwares (if you use the same
parts for master and slave, take care not to mix them);
2) Program the three slaves with different addresses (or waste at least
two pins for address);
3) Deal with an extra protocol (I2C) and bus (don´t forget that some
PIC´s I2C modules don´t work well in slave mode);
4) I2C is slow, its bandwidth may be insufficient for three 38400bps
channels;
5) Use more board area than one single bigger chip;
6) May cost more than a PIC32.
And more...

Best regards,

Isaac
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\03@194435 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 18:19, M.L. escreveu:
> On Wed, Feb 3, 2010 at 3:43 PM, Isaac Marino Bavaresco
> <.....isaacbavarescoKILLspamspam.....yahoo.com.br> wrote:
>
>  
>> Don't forget that it is much easier to design a system when you don't
>> have to worry about lack of resources...
>>
>>
>> Regards,
>>
>> Isaac
>>    
> It's always good fun to look at spec sheets and decide what features
> would be nice to have. Writing the code for systems with many
> complicated features quickly becomes tedious.
>  

You don't need to use them all, just the ones that make sense.
Fortunately most PIC peripherals default to disabled and you don't need
to think about them if you won't use them.

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\03@195853 by Jesse Lackey

flavicon
face
Danger!  Made by Maxim!

Maxim has a justly deserved reputation for not supplying parts in a
timely manner.  A critical part in one of my designs suddenly has an
11-week leadtime.  I was forced to buy qty 60 from a place in China.
Are they real or fake?  I'll find out later this week.  The is the 2nd
time I've had a bad situation involving Maxim and their parts being made
of 100% unobtanium.

It is sad because they certainly do make some good stuff, and some of it
one-of-a-kind (the aforementioned two chips).  But they are at the
bottom of the list of suppliers in all designs I do.  Search PIClist for
more stories.

I'm not saying other suppliers have problems.  At one point I bought the
last 5 of some particular model of 18F PIC from microchip in thailand or
wherever.  All sold out.  Everywhere.  And I needed 15.  Not fun.  But
PICs don't have 11 week leadtime for small qty.

I would absolutely use another PIC or anything else in place of the
Maxim part in this application.

Friendly cautions...
J


Jan-Erik Soderholm wrote:
{Quote hidden}

2010\02\03@230436 by William \Chops\ Westfield

face picon face

On Feb 3, 2010, at 11:23 AM, Isaac Marino Bavaresco wrote:

>> www.maxim-ic.com/quick_view2.cfm/qv_pk/6463
>>
> At $4.00/unit @ 1k, it is more expensive than most PIC24 with 4 UARTs.

You could consider using "slave" 16F devices running UART code,  
communicating with the master PIC via SPI or I2C (there are 16F  
devices that will do UART and SPI slave at the same time, aren't there?)

BillW

2010\02\04@042604 by Alan B. Pearce

face picon face
>> Why don't you connect 4 PIC16Fs in an I2C arrangement?
>> Each one would be a UART port?
>> The PIC16F87 comes to mind...One as I2C master, 3 slaves...
>
>Some points against this idea:
>
>1) You would need to write two different firmwares (if you use
> the same parts for master and slave, take care not to mix them);

It is not that hard to write the firmware so that all 4 copies are
identical, and the master/slave relationship is determined by the address.

>2) Program the three slaves with different addresses (or waste
>at least two pins for address);

But with the extra chips, there are probably going to be sufficient extra
pins anyway.

>3) Deal with an extra protocol (I2C) and bus (don´t forget
>that some PIC´s I2C modules don´t work well in slave mode);

I2C as a protocol is pretty straight forward. Microchip has some example
code that seems to work well, it certainly did for me.

>4) I2C is slow, its bandwidth may be insufficient for
>three 38400bps channels;

Given the constraints he mentioned, I think a 400kbps I2C channel will be
sufficient.

>5) Use more board area than one single bigger chip;

I reckon I could get 4 SOIC 18 pin chips in a similar area to an 80/100 pin
TQFP. A 64 pin TQFP would be pushing it.

>6) May cost more than a PIC32.

But would it cost more than a Maxim UART?

2010\02\04@054416 by Isaac Marino Bavaresco

flavicon
face
Em 3/2/2010 17:44, Jan-Erik Soderholm escreveu:
{Quote hidden}

He wants a large buffer because the UART would be off-chip. With the
on-board UART, all the MCU's RAM may become a buffer, just use an
interrupt-driven receive routine and a circular buffer.

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\04@060907 by Isaac Marino Bavaresco

flavicon
face
Em 4/2/2010 07:26, Alan B. Pearce escreveu:
>>> Why don't you connect 4 PIC16Fs in an I2C arrangement?
>>> Each one would be a UART port?
>>> The PIC16F87 comes to mind...One as I2C master, 3 slaves...
>>>      
>> Some points against this idea:
>>
>> 1) You would need to write two different firmwares (if you use
>> the same parts for master and slave, take care not to mix them);
>>    
> It is not that hard to write the firmware so that all 4 copies are
> identical, and the master/slave relationship is determined by the address.
>  


But your firmware would need to embed the complexity of the two versions
anyway. Would it fit in 4 or 8k words? How about 64k words of flash?


>> 2) Program the three slaves with different addresses (or waste
>> at least two pins for address);
>>    
> But with the extra chips, there are probably going to be sufficient extra
> pins anyway.
>  


Probably.

>> 3) Deal with an extra protocol (I2C) and bus (don´t forget
>> that some PIC´s I2C modules don´t work well in slave mode);
>>    
> I2C as a protocol is pretty straight forward. Microchip has some example
> code that seems to work well, it certainly did for me.
>  


Even if it works, you would be using more parts and code to do the same job.


>> 4) I2C is slow, its bandwidth may be insufficient for
>> three 38400bps channels;
>>    
> Given the constraints he mentioned, I think a 400kbps I2C channel will be
> sufficient.
>  


Don't forget that small PICs don't have DMA, you would need to read the
data from the slaves in busy-loops or in an interrupt routine.
Assume a PIC16 at 20MHz = 5MIPS.
3*38400bps=115200bps
5000000/115200=43,4 instruction cycles.

You would have 43 instruction cycles to receive each byte from the
slaves, not accounting for I2C protocol overhead and the transmission
side of the thing. It would be hardly doable with interrupts, and if so
it would waste a very large of the CPU time both with interrupts and
with busy-loop approach. You don't know what more the OP needs to do
with the firmware.


>> 5) Use more board area than one single bigger chip;
>>    
> I reckon I could get 4 SOIC 18 pin chips in a similar area to an 80/100 pin
> TQFP. A 64 pin TQFP would be pushing it.
>  


The PIC32 I'm using is 64 pin TQFP and it has 6 UARTS.
Don't forget the area taken by tracks betweens the chips.


>> 6) May cost more than a PIC32.
>>    
> But would it cost more than a Maxim UART?
>  

The point is: There are more than two options, why not choose the less
expensive one? Besides, lots  of MIPS (32-bit MIPS) make it even easier
to program a successful application.


Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2010\02\06@151336 by Dario Greggio

face picon face
Jesse Lackey ha scritto:

> [...]time I've had a bad situation involving Maxim and their parts being made
> of 100% unobtanium.

Is it the one from Avatar movie? :))

(sorry :) could not resist)


--

Ciao, Dario
--
Cyberdyne

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...