Hi all,
did anyone ever do a LINbus implementation on LPC with a soft uart?
I'd like to learn more on this topic and i'm thinking of keeping this
as a fallback scenario for external communication. and the reason for a soft
uart would be that this will nearly alway work even when there are no more HW
uarts left.
would someone be willing to share this
thanks in advance,
Martijn
LINbus implementation with soft uart on LPC
Started by ●April 25, 2009
Reply by ●April 27, 20092009-04-27
Hi,
implementing a software uart is a bit resource hungry. At 20Kbit / sec
you have an interrupt each 50 uS. This interrupt is then responsible to
generate/sample the next bit on the serial line. If you delay the
interrupt, the communication will be mixed up (if you want to do
oversampling to make the UART more noise tolerant, then the picture is
even worst). If you use a timer for input capture and output generation
then things are a bit better, but I think timers are as rare resources
as uarts.
While it is possible to implement a software uart, it is only a useful
solution in some rare cases. It is better to use an external uart, or a
second dedicated 8 bit MCU just for LIN which is connected to the SPI or
I2C interface of the main unit (LPC chip).
Foltos
Martijn Broens wrote:
> Hi all,
>
> did anyone ever do a LINbus implementation on LPC with a soft uart?
>
> I'd like to learn more on this topic and i'm thinking of keeping this as a fallback scenario for external communication. and the reason for a soft uart would be that this will nearly alway work even when there are no more HW uarts left.
>
> would someone be willing to share this
>
> thanks in advance,
> Martijn
>
>
implementing a software uart is a bit resource hungry. At 20Kbit / sec
you have an interrupt each 50 uS. This interrupt is then responsible to
generate/sample the next bit on the serial line. If you delay the
interrupt, the communication will be mixed up (if you want to do
oversampling to make the UART more noise tolerant, then the picture is
even worst). If you use a timer for input capture and output generation
then things are a bit better, but I think timers are as rare resources
as uarts.
While it is possible to implement a software uart, it is only a useful
solution in some rare cases. It is better to use an external uart, or a
second dedicated 8 bit MCU just for LIN which is connected to the SPI or
I2C interface of the main unit (LPC chip).
Foltos
Martijn Broens wrote:
> Hi all,
>
> did anyone ever do a LINbus implementation on LPC with a soft uart?
>
> I'd like to learn more on this topic and i'm thinking of keeping this as a fallback scenario for external communication. and the reason for a soft uart would be that this will nearly alway work even when there are no more HW uarts left.
>
> would someone be willing to share this
>
> thanks in advance,
> Martijn
>
>
Reply by ●April 27, 20092009-04-27
Hi,
by the way. Try this link
http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/an10689.pdf
Foltos
Martijn Broens wrote:
> Hi all,
>
> did anyone ever do a LINbus implementation on LPC with a soft uart?
>
> I'd like to learn more on this topic and i'm thinking of keeping this as a fallback scenario for external communication. and the reason for a soft uart would be that this will nearly alway work even when there are no more HW uarts left.
>
> would someone be willing to share this
>
> thanks in advance,
> Martijn
>
>
by the way. Try this link
http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/an10689.pdf
Foltos
Martijn Broens wrote:
> Hi all,
>
> did anyone ever do a LINbus implementation on LPC with a soft uart?
>
> I'd like to learn more on this topic and i'm thinking of keeping this as a fallback scenario for external communication. and the reason for a soft uart would be that this will nearly alway work even when there are no more HW uarts left.
>
> would someone be willing to share this
>
> thanks in advance,
> Martijn
>
>
Reply by ●May 11, 20092009-05-11
--- In l..., Foltos wrote:
>
> Hi,
>
> by the way. Try this link
> http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/an10689.pdf
>
> Foltos
>
> Martijn Broens wrote:
> > Hi all,
> >
> > did anyone ever do a LINbus implementation on LPC with a soft uart?
> >
> > I'd like to learn more on this topic and i'm thinking of keeping this as a fallback scenario for external communication. and the reason for a soft uart would be that this will nearly alway work even when there are no more HW uarts left.
> >
> > would someone be willing to share this
> >
> > thanks in advance,
> > Martijn
> >
> >
> >
> >
> >
> >
>
> Hi,
>
> by the way. Try this link
> http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/an10689.pdf
>
> Foltos
>
> Martijn Broens wrote:
> > Hi all,
> >
> > did anyone ever do a LINbus implementation on LPC with a soft uart?
> >
> > I'd like to learn more on this topic and i'm thinking of keeping this as a fallback scenario for external communication. and the reason for a soft uart would be that this will nearly alway work even when there are no more HW uarts left.
> >
> > would someone be willing to share this
> >
> > thanks in advance,
> > Martijn
> >
> >
> >
> >
> >
> >