miky_boy
Joined: 11 Jan 2008 Posts: 8
|
Pic18f4520+Enc28J60 |
Posted: Sat Feb 02, 2008 3:54 pm |
|
|
Hi my friends.
In my project i have to create comunication between the Pic and a Desktop PC, using ethernet protocol.
To implements this protocol i use the Pic18F4520 and the Enc28J60 that using SPI protocol.
I make all connections that i see in datasheets, but now i try to make the code
So i have this;
#include <18F4520.h>
#device ICD=TRUE
#device ADC=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8)
#use spi(SPI1, MASTER, BAUD=1000000, BITS=16)
#define ENC_MAC_USE_SPI TRUE
#include <enc28j60.c>
void main (void)
{
setup_spi(SPI_MASTER|SPI_L_TO_H|SPI_CLK_DIV_4);
do
{
mac_spi_init();
mac_reg_init();
}
while (TRUE);
}
But now what i have to do??
How i define the IP address, the Gateway??
How i know if the SPI work's fine?!?!
Very thank's and strong regards to all. |
|