ENC28j60 connection

125 views
Skip to first unread message

tanvi...@gmail.com

unread,
Mar 22, 2019, 5:26:05 AM3/22/19
to BeagleBoard
Hello,
I want to interface ENC28j60 ethernet module with beaglebone green. Is there any user level library or example for it?
I have worked with SPI on linux before, while googling I found  driver for the same https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/microchip/enc28j60.c but I don't have any idea about how to use it,can you please guide me through this?or is there any other way to do the same?any userlevel library reference,which will not make me to do changes in kernel module.I am looking for c references.  
following are the details of my beaglebone

cat /etc/dogtag
BeagleBoard.org Debian Image 2018-10-07
cat /etc/debian_version
9.7
uname -a
Linux beaglebone 4.14.71-ti-r80 #1 SMP PREEMPT Fri Oct 5 23:50:11 UTC 2018 armv7l GNU/Linux

any kind of help is highly appreciated

Thanks & Regards


Yiling Cao

unread,
Mar 24, 2019, 11:17:45 PM3/24/19
to beagl...@googlegroups.com
can't give you a comprehensive tutorial here. your can google spidev stuff, have a look how other's git diff have done it  (DTS or board file diff).  read: http://linux-sunxi.org/SPIdev

BTW Can't you use a usb ethernet?

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/db5ab55d-b3cb-4d44-bff2-70eb81b57b05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Robert Nelson

unread,
Mar 25, 2019, 10:07:40 AM3/25/19
to Beagle Board, tanvi...@gmail.com
On Fri, Mar 22, 2019 at 4:26 AM <tanvi...@gmail.com> wrote:
>
> Hello,
> I want to interface ENC28j60 ethernet module with beaglebone green. Is there any user level library or example for it?
> I have worked with SPI on linux before, while googling I found driver for the same https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/microchip/enc28j60.c but I don't have any idea about how to use it,can you please guide me through this?or is there any other way to do the same?any userlevel library reference,which will not make me to do changes in kernel module.I am looking for c references.
> following are the details of my beaglebone

Take a look at, this overlay:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-mBC1-ETH-CLICK.dts

Which add's support for this combination:

BeagleBone +
https://www.mikroe.com/beaglebone-mikrobus-cape +
https://www.mikroe.com/eth-click

So use that to help figure out how your need to wire your module..

Regards,

--
Robert Nelson
https://rcn-ee.com/

tanvi gore

unread,
Mar 26, 2019, 2:27:04 AM3/26/19
to Robert Nelson, Beagle Board
thank you for responding....so as overlay is for pin functioning and ENC28j60 properties definition....what should I do next for actual c coding? as I am looking for any available c library which can help me to build tcp/ip connection.as there is a lot of register initialization using SPI to activate ENC28j's MAC PHY as per datasheet.as well I am totally unaware about how should I implement a TCp socket using this.My ultimate aim is to implement a TC/ip modbus. Please  guide me through this please let me know if I am missing any basic concepts in this I will work on it.  

Thanks & Regards  

Robert Nelson

unread,
Mar 26, 2019, 11:13:40 AM3/26/19
to tanvi gore, Beagle Board
On Tue, Mar 26, 2019 at 1:26 AM tanvi gore <tanvi...@gmail.com> wrote:
>
> thank you for responding....so as overlay is for pin functioning and ENC28j60 properties definition....what should I do next for actual c coding? as I am looking for any available c library which can help me to build tcp/ip connection.as there is a lot of register initialization using SPI to activate ENC28j's MAC PHY as per datasheet.as well I am totally unaware about how should I implement a TCp socket using this.My ultimate aim is to implement a TC/ip modbus. Please guide me through this please let me know if I am missing any basic concepts in this I will work on it.

Sounds like fun, my directions where to "utilize" the already
"pre-built" kernel driver..

But feel free to do what you want..

Good Luck!

Dennis Lee Bieber

unread,
Mar 26, 2019, 2:55:58 PM3/26/19
to beagl...@googlegroups.com
On Tue, 26 Mar 2019 11:56:43 +0530, tanvi gore
<tanvi...@gmail.com> declaimed the
following:

>thank you for responding....so as overlay is for pin functioning and
>ENC28j60 properties definition....what should I do next for actual c
>coding? as I am looking for any available c library which can help me to
>build tcp/ip connection.as there is a lot of register initialization using
>SPI to activate ENC28j's MAC PHY as per datasheet.as well I am totally
>unaware about how should I implement a TCp socket using this.My ultimate
>aim is to implement a TC/ip modbus. Please guide me through this please
>let me know if I am missing any basic concepts in this I will work on it.

Sounds like you want to explore https://en.wikipedia.org/wiki/LwIP (
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.109.1795&rep=rep1&type=pdf
)


--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Reply all
Reply to author
Forward
0 new messages