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 support@ccsinfo.com

Ethernet questions...Futurlec board

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kam



Joined: 15 Jul 2005
Posts: 59

View user's profile Send private message

Ethernet questions...Futurlec board
PostPosted: Sat Aug 30, 2008 10:12 pm     Reply with quote

Hi all!

Hope you're all well!

Well, I finally got my upgrade of CCS working (don't get me started Sad )

I have the Furterlec Ethernet Mini Board http://www.futurlec.com/Mini_Ethernet.shtml connected to my pic18f4520 (waiting for the 18f4620 to arrive), and got some generic questions...

#1. Can I use the pic18f4520 just to get started while waiting for the new pics? (ie. am I wasting my time)...I have it running @ 40mhz

#2. I'm looking at the CCS examples (7a for example) just trying to get something...I've wired up the board. On the board there are 2 CLK lines, SCK and CKL0...which one?

#3. On the Futurlec, the lines CS, int, rst and wol have "lines" above their names (inverted, yes?)...do I need to do anything special here?

It just hangs on the MACInit.

Thoughts?

~Kam (^8*
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Aug 31, 2008 1:39 am     Reply with quote

As far as I understand the TCP 7a example (I don't have a respective hardware to check), it should work with a 4520 as well, it's only consuming a small part of available ROM and RAM. May be different with more complex TCP examples, particularly regarding RAM usage.

I don't have a schematic of the futurlec board, but it shouldn't need a different clock connection than the SPI SCK. The 25 MHz crystal is on-board, obviously.

EN28J60 SPI is similar to other SPI peripherals, using an inverted chip select. In addition to SPI connection, nINT an nRES are apparently provided. You should consult the respective EN28J60 CCS development kit documentation, to understand the expected wiring.
kam



Joined: 15 Jul 2005
Posts: 59

View user's profile Send private message

PostPosted: Sun Aug 31, 2008 3:46 pm     Reply with quote

Hi all!

Well, I think I'm making some headway here... ( Question )

In regards to the wiring, after spending some time scanning the CCS provide tcpip code, it looks like this is the wiring

Code:

//      #define PIN_ENC_MAC_SO  PIN_C4 
//      #define PIN_ENC_MAC_SI  PIN_C5   
//      #define PIN_ENC_MAC_CLK PIN_C3
//      #define PIN_ENC_MAC_CS  PIN_D1
//      #define PIN_ENC_MAC_RST PIN_D0
//      #define PIN_ENC_MAC_INT PIN_B0
//      #define PIN_ENC_MAC_WOL PIN_B1


Does this look/sound correct? I still need to download wireshark and scan the wire.

Thanks!

~Kam (^8*
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Aug 31, 2008 11:38 pm     Reply with quote

Yes, this is the pin-mapping used in the en28j60.c driver.
kam



Joined: 15 Jul 2005
Posts: 59

View user's profile Send private message

PostPosted: Mon Sep 01, 2008 3:39 pm     Reply with quote

FvM,

Thanks for the verification.

So I wired it all up, and am just trying to do a MACInit...it still just hangs.

I've traced it to the MACInit() method in the enc28j60.c file where it wait for the clkrdy pin to be set.

Code:

do
   {
      i = ReadETHReg(ESTAT).Val;
   } while((i & 0x08) || (~i & ESTAT_CLKRDY));


"i"is always "0",so it just waits... Sad

Any thoughts anyone?

~Kam (^8*
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 01, 2008 3:47 pm     Reply with quote

It's a Microchip product, so it would be a good idea to search their forum.
Go to their search page,
http://forum.microchip.com/search.aspx
and search for:
Quote:
MacInit

There are many hits. Here's one of them that suggests a solution:
http://forum.microchip.com/tm.aspx?m=328154
Irma
Guest







PostPosted: Tue Sep 02, 2008 7:02 am     Reply with quote

I saw the exact same thing while testing with a 18F25J10. After I scoped the SPI lines I realized nothing was happening on the SPI bus. In my versions of the files, I tracked it all down to PIC18.h being included. I forget where exactly in that maze of header files, but simply commenting out that include statement brought the SPI back online.

I'm guessing several of the pin addresses were conflicting with those from my 18F25J10.h file?? Either way, that at least got SPI up and running so I could talk to the ENC chip. The Microchip forums then offered loads of help on this specific problem. If you have a scope, check to see if your SPI bus is doing anything at all first, then the MCHP forums have the rest of the solution.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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