EmbeddedRelated.com
Forums

LPC2378 - Ethernet

Started by DeV March 19, 2012
Hi Dev,

I guess there are several options, have you considered using a wireless
interface and just RS232.
Typically I guess you have a few options but it depends on the range and
data rate and other system considerations.

You could use ZigBee, Bluetooth, powerline, Ethernet, WiFi, CAN, USB etc but
without knowing what range you want and what is on the other end it's
difficult to suggest anything specific.

Are you looking to remain compatible with other devices using the same
medium, or can you have a dedicated connection.

Do you need to have multiple modes, or is it just a point to point
interface.

If you are considering commercializing a product then you also have to
consider any interoperability regulations and approvals required for your
chosen medium.

Regards

Phil.

-----Original Message-----
From: l... [mailto:l...] On Behalf Of
DeV
Sent: 19 March 2012 08:52
To: l...
Subject: Re: [lpc2000] LPC2378 - Ethernet

Also Phil, Please advise me some other mode of communication (e.g. CAN, USB
etc) which will be suitable for me to learn as a beginner..Thanks again..
> Hi Dev,
>>
>> This is a huge area, Ethernet is not like RS232, you don't just
>> squirt data in at one end and get data out at the other, there is a
>> lot of sw that needs to be running.
>>
>> The first thing you need to do is decide what protocols you wish to
>> communicate with, then you can build up a list of the required
>> protocols you need installed, ( it will be quite a bit larger ).
>>
>> For example are you planning on using it on a private network with
>> static IP address, or do you need it to have a DHCP client to get an
>> IP address at startup.
>>
>> I suggest learning about Networking from a more general forum first,
>> decide what protocols you need to implement, and then it's more
>> appropriate to ask on the LPC forum about specifics of implementing
>> them.
>>
>> Regards
>>
>> Phil.
>>
>> From: l... [mailto:l...] On
>> Behalf Of DeV
>> Sent: 19 March 2012 07:06
>> To: l...
>> Subject: [lpc2000] LPC2378 - Ethernet
>> Hello all...i own a lpc2378-stk kit and want to communicate via
>> Ethernet...Since i am entirely new to communication so i request all
>> the pros to pls suggest me some sources (online books, articles,
>> links
>> etc.) that can help me to clearly understand set this communication
>> as a beginner...thanks alot!
>>
>>
>>
>>
>>
>>
>> --
>
> Dev Sampat****
>
> Cell (Oman): (+968) - 9304 8932****
>
> Email: d...@gmail.com
--

Dev Sampat****

Cell (Oman): (+968) - 9304 8932****

Email: d...@gmail.com


An Engineer's Guide to the LPC2100 Series

Hi Phil,

Thanks for your message. Actually my priority was wireless systems..but
then i am not sure how to integrate technologies like bluetooth with the
kit..pls advise me on what wireless technologies can be easy and suitable
for to learn after RS232 and also suitable to implement on the lpc2378-stk
kit..since the kit does not have any bluetooth on board so will i be able
to to do this??..i would love to learn any possible technologies like
these...

My main aim will be to receive the temperature readings from remote
sensors..the range can be anything upto a few 100 meters...now since
everyone is suggesting a very complex nature of Ethernet, so i am also
thinking about RS485...i will now try to implement RS485 with my kit...pls
tel me if i am doing correct...and if i will be able to do it...my
knowledge at the moment is only limited to RS232 which again i could do
only because of your help..

My main concern at the moment is only creating point to point
link...something like a sensor communicating via the kit with a controller
like a pc...

Thanks again Phil..

On Mon, Mar 19, 2012 at 3:29 PM, Phil Young wrote:

