Pic16f887+enc28j60 using mikroc

Status
Not open for further replies.
You really need to stop saying that "nothing works" and tell what actually goes wrong.
Tell us what you expect to happen and what really does happen instead.
People have already said that what you are trying to do can work, so you know it is possible. Therefore whatever is going wrong is at your end and you have to tell us what that is - we can't guess!
By not telling us, all you are doing is making this take much longer than necessary and you may soon find that people will stop trying to help you.
Susan
 
ok, what I expected is start the mini server by using ENC28j60. please just attach me the code and the simulation already work so that easy for me to find out instead of let me try this or try that. I am sorry.
 

I did not use simulation, but I know about the real world.

In real world you should try using "ping <IP_OF_PIC_MODULE>" from windows console to determine whether it's responding or not.
Did you try that?
 

Hellow Everyone! I have a somethig like that. The thing is that, I am trying ping test between pc and pic. I am using 18f458, enc28j60-h from olimex and mikroc compilers. I am trying simulate on proteus but doesn't works, even the proteus examples, so I tested the circuit on the protoboard and I can't do it work. This is the code:


#include "__EthEnc28j60.h"
#include "__EthEnc28j60private.h"

// duplex config flags
#define Spi_Ethernet_HALFDUPLEX 0x00 // half duplex
#define Spi_Ethernet_FULLDUPLEX 0x01 // full duplex

// mE ehternet NIC pinout
sfr sbit SPI_Ethernet_Rst at LATC0_bit; // for writing to output pin always use latch (PIC18 family)
sfr sbit SPI_Ethernet_CS at LATC1_bit; // for writing to output pin always use latch (PIC18 family)
sfr sbit SPI_Ethernet_Rst_Direction at TRISC0_bit;
sfr sbit SPI_Ethernet_CS_Direction at TRISC1_bit;
// end ethernet NIC definitions


// network parameters
unsigned char myMacAddr[6] = {0x4D, 0x14, 0xA5, 0x76, 0x19, 0x3f} ; // my MAC address
unsigned char myIpAddr[4] = {192, 168, 10, 60} ; // my IP address
unsigned char myMaskAddr[4] = {255,255,255,0};

//#define putConstString SPI_Ethernet_putConstString

//#define putString SPI_Ethernet_putString


unsigned int SPI_Ethernet_UserTCP(unsigned char *remoteHost, unsigned int remotePort, unsigned int localPort, unsigned int reqLength, TEthPktFlags *flags)
{
return 0;
}

unsigned int SPI_Ethernet_UserUDP(unsigned char *remoteHost, unsigned int remotePort, unsigned int destPort, unsigned int reqLength, TEthPktFlags *flags)
{
return 0; // back to the library with the length of the UDP reply
}
void main()
{
TRISD.F0=0;
TRISD.F1=0;
adcon0=0;
adcon1=15;
cmcon=0x07;

portd=0;


// starts ENC28J60 with: reset bit on PORTC.F0, CS bit on PORTC.F1,
// my MAC & IP address, full duplex
SPI1_Init();
SPI_Ethernet_Init(myMacAddr, myIpAddr, Spi_Ethernet_FULLDUPLEX);

while(1) { // do forever
SPI_Ethernet_doPacket(); // process incoming Ethernet packets
if (portd.f0==1)
portd.f0=0;
else
portd.f0=1;
delay_ms(100);
portd.f1=1;
}
}
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…