EmbeddedRelated.com
Forums

Search for part -- replacement for LPC11C24

Started by skiddybird April 8, 2012
Sorry, one mistake in question 2. The firmware code has never been changed.

--- In l..., "skiddybird" wrote:
>
> Thank you all! 2 new questions.
> 1. If the transmission distance is long (above 5km), then should the optocouplers be installed
> 2. I have written one piece of code snippet for TX testing. The code simply transmits one CAN frame periodically. No other tasks. In fact the code is not a multitasking OS, it is only one foreground/background system. The hardware consists of one LPC2119 and one CAN transceiver. If the CAN transceiver is connected to the CAN bus, then other devices on the same bus can receive the frame periodically. The waveform seems normal on the TX pin of the LPC2119, when measuring with an oscilloscope. Under such preconditions, if the CAN transceiver is removed form the PCB using a soldering iron, then no more waveform appears on the TX pin of the MCU, when taking the same measurement with the same oscilloscope. The firmware code has never been unchanged. Why does this happen? The MCU and the CAN transceiver are discrete to each other. The MCU should go on with its transmission regardless of the outside world. Will the MCU detect for bus presence before transmission? Has it entered the so-called Bus-off state? How to setup the pertinent registers to fix this anomaly?
>
>
> --- In l..., roelof 't Hooft wrote:
> >
> > On Mon, 2012-04-09 at 15:26 +0000, skiddybird wrote:
> > > ok, it should be good to use external CAN transceiver, and TJF1051
> > > is the latest generation. But question arises. Is it necessary to
> > > install two optocouplers(such as 6N137) between the MCU and the
> > > TJF1051, one for TXD, another for RXD?
> >
> > Only if you really need to avoid ground loops for instance.
> > Or work with high tension devices.
> >
> >
> > > Then what does "directly" stand for ? Does it mean that no optocoupler
> > > is allowed?
> >
> > "directly" stands for a direct connection :-)
> > CAN driver pin rxd connects to uC CAN pin rd and
> > CAN driver pin txd connects to uC CAN pin td.
> > Do not forget the gnd and +5V connections to the
> > CAN driver with all the decoupling cap's.
> >
> > roelof
>

An Engineer's Guide to the LPC2100 Series

On Tue, 2012-04-10 at 03:45 +0000, skiddybird wrote:
> Thank you all! 2 new questions.
> 1. If the transmission distance is long (above 5km), then should the
> optocouplers be installed

5 km ?
I do not think that is going to work at all even at a very
low bitrate.
And yes if it would work, optocouplers are a good idea to
use due to the voltage drops on the copper wires and the
most likely resulting current (ground) loops.
> The MCU should
> go on with its transmission regardless of the outside world.

The mcu does do that, but there is no outside world for the
mcu since the CAN driver has been removed.
> Will the MCU detect for bus presence before transmission?

The mcu detects the dominant and recessive states of the bus
during transmission and there is no way to monitor the state
of the bus due to the fact the driver (with receiver) is not
connected to the mcu and bus.
> Has it entered the so-called Bus-off state?

I think so.
> How to setup the pertinent registers to fix this anomaly?

Fix it by connecting the CAN bus driver.

You will find a lot of information on the web to read about
CAN bus, please do so.

roelof

Il 10/04/2012 05:49, skiddybird ha scritto:
>
>
> Sorry, one mistake in question 2. The firmware code has never been
> changed.
>
> --- In l... ,
> "skiddybird" wrote:
> >
> > Thank you all! 2 new questions.
> > 1. If the transmission distance is long (above 5km), then should the
> optocouplers be installed
>
You have to choose the right optocouplers because you are at the limit
of 10Kbit baud rate that should be the lowest CAN bus standard baud rate.
>
> > 2. I have written one piece of code snippet for TX testing. The code
> simply transmits one CAN frame periodically. No other tasks. In fact
> the code is not a multitasking OS, it is only one
> foreground/background system. The hardware consists of one LPC2119 and
> one CAN transceiver. If the CAN transceiver is connected to the CAN
> bus, then other devices on the same bus can receive the frame
> periodically. The waveform seems normal on the TX pin of the LPC2119,
> when measuring with an oscilloscope. Under such preconditions, if the
> CAN transceiver is removed form the PCB using a soldering iron, then
> no more waveform appears on the TX pin of the MCU, when taking the
> same measurement with the same oscilloscope. The firmware code has
> never been unchanged. Why does this happen? The MCU and the CAN
> transceiver are discrete to each other. The MCU should go on with its
> transmission regardless of the outside world. Will the MCU detect for
> bus presence before transmission? Has it entered the so-called Bus-off
> state? How to setup the pertinent registers to fix this anomaly?
> >
> >
> > --- In l... ,
> roelof 't Hooft wrote:
> > >
> > > On Mon, 2012-04-09 at 15:26 +0000, skiddybird wrote:
> > > > ok, it should be good to use external CAN transceiver, and TJF1051
> > > > is the latest generation. But question arises. Is it necessary to
> > > > install two optocouplers(such as 6N137) between the MCU and the
> > > > TJF1051, one for TXD, another for RXD?
> > >
> > > Only if you really need to avoid ground loops for instance.
> > > Or work with high tension devices.
> > >
> > >
> > > > Then what does "directly" stand for ? Does it mean that no
> optocoupler
> > > > is allowed?
> > >
> > > "directly" stands for a direct connection :-)
> > > CAN driver pin rxd connects to uC CAN pin rd and
> > > CAN driver pin txd connects to uC CAN pin td.
> > > Do not forget the gnd and +5V connections to the
> > > CAN driver with all the decoupling cap's.
> > >
> > > roelof
> > >
> >



> 1. If the transmission distance is long (above 5km), then should the
optocouplers be installed?

Yes, you should optocouple as much as you can with something like this:
Long Range High Speed Opto Coupler
r-Optical-Converter.html>



--- In l..., "skiddybird" wrote:
>
> Thank you all! 2 new questions.
> 1. If the transmission distance is long (above 5km), then should the optocouplers be installed

If you have to ask about the opto-couplers you shouldn't (be allowed to) touch the 5km wire. You need opto couplers or transformers. More importantly you need to know about isolation practices, lightning protection and wiring codes or you are going to kill your equipment (for sure) and maybe even some people.

If run you a cable over any distance you need to be aware that the local ground potential at the two endpoints can be VERY different, both statically and dynamically. The link points to resistors that are typically used to limit ground currents when things go wrong.

http://www.geindustrial.com/cwc/Dispatcher?REQUEST=PRODUCTS&pnlid=5&famid=33&catid=75&id=ngr

Your cable must never, ever provide a path around the local protection systems unless it is protected from ground faults, out of balance mains and lightning. The voltages are huge and the currents are heart stopping (literally). Search for "lightning equipotential" in Google and look at the first pdf. Those are placed on pipes to (mostly) prevent ground current to flow via the pipe from one end of the pipe to the other. Most pipes are a lot shorter than 5km. They conduct during lightning strikes.

Electricity comes in two varieties, domesticated and wild. We almost always deal with the domesticated kind, the wild kind is scary and extremely dangerous. When you let the wires out the house you need know how to deal with the wild, undomesticated electricity. :-)

Regards
Dan