View previous topic :: View next topic |
Author |
Message |
kam
Joined: 15 Jul 2005 Posts: 59
|
Ethernet questions...Futurlec board |
Posted: Sat Aug 30, 2008 10:12 pm |
|
|
Hi all!
Hope you're all well!
Well, I finally got my upgrade of CCS working (don't get me started )
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
|
|
Posted: Sun Aug 31, 2008 1:39 am |
|
|
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
|
|
Posted: Sun Aug 31, 2008 3:46 pm |
|
|
Hi all!
Well, I think I'm making some headway here... ( )
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
|
|
Posted: Sun Aug 31, 2008 11:38 pm |
|
|
Yes, this is the pin-mapping used in the en28j60.c driver. |
|
|
kam
Joined: 15 Jul 2005 Posts: 59
|
|
Posted: Mon Sep 01, 2008 3:39 pm |
|
|
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...
Any thoughts anyone?
~Kam (^8* |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Irma Guest
|
|
Posted: Tue Sep 02, 2008 7:02 am |
|
|
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. |
|
|
|