> **
> Hi Dev,
>
> I guess there are several options, have you considered using a wireless
> interface and just RS232.
> Typically I guess you have a few options but it depends on the range and
> data rate and other system considerations.
>
> You could use ZigBee, Bluetooth, powerline, Ethernet, WiFi, CAN, USB etc
> but
> without knowing what range you want and what is on the other end it's
> difficult to suggest anything specific.
>
> Are you looking to remain compatible with other devices using the same
> medium, or can you have a dedicated connection.
>
> Do you need to have multiple modes, or is it just a point to point
> interface.
>
> If you are considering commercializing a product then you also have to
> consider any interoperability regulations and approvals required for your
> chosen medium.
>
> Regards
>
> Phil.
> -----Original Message-----
> From: l... [mailto:l...] On Behalf
> Of
> DeV
> Sent: 19 March 2012 08:52
> To: l...
> Subject: Re: [lpc2000] LPC2378 - Ethernet
>
> Also Phil, Please advise me some other mode of communication (e.g. CAN, USB
> etc) which will be suitable for me to learn as a beginner..Thanks again..
>
> > Hi Dev,
> >>
> >> This is a huge area, Ethernet is not like RS232, you don't just
> >> squirt data in at one end and get data out at the other, there is a
> >> lot of sw that needs to be running.
> >>
> >> The first thing you need to do is decide what protocols you wish to
> >> communicate with, then you can build up a list of the required
> >> protocols you need installed, ( it will be quite a bit larger ).
> >>
> >> For example are you planning on using it on a private network with
> >> static IP address, or do you need it to have a DHCP client to get an
> >> IP address at startup.
> >>
> >> I suggest learning about Networking from a more general forum first,
> >> decide what protocols you need to implement, and then it's more
> >> appropriate to ask on the LPC forum about specifics of implementing
> >> them.
> >>
> >> Regards
> >>
> >> Phil.
> >>
> >> From: l... [mailto:l...] On
> >> Behalf Of DeV
> >> Sent: 19 March 2012 07:06
> >> To: l...
> >> Subject: [lpc2000] LPC2378 - Ethernet
> >>
> >>
> >> Hello all...i own a lpc2378-stk kit and want to communicate via
> >> Ethernet...Since i am entirely new to communication so i request all
> >> the pros to pls suggest me some sources (online books, articles,
> >> links
> >> etc.) that can help me to clearly understand set this communication
> >> as a beginner...thanks alot!
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> > --
> >
> > Dev Sampat****
> >
> > Cell (Oman): (+968) - 9304 8932****
> >
> > Email: d...@gmail.com
> >
> > --
>
> Dev Sampat****
>
> Cell (Oman): (+968) - 9304 8932****
>
> Email: d...@gmail.com
>
>
>
I would suggest initially trying an RF solution, you can be as clever as you
like with the decoding of the data, there are single chip radio solutions in
the 430 MHz band that do all the RF work for you.

You interface to them using SPI.

You should be able to get some demo RF boards.

Try silicon labs SI443x series parts.

Regards

Phil.

-----Original Message-----
From: l... [mailto:l...] On Behalf Of
DeV
Sent: 19 March 2012 11:50
To: l...
Subject: Re: [lpc2000] LPC2378 - Ethernet

Hi Phil,

Thanks for your message. Actually my priority was wireless systems..but then
i am not sure how to integrate technologies like bluetooth with the kit..pls
advise me on what wireless technologies can be easy and suitable for to
learn after RS232 and also suitable to implement on the lpc2378-stk
kit..since the kit does not have any bluetooth on board so will i be able to
to do this??..i would love to learn any possible technologies like these...

My main aim will be to receive the temperature readings from remote
sensors..the range can be anything upto a few 100 meters...now since
everyone is suggesting a very complex nature of Ethernet, so i am also
thinking about RS485...i will now try to implement RS485 with my kit...pls
tel me if i am doing correct...and if i will be able to do it...my knowledge
at the moment is only limited to RS232 which again i could do only because
of your help..

My main concern at the moment is only creating point to point
link...something like a sensor communicating via the kit with a controller
like a pc...

Thanks again Phil..

On Mon, Mar 19, 2012 at 3:29 PM, Phil Young
wrote:

> **
> Hi Dev,
>
> I guess there are several options, have you considered using a
> wireless interface and just RS232.
> Typically I guess you have a few options but it depends on the range
> and data rate and other system considerations.
>
> You could use ZigBee, Bluetooth, powerline, Ethernet, WiFi, CAN, USB
> etc but without knowing what range you want and what is on the other
> end it's difficult to suggest anything specific.
>
> Are you looking to remain compatible with other devices using the same
> medium, or can you have a dedicated connection.
>
> Do you need to have multiple modes, or is it just a point to point
> interface.
>
> If you are considering commercializing a product then you also have to
> consider any interoperability regulations and approvals required for
> your chosen medium.
>
> Regards
>
> Phil.
> -----Original Message-----
> From: l... [mailto:l...] On
> Behalf Of DeV
> Sent: 19 March 2012 08:52
> To: l...
> Subject: Re: [lpc2000] LPC2378 - Ethernet
>
> Also Phil, Please advise me some other mode of communication (e.g.
> CAN, USB
> etc) which will be suitable for me to learn as a beginner..Thanks again..
>
> > Hi Dev,
> >>
> >> This is a huge area, Ethernet is not like RS232, you don't just
> >> squirt data in at one end and get data out at the other, there is a
> >> lot of sw that needs to be running.
> >>
> >> The first thing you need to do is decide what protocols you wish to
> >> communicate with, then you can build up a list of the required
> >> protocols you need installed, ( it will be quite a bit larger ).
> >>
> >> For example are you planning on using it on a private network with
> >> static IP address, or do you need it to have a DHCP client to get
> >> an IP address at startup.
> >>
> >> I suggest learning about Networking from a more general forum
> >> first, decide what protocols you need to implement, and then it's
> >> more appropriate to ask on the LPC forum about specifics of
> >> implementing them.
> >>
> >> Regards
> >>
> >> Phil.
> >>
> >> From: l... [mailto:l...] On
> >> Behalf Of DeV
> >> Sent: 19 March 2012 07:06
> >> To: l...
> >> Subject: [lpc2000] LPC2378 - Ethernet
> >>
> >>
> >> Hello all...i own a lpc2378-stk kit and want to communicate via
> >> Ethernet...Since i am entirely new to communication so i request
> >> all the pros to pls suggest me some sources (online books,
> >> articles, links
> >> etc.) that can help me to clearly understand set this communication
> >> as a beginner...thanks alot!
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> > --
> >
> > Dev Sampat****
> >
> > Cell (Oman): (+968) - 9304 8932****
> >
> > Email: d...@gmail.com
> >
> > --
>
> Dev Sampat****
>
> Cell (Oman): (+968) - 9304 8932****
>
> Email: d...@gmail.com
>
>
>
Some books:

The original and still the best for TCP/IP is "TCP/IP Illustrated" by W.Richard Stevens, published Addison Wesley in 3 volumes. Volume 1 is probably all you need at this stage as it contains the basic structure of the protocol, but buy all three books eventually if you have the opportunity and the money. A bit out of date now, but the basics don't change.

"TCP/IP LEAN" by Jeremy Bentham, published by CMP Books, is focused on embedded applications and got me started. (I have a spare copy you can have for just the postage if you write to me off-list).

"The Embedded Internet" by Sergio Scaglia, published Addison Wesley.

"TCP/IP Embedded Internet Applications" by Edward Insam, published by Newnes.

You don't need all of these. Buy the Stevens, then whatever else you can get your hands on.

You will need a copy of Ethereal for testing. It's a free download from www.ethereal.com under GNU licence. Like everything to do with Ethernet it's a bit confusing at first, but stick with it.

Good luck, and be prepared to spend some time at this. You will develop skills for which people will actually pay you folding money! :)

Hope this helps,

Ian

Thanks somuch Ian...For ethernet I can start with "TCP/IP Illustrated"
Volume 1 by W.Richard Stevens...after that maybe i can shift over to "TCP/IP
LEAN" by Jeremy Bentham, published by CMP Books..is it ok?..and can you
please tel me wat do u mean by requirement of Ethereal for testing...what
is book about?...thanks again mate!


From the description of the requirements, i.e. to send temperature
information periodically I would except that UDP is all that is required.

Encapsulating a simple temperature measurement in a TCP packet just doesn't
make any sense.

Regards

Phil.

From: l... [mailto:l...] On Behalf Of
Hawthorn
Sent: 19 March 2012 12:09
To: l...
Subject: [lpc2000] Re: LPC2378 - Ethernet

Some books:

The original and still the best for TCP/IP is "TCP/IP Illustrated" by
W.Richard Stevens, published Addison Wesley in 3 volumes. Volume 1 is
probably all you need at this stage as it contains the basic structure of
the protocol, but buy all three books eventually if you have the opportunity
and the money. A bit out of date now, but the basics don't change.

"TCP/IP LEAN" by Jeremy Bentham, published by CMP Books, is focused on
embedded applications and got me started. (I have a spare copy you can have
for just the postage if you write to me off-list).

"The Embedded Internet" by Sergio Scaglia, published Addison Wesley.

"TCP/IP Embedded Internet Applications" by Edward Insam, published by
Newnes.

You don't need all of these. Buy the Stevens, then whatever else you can get
your hands on.

You will need a copy of Ethereal for testing. It's a free download from
www.ethereal.com under GNU licence. Like everything to do with Ethernet it's
a bit confusing at first, but stick with it.

Good luck, and be prepared to spend some time at this. You will develop
skills for which people will actually pay you folding money! :)

Hope this helps,

Ian



On Mon, 2012-03-19 at 15:49 +0400, DeV wrote:
> since the kit does not have any bluetooth on board so will i be able
> to to do this ?

Bleutooth, as a module, is actually easy to connect to your
board given that you have a spare uart. Hook the module up
to the +3V3, gnd, tx and rx (maybe rts/cts too) and learn
about the AT command set.
> My main aim will be to receive the temperature readings from remote
> sensors..the range can be anything upto a few 100 meters

Bluetooth will not be a good choice for such a distance. It's
range depends on the class, class1 for 100m, class 2 for 10m
and class 3 for 1m.
> i will now try to implement RS485 with my kit...pls
> tel me if i am doing correct...and if i will be able to do it

RS485 is basically RS232 on a different medium. The medium
being a balanced pair transmitter at +5V where RS232 is
un-balanced with levels going from -12V to +12V.
RS485 needs control of the transmitter when you need to send
data over the lines. ie You first listen for a certain amount
of time and make sure nobody is transmitting and only then
you turn on your transmitter and send data. After that the
transmitter is turned off and you start listening again.
There are 2 wire and 4 wire versions of RS485.
> My main concern at the moment is only creating point to point
> link...something like a sensor communicating via the kit with a controller
> like a pc...

A 4 wire RS485 connection is easy to do for this. You do not
even need to follow the RS485 protocol in respect to listening
first and then transmitting :-)
A 2 wire connection saves a lot of cost (on copper wire) at
a few 100m distance.

Do not forget the gnd connection between the nodes. It might
even be better if you used optocouplers to galvanically
separate the nodes from each other if you are using different
power sources.

roelof

Thanks Roelof...there are modules available for about $50+...do v have any
cheaper modules?..also if i buy one module to be attached to my kit then
how can i send data from my mobile? eg. in hyperterminal we type strings
directly for uart communication...but how do we send data through mobile
phone like in hyperterminal?

On Mon, Mar 19, 2012 at 4:36 PM, roelof 't Hooft wrote:

> **
> On Mon, 2012-03-19 at 15:49 +0400, DeV wrote:
> > since the kit does not have any bluetooth on board so will i be able
> > to to do this ?
>
> Bleutooth, as a module, is actually easy to connect to your
> board given that you have a spare uart. Hook the module up
> to the +3V3, gnd, tx and rx (maybe rts/cts too) and learn
> about the AT command set.
> > My main aim will be to receive the temperature readings from remote
> > sensors..the range can be anything upto a few 100 meters
>
> Bluetooth will not be a good choice for such a distance. It's
> range depends on the class, class1 for 100m, class 2 for 10m
> and class 3 for 1m.
> > i will now try to implement RS485 with my kit...pls
> > tel me if i am doing correct...and if i will be able to do it
>
> RS485 is basically RS232 on a different medium. The medium
> being a balanced pair transmitter at +5V where RS232 is
> un-balanced with levels going from -12V to +12V.
> RS485 needs control of the transmitter when you need to send
> data over the lines. ie You first listen for a certain amount
> of time and make sure nobody is transmitting and only then
> you turn on your transmitter and send data. After that the
> transmitter is turned off and you start listening again.
> There are 2 wire and 4 wire versions of RS485.
> > My main concern at the moment is only creating point to point
> > link...something like a sensor communicating via the kit with a
> controller
> > like a pc...
>
> A 4 wire RS485 connection is easy to do for this. You do not
> even need to follow the RS485 protocol in respect to listening
> first and then transmitting :-)
> A 2 wire connection saves a lot of cost (on copper wire) at
> a few 100m distance.
>
> Do not forget the gnd connection between the nodes. It might
> even be better if you used optocouplers to galvanically
> separate the nodes from each other if you are using different
> power sources.
>
> roelof
>
>
>

--

Dev Sampat****

Cell (Oman): (+968) - 9304 8932****

Email: d...@gmail.com


On Mon, 2012-03-19 at 17:05 +0400, DeV wrote:
> Thanks Roelof...there are modules available for about $50+...do v have any
> cheaper modules?..also if i buy one module to be attached to my kit then
> how can i send data from my mobile? eg. in hyperterminal we type strings
> directly for uart communication...but how do we send data through mobile
> phone like in hyperterminal?

BTW, why are you not using a 4-20mA loop that transmits
the temperature from the distant node ?
That might be a lot easier then different uC's.

Data from your mobile, you really need to learn how to
use www.google.com, is (I guess, I have no experience)
mostly send with an application that uses tcp/ip.
A terminal program would be a bit cumbersome !?

roelof

> please tel me wat do u mean by requirement of Ethereal for
> testing...what is book about?...thanks again mate!

Sorry, I should have explained. Ethereal is a PC program which monitors network traffic and displays it on screen. It enables you to see what data is wandering across your network, and captures it all to a disk file which you can inspect at your leisure for debugging purposes. You can also set up various filters to ensure that you see only the data you really want to see.

When developing an ethernet product typically you will set up a test network - isolated from your LAN or net connection - which contains only the unit under test (UUT) and your PC running Ethereal. Typically your UUT will, for example, transmit requests for data, and you will monitor those packets on screen to check that they are properly constructed. The packet construction format is what you will learn from Stevens.

There's no denying that comms is tricky. But the standards are all published (as Requests For Comments - RFCs) and if you're going to learn network programming you should download the relevant RFCs first. I can't pretend they are easy bedtime reading, even for native English speakers, but all the information is there and it's (mostly) all logical. Get the RFCs from http://www.rfc-editor.org/rfc-index2.html . There are over 6,000 of them now, but you will use only a few of them. The books will tell you which ones you need.

By all means get some experience first with RS232/485 or CAN, though there too you will find a protocol analyser absolutely invaluable. (At some stage you will need to spend some money I'm afraid). There are books on each of these protocols: pick one and master it. All experience is good, and you will learn to think like a programmer. I can't help you much with your C code because I have been writing in Forth since before C was invented and I never use anything else. But although all this looks daunting, don't be put off. You can do it.

Ian