Jump to content
43oh

Recommended Posts

  • Replies 107
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi, After a couple of hours of work porting the enc26j80 driver from my own mini ipv6 stack to uip, I have my enc28j60 booster pack working with the Stellaris Launchpad. The current example code i

Ok, this took a bit longer than I had anticipated, and there is a lot of room for improvements. I extended the example as suggested by BlueHash to be able to read and toggle the GPIO-pins via a web-b

hi,  i tried enc module but froze on "wainting for ip" Welcome ENC_ESTAT: 1 Econ: 0 Silicon Revision: 6

Posted Images

Would your code also work with this commercially available ethernet-board?

 

I'm looking forward to play with the stellaris on the network :)

 

(thinking of having it parse a json object and act upon it's content)

 

Any enc28j60 breakout board will work. They are available quite cheaply many places. As long as you don't need high throughput the enc28j60 chip seems like a good and cheap solution to me.

Link to post
Share on other sites

I have put my lwip code up on github now:

https://github.com/xpgdk/stellaris-enc28j60-booster/tree/lwip

 

It is still somewhat messy, but it now uses DHCP to configure the IP-address. I am working on cleaning up the code and getting rid of the TI's startup_gcc.c and linker files.

I will split the enc28j60 driver split up into a lower-level part and an lwIP / uIP layer, such that it is easier to improve on the driver itself without having the rest of the stack involved. But it probably will take a while before I get time for it :-)

Link to post
Share on other sites

I have put my lwip code up on github now:

https://github.com/x...oster/tree/lwip

 

It is still somewhat messy, but it now uses DHCP to configure the IP-address. I am working on cleaning up the code and getting rid of the TI's startup_gcc.c and linker files.

I will split the enc28j60 driver split up into a lower-level part and an lwIP / uIP layer, such that it is easier to improve on the driver itself without having the rest of the stack involved. But it probably will take a while before I get time for it :-)

 

 

Thank you xpg! I will try it out

Link to post
Share on other sites

I tried compiling your code in CCS, but I have a feeling my skill level is just not up to the task yet.

 

I assume you did not include lwip in the git src link you posted? I tried downloading lwip 1.4 from the net and putting it in the lwip subdirectory, only to have now spent an hour trying to resolve include errors.

Link to post
Share on other sites

I tried compiling your code in CCS, but I have a feeling my skill level is just not up to the task yet.

 

I haven't tried using CCS yet. Got a bit annoyed with its old C standard last time I played with it.

 

I assume you did not include lwip in the git src link you posted? I tried downloading lwip 1.4 from the net and putting it in the lwip subdirectory, only to have now spent an hour trying to resolve include errors.

 

Oh, I ought to have mentioned that. Rather than copying the lwip things around, I am using the git submodule feature. Once you have checked out the lwip branch, do a 'git submodule init', following by 'git submodule update' and lwIP should be checked out for you.

 

Sorry for the confusion.

Link to post
Share on other sites

What development environment do you use? eclipse on linux with gcc or some other combination? Does your setup allow in-circuit step level debugging?

 

I am using Make, gcc, and gdb with OpenOCD. It allows debugging, but is of course not as easy as Eclipse.

Link to post
Share on other sites

I've been poking around with this for the last couple of hours, trying to get it to work. I've been getting stuck on 'ENC_ESTAT: 0' for a while, until it will (somewhat randomly) jump to ff and proceed to trying to grab a DHCP address. I managed to snug the latest GIT repo into CCS and have been using that to compile it/transfer it to the board. This is my ENC28j60 board, connected with the correct connections from the previous page. Any thoughts?

Link to post
Share on other sites

I've been poking around with this for the last couple of hours, trying to get it to work. I've been getting stuck on 'ENC_ESTAT: 0' for a while, until it will (somewhat randomly) jump to ff and proceed to trying to grab a DHCP address. I managed to snug the latest GIT repo into CCS and have been using that to compile it/transfer it to the board. This is my ENC28j60 board, connected with the correct connections from the previous page. Any thoughts?

 

The reason we are waiting in a loop for ESTAT to change is that bit 0 of ESTAT is 1 when the oscillator of the ENC28j60 has stabilized. I would expect it to jump to 1. FF to me seems like the register is not being read properly for some reason. What does it print after "Silicon Revision"? If it is 00 or FF I'm guessing that there is something wrong with the SPI communication. Have you tried exchanging SI and SO?

Link to post
Share on other sites

The reason we are waiting in a loop for ESTAT to change is that bit 0 of ESTAT is 1 when the oscillator of the ENC28j60 has stabilized. I would expect it to jump to 1. FF to me seems like the register is not being read properly for some reason. What does it print after "Silicon Revision"? If it is 00 or FF I'm guessing that there is something wrong with the SPI communication. Have you tried exchanging SI and SO?

 

It worked! Now reporting Silicon Revision 6.

 

It seems to be getting hung at the DHCP request now. Watching in WireShark I can see the DHCP request going through and the router responding with an address, but the Stellaris doesn't appear to acknowledge. Going to try a static IP.

 

Edit: Static IP working, however it seems to lock up when sending the '/read' segment:

 

....
New data
Got get request
Path: '/read'
200021c4: Request type: 1
200021c4: Sending data (0)
Poll
200021c4: Request type: 1
200021c4: Sending data (1)
pin 0: 0
pin 1:

 

It'll hang there until I do a hard reset. I'm adding in some more debug statements to dig this one out.

Link to post
Share on other sites

It worked! Now reporting Silicon Revision 6.

 

Good to hear.

 

It seems to be getting hung at the DHCP request now. Watching in WireShark I can see the DHCP request going through and the router responding with an address, but the Stellaris doesn't appear to acknowledge. Going to try a static IP.

 

Edit: Static IP working, however it seems to lock up when sending the '/read' segment:

...

It'll hang there until I do a hard reset. I'm adding in some more debug statements to dig this one out.

 

Hmm.. strange. While I am aware that the code is not particular stable, but it should be a bit better than that.

If you need any help let me know.

Link to post
Share on other sites
  • 3 weeks later...

Ok, I've been playing a bit tonight to get this code to work (latest git commit).

Used this pinout with a standard ENC28J60 module. (+ power and ground of course)

CS - B5 (J1.02)
INT - E4 (J1.05)
SCK - B4 (J1.07)
SI - B6 (J2.07) - (or D0 - J3.03)
SO - B7 (J2.06) - (or D1 - J3.04)
RST - RESET (J2.05

However, I don't get anything on the uart. None of the welcome messages or anything. I guess the module isn't initializing?

I tried the alternative MOSI and MISO pinout as well.

 

Did the stellarisware uart example and that works fine.

 

[edit]

Ok, not sure what happened, but now at least I get past the welcome message!

However, I only get ENC_ESTAT: 0 for a long time. Occasionally with value fa, then it just ends with:

ENC_ESTAT: ff
Econ: ff
Silicon Revision: 255
int enabled

And it gets stuck at: Waiting for IP address...

Link to post
Share on other sites

Aha!

 

The pinout on this pcb had mosi and miso the wrong way around \o/

 

So, it works perfectly! thnx for this example.

Will now see if I can let the stellaris parse some json :)

Good to hear. Sorry that I didn't respond to your last post, seemed to have missed it.

 

Hmm.. JSMN looks sweet. I actually ended up doing my own little JSON parser last week on the Stellaris. It was fun, but the JSMN approach is much much nicer :-). I'll have to try it

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...