CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ENC28J60
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lejma
Guest







ENC28J60
PostPosted: Sun Nov 15, 2009 4:03 am     Reply with quote

Hi. I've got problem with using ENC28J60. The problem is.. I don't have a idea how to use ENC28J60 driver included in CCS.

And what's more the register addresses are different in this driver and in datasheet.

In datasheet control registers are in 4 groups and every group is from 0x00 to 0x1F... in driver we have one group from 0x00 to some 0x75 (or higher value - don't remember).

For example ECOCON register is (in datasheet) in address 0x17 in group 4. In driver ECOCON is in address 0x75.

How this works?
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Nov 15, 2009 11:22 am     Reply with quote

Get the TCP/IP source from CCS. (you have to request it).
The ENC28j60 code for that works as I've been able to use it.

I did a quick compare and yes, they are very different.


-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 15, 2009 3:59 pm     Reply with quote

Quote:

For example ECOCON register is (in datasheet) in address 0x17 in
group 4. In driver ECOCON is in address 0x75. How this works?

That's because CCS combines the bank address with the register address
into one byte (0x75). It's easier for them to do it that way.

Look at this routine in the ENC24J60.c driver file:
Quote:
enc_mac_control_reg_address()

The code tests bits 5 and 6 (which are the bank address) and writes
them to the ECON1 register. It then masks down the address so it
only contains bits 0-4, which is the ECOCON register address (0x1F).
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Nov 15, 2009 4:16 pm     Reply with quote

Yea, I thought they might be doing something like that but didn't have time to dig so deep.

I did a quick compare.

I suppose if you're playing with the 28J60, you probably (although not necessarily) was TCPIP... so why not just get the whole stack.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
lejma
Guest







PostPosted: Mon Nov 16, 2009 3:37 am     Reply with quote

i need to make UDP transmission : )
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Nov 16, 2009 3:55 am     Reply with quote

Yes, UDP is also supported by the CCS stack. Smile
lejma
Guest







PostPosted: Mon Nov 16, 2009 4:32 am     Reply with quote

Ok. So... I need to transmit few 'integer' values in one UDP packet from PIC to PC.

Can anyone tell me what I need to 'include' and how to us it (if there is any 'already maked' driver).

For example in pic I've got :
a=10
b=30
c=20

and I need to transmit this values to PC.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Nov 16, 2009 1:07 pm     Reply with quote

Ok. Before I dive into a long lengthy discussion, I need to know first how familiar you are with Ethernet and TCPIP.

How much information do you have already towards the making of this project?

This will help me gauge how much rambling I need to do.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Guest








PostPosted: Tue Nov 17, 2009 5:27 am     Reply with quote

I'm familiar only with basic using of SPI...
and now I'm in the middle of reading ENC28J60 datasheet.
Suggestions ? :]
lejma
Guest







PostPosted: Tue Nov 17, 2009 5:55 am     Reply with quote

I know only that ENC28J60 is communicating with PIC via SPI.
I know that I need to make a packet from variables I want to transmit
and on PC I need to make variables from packet.

But I don't know how to configure IP /netmask .. etc. for ENC28J60
and how to make and send this packet in to LAN as UDP packet.
lejma
Guest







PostPosted: Tue Nov 17, 2009 11:26 am     Reply with quote

Can anybody hlp me ? ;/
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Nov 17, 2009 12:07 pm     Reply with quote

Ok, so you need to get a book on the OSI protocol stack model.

I can get you some ISBN book numbers if you wish.

You need to ask this: Do you need UDP over IP or can plain ethernet work ok for you?

Ethernet takes away the extra layer of IP if you don't need it.

There is a nice UDP/IP example included with the CCS TCP/IP Stack. You should probably still request that.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Guest








PostPosted: Sun Dec 06, 2009 5:21 am     Reply with quote

I need to transmit a char string[16] over the ethernet from PIC to PC by using this damn ENC and I still don't know how to do it. :((

Any help will be nice.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Dec 06, 2009 12:36 pm     Reply with quote

Anonymous wrote:
I need to transmit a char string[16] over the ethernet from PIC to PC by using this damn ENC and I still don't know how to do it. :((

Any help will be nice.


Well, did you ask CCS for their TCP/IP stack?

What knowledge do you have so far? At what point are you stuck?


You've described nothing of your current environment (least the mandatory PIC Compiler version and PIC)

We can't help you with just an "I'm stuck".

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE
PostPosted: Mon Dec 07, 2009 10:54 pm     Reply with quote

Just curious ...why ethernet ?? why not RS 232 ??
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group