EmbeddedRelated.com
Forums
Memfault Beyond the Launch

LPC2103 I/O and processing speed to handle 6 serial ports.

Started by Unknown October 3, 2006
Hi,

I have a project where I need to control 6 serial ports operating at
4800 baud and one bluetooth module. Would the LPC2103 be fast enough to
implement 6 serial ports using a timer interrupt and bit banging ?? Would I
still have enough processing power left to handle the higher level protocols
involved ?? Has anyone done something similar ??

I have never used a 32 bit microcontroller so I am really quite lost in
this area and any help would be much appreciated.

Best regards,
Alexandre Guimaraes

An Engineer's Guide to the LPC2100 Series

----- Original Message -----
From: "Alexandre Guimars"
To:
Sent: Tuesday, October 03, 2006 6:02 PM
Subject: [lpc2000] LPC2103 I/O and processing speed to handle 6 serial
ports.
> Hi,
>
> I have a project where I need to control 6 serial ports operating at
> 4800 baud and one bluetooth module. Would the LPC2103 be fast enough to
> implement 6 serial ports using a timer interrupt and bit banging ?? Would
> I
> still have enough processing power left to handle the higher level
> protocols
> involved ?? Has anyone done something similar ??
>
> I have never used a 32 bit microcontroller so I am really quite lost in
> this area and any help would be much appreciated.

Why not code the bit-banging, see how much overhead is involved, and do the
sums?

Leon
On Tue, 3 Oct 2006 14:02:50 -0300, you wrote:

>Hi,
>
> I have a project where I need to control 6 serial ports operating at
>4800 baud and one bluetooth module. Would the LPC2103 be fast enough to
>implement 6 serial ports using a timer interrupt and bit banging ?? Would I
>still have enough processing power left to handle the higher level protocols
>involved ?? Has anyone done something similar ??

You could do this on an 8-bit AVR, so an ARM should be able to so this easily without breaking a
sweat.
A useful trick for multiple UARTS is at the start of the timer interrupt, to read all the rx bits in
one go, and write the tx bits from the previous interrupt, then do the processing - that way
differing processing times don't introduce jitter. If you have other ints, you want your soft UART
timer int to be 3x or 4x the baudrate to get optimal bit-centering
> I have never used a 32 bit microcontroller so I am really quite lost in
>this area and any help would be much appreciated.
>
>Best regards,
>Alexandre Guimaraes
>
Hi, Leon

I do not have the environment or hardware for the LPC2103 at hand.. I
was in search for a well informed "guess" if it is viable or not before
starting at a hole new setup.. I am usually not a lazy person :-) If the
setup was ready I would not even have asked for help.

Best regards,
Alexandre Guimaraes
>> Hi,
>>
>> I have a project where I need to control 6 serial ports operating at
>> 4800 baud and one bluetooth module. Would the LPC2103 be fast enough to
>> implement 6 serial ports using a timer interrupt and bit banging ?? Would
>> I
>> still have enough processing power left to handle the higher level
>> protocols
>> involved ?? Has anyone done something similar ??
>>
>> I have never used a 32 bit microcontroller so I am really quite lost
>> in
>> this area and any help would be much appreciated.
>
> Why not code the bit-banging, see how much overhead is involved, and do
> the
> sums?
>
> Leon
Hi, Mike

> You could do this on an 8-bit AVR, so an ARM should be able to so this
> easily without breaking a
> sweat.
> A useful trick for multiple UARTS is at the start of the timer interrupt,
> to read all the rx bits in
> one go, and write the tx bits from the previous interrupt, then do the
> processing - that way
> differing processing times don't introduce jitter. If you have other
> ints, you want your soft UART
> timer int to be 3x or 4x the baudrate to get optimal bit-centering

I already have this done with a ATMEGA8 but I need more RAM and the AVR
family just goes up to 8K :-( I use a 3x timer interrupt and also handle
SLIP protocol inside the timer int's.. It is all coded in assembler so I
will probably loose most of the code when migrating to the ARM family :-(

My main concern is that I have read sometimes that the LPC family is
rather slow when doing I/O operations. As I have never worked with any ARM's
and do not have the setup ready for testing I guessed that it is better to
be safe than sorry and preferred to ask before spending money on buying a
new compiler and building new hardware..

Thanks a lot for the help.

Best regards,
Alexandre Guimaraes
Hi Alexandre,

LPC2103 I/O switching is fast 15 MHz. I have used LPC2148 with similar speed and LPC2103 is the same . You can easily implement 6 UART with LPC2103.

Alexandre Guimars wrote: Hi, Mike

> You could do this on an 8-bit AVR, so an ARM should be able to so this
> easily without breaking a
> sweat.
> A useful trick for multiple UARTS is at the start of the timer interrupt,
> to read all the rx bits in
> one go, and write the tx bits from the previous interrupt, then do the
> processing - that way
> differing processing times don't introduce jitter. If you have other
> ints, you want your soft UART
> timer int to be 3x or 4x the baudrate to get optimal bit-centering

I already have this done with a ATMEGA8 but I need more RAM and the AVR
family just goes up to 8K :-( I use a 3x timer interrupt and also handle
SLIP protocol inside the timer int's.. It is all coded in assembler so I
will probably loose most of the code when migrating to the ARM family :-(

My main concern is that I have read sometimes that the LPC family is
rather slow when doing I/O operations. As I have never worked with any ARM's
and do not have the setup ready for testing I guessed that it is better to
be safe than sorry and preferred to ask before spending money on buying a
new compiler and building new hardware..

Thanks a lot for the help.

Best regards,
Alexandre Guimaraes






---------------------------------
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail.





On Wed, 4 Oct 2006 01:17:03 -0300, you wrote:

>Hi, Mike
>
>> You could do this on an 8-bit AVR, so an ARM should be able to so this
>> easily without breaking a
>> sweat.
>> A useful trick for multiple UARTS is at the start of the timer interrupt,
>> to read all the rx bits in
>> one go, and write the tx bits from the previous interrupt, then do the
>> processing - that way
>> differing processing times don't introduce jitter. If you have other
>> ints, you want your soft UART
>> timer int to be 3x or 4x the baudrate to get optimal bit-centering
>
> I already have this done with a ATMEGA8 but I need more RAM and the AVR
>family just goes up to 8K :-( I use a 3x timer interrupt and also handle
>SLIP protocol inside the timer int's.. It is all coded in assembler so I
>will probably loose most of the code when migrating to the ARM family :-(
>
> My main concern is that I have read sometimes that the LPC family is
>rather slow when doing I/O operations. As I have never worked with any ARM's
>and do not have the setup ready for testing I guessed that it is better to
>be safe than sorry and preferred to ask before spending money on buying a
>new compiler and building new hardware..

IO speed is not really an issue - up to 8 uarts takes one 8-bit port read and one write at 3 or 4x
the baudrate, hardly taxing at 4800baud, even with slow IO..!
Hi,
> IO speed is not really an issue - up to 8 uarts takes one 8-bit port read
> and one write at 3 or 4x
> the baudrate, hardly taxing at 4800baud, even with slow IO..!

Oh Boy ! Do i Fell stupid at some times... I got so used to use bit
operations for Bit Banging on the AVR that the possibility of reading the
whole port at once did not even crossed my mind :-(

Thanks a LOT ! Problem solved.... The rest of it will be just
translating from one assembler to the other or maybe even C coding the whole
interrupt because I will have much more processing power available and code
size will not be a issue on this application..

Best regards,
Alexandre Guimaraes
--- In l..., Alexandre Guimars wrote:

> Thanks a LOT ! Problem solved.... The rest of it will be just
> translating from one assembler to the other or maybe even C coding
the whole
> interrupt because I will have much more processing power available
and code
> size will not be a issue on this application..

If you make sure you have the optimser on, you will probably see very
little difference in speed between 'C' and assembler. My advice would
be to stick with 'C': it'll be much quicker to write, debug and test.



Just FYI, in my "day job", I am using a Cypress PSoC chip and
using 6 1/2 duplex and 1 full duplex UART at the same time at
19,200 baud. It's a nice part if you need lots of uarts.
These are hardware and the software changes them on the fly
from TX to RX and back again.

My Nite job uses the LPC series, but just 2 UARTS.

At my last job, we used an AVR with 10 UARTS in software
at 9600 baud plus the one hardware UART at 19,200 baud.

boB

--- In l..., Mike Harrison wrote:
>
> On Wed, 4 Oct 2006 01:17:03 -0300, you wrote:
>
> >Hi, Mike
> >
> >> You could do this on an 8-bit AVR, so an ARM should be able to
so this
> >> easily without breaking a
> >> sweat.
> >> A useful trick for multiple UARTS is at the start of the timer
interrupt,
> >> to read all the rx bits in
> >> one go, and write the tx bits from the previous interrupt, then
do the
> >> processing - that way
> >> differing processing times don't introduce jitter. If you have
other
> >> ints, you want your soft UART
> >> timer int to be 3x or 4x the baudrate to get optimal bit-
centering
> >
> > I already have this done with a ATMEGA8 but I need more RAM
and the AVR
> >family just goes up to 8K :-( I use a 3x timer interrupt and also
handle
> >SLIP protocol inside the timer int's.. It is all coded in
assembler so I
> >will probably loose most of the code when migrating to the ARM
family :-(
> >
> > My main concern is that I have read sometimes that the LPC
family is
> >rather slow when doing I/O operations. As I have never worked with
any ARM's
> >and do not have the setup ready for testing I guessed that it is
better to
> >be safe than sorry and preferred to ask before spending money on
buying a
> >new compiler and building new hardware..
>
> IO speed is not really an issue - up to 8 uarts takes one 8-bit
port read and one write at 3 or 4x
> the baudrate, hardly taxing at 4800baud, even with slow IO..!
>

Memfault Beyond the Launch