Pages: [1]   Go Down
Author Topic: Problems with Arduino DUE and ENC28J60.  (Read 3083 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hi people

 smiley

First to say sorry about my English.

I need some help, I want to begin using Arduino, I was working with Microchip, but I need more speed and I/O Ports, so I just bougth an Arduino DUE. CortexM3 ARM based board.

The question is that I have a few Enc28j60 Modules and I wish to use it with my new Arduino due, So I was searching in the web And I can´t find any working example.

I just tried with a few examples but having problems.

Please help me, I don´t want to go back to Microchip.

A big hug from Colombia.

Luis.
Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 44
Posts: 2452
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Poke through https://github.com/jcw/ethercard

The library includes examples.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Many thanks,


I already was tried these one,but when I try to compile examples I have problems with AVR files, then when I try to show to the compiler, where de files are,

It shows another kind of error.


 smiley-cry smiley-cry
Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 44
Posts: 2452
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to tell us what the error is.
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Basically only official sketches that runs over Arduino UNO can run directly (or with few effort) on Arduino DUE, this because the Arduino core (the libraries) was migrated for the ARM CPU used in the DUE. Every other Arduino sketch won't run without a porting.

Some non-official Arduino sketches that runs UNO may run also on DUE, it depends if they are based on custom libraries or if are based only on the Arduino core, in the latter case it should run. The EtherCard library has an its own SPI driver (doesn't use the Arduino ones) and this is creating your problems.

I've never been in detail with ARM, so I don't know if there are others to be considered. As minimum you need to review all pins assignment and all direct access to register and interrupts, it should be not so hard, because the library doesn't use a lot of those.

I can try to help if you want.

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Thanks Dario.

You are so nice trying to explain the problem.

And exactly if I try to compile the code built in Arduino examples, it compiles well, but when I change to my Arduino DUE. it crash.

I have downloaded a lot of examples (there are many of them), but I can´t find any for the DUE.

If you want to help me, I really would appreciate it.

So, what is the next step?

Best regards.

Luis.

P.D: Spanish is my language, so my apologies.
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

English isn't mine smiley

First step is to have a look to the official SPI drivers and port your code using that drivers instead of the one included in Ethercard (or any other that you are using), then look if you have still compilation errors and move forward.

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 138
Posts: 5833
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This will probably cause problems with SPI devices connected to a Due.
http://arduino.cc/en/Reference/SPITransfer
The Due needs an additional parameter to continue sending additional bytes over the SPI. Otherwise, it deactivates the SPI slave select after each call to SPI.transfer().
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hello.

Sorry I was working and I have not time to test your teory.

I think this weekend I will.

Thanks a lot.


Luis.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 smiley-eek

Ok I can´t wait,

I go to this page, http://tecnotinker.blogspot.com/2012/07/uso-del-modulo-ethernet-enc28j60-con.html , he says it works with Arduino UNO, I try to compile it with my Arduino DUE, and again error.

The next image shows that the picture are like´s an attachment.


Thanks a lot.

Luis.



* error.png (54.62 KB, 501x607 - viewed 127 times.)
Logged

Offline Offline
Full Member
***
Karma: 10
Posts: 170
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

just got ENC28J60 running with Arduino DUE with UIPEthernet-library.
Not release or merged in branch master yet, code resides in branch 'due'. (You can download complete branch as zip-file).
To install first unzip, then add the library by going to 'sketch'->'import library'->'add library', then navigate to the directory you have unzipped the library to and select directory 'UIPEthernet', then click 'open'. Afterwards you will find new examples (AdvancedChatServer, EchoServer, TcpClient, TcpServer, UdpClient and UdpServer) for UIPEthernet in 'file'->'examples'->'UIPEthernet'

I use Arduino 1.5.5, the ENC28J60 is connected to SPI on ICSP-header, CS is connected to pin 10.

Examples from UIPEthernet run without modifications, WebServer-example from Ethernet-lib runs by replacing include 'Ethernet.h' by 'UIPEthernet.h' (not removing the SPI.h, as this is required on DUE).

Have fun!

- Norbert

« Last Edit: January 09, 2014, 12:55:25 pm by ntruchsess » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Norbert

First I wish to thank you for your library.

I'm trying to use it with Arduino DUE, but I have a problem:
I only can make it work if I connect the ENC28j60 CS to pin 52 , but I wish to use pin 10 for CS.

To make it work on pin 52 I also have to change line 30 in Enc28J60Network.h from #define ENC28J60_CONTROL_CS   SS
to #define ENC28J60_CONTROL_CS  52. In this line I have tried change 52 to 10, but if I do that it stops working.

What I'm doing wrong, or for now it only works on a DUE with CS connected to pin 52?

I have connect ENC28j60 on Arduino Due SPI header.

Thanks
Logged

Pages: [1]   Go Up
Jump to: