Datasheet
- SPI_Ethernet_renewDHCP
- SPI_Ethernet_sendUDP
- SPI_Ethernet_sendUDP2
- SPI_Ethernet_setBitReg
- SPI_Ethernet_setRxReadAddress
- SPI_Ethernet_TXpacket
- SPI_Ethernet_writeAddr
- SPI_Ethernet_writeMem
- SPI_Ethernet_writeMemory
- SPI_Ethernet_writeMemory2
- SPI_Ethernet_writePHY
- SPI_Ethernet_writeReg
SPI_Ethernet_Init
434
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void SPI_Ethernet_Init(unsigned char *mac, unsigned char *ip,
unsigned char fullDuplex);
Returns Nothing.
Description
This is MAC module routine. It initializes ENC28J60 controller. This function is
internaly splited into 2 parts to help linker when coming short of memory.
ENC28J60 controller settings (parameters not mentioned here are set to
default):
- receive buffer start address : 0x0000.
- receive buffer end address : 0x19AD.
- transmit buffer start address: 0x19AE.
- transmit buffer end address : 0x1FFF.
- RAM buffer read/write pointers in auto-increment mode.
- receive filters set to default: CRC + MAC Unicast + MAC Broadcast in OR mode.
- flow control with TX and RX pause frames in full duplex mode.
- frames are padded to 60 bytes + CRC.
- maximum packet size is set to
1518.
- Back-to-Back Inter-Packet Gap: 0x15 in full duplex mode; 0x12 in half duplex mode.
- Non-Back-to-Back Inter-Packet Gap: 0x0012 in full duplex mode; 0x0C12 in
half duplex mode.
- Collision window is set to 63 in half duplex mode to accomodate some
ENC28J60 revisions silicon bugs.
- CLKOUT output is disabled to reduce EMI generation.
- half duplex loopback disabled.
- LED configuration: default (LEDA-link status, LEDB-link activity).
Parameters:
-
mac: RAM buffer containing valid MAC address.
- ip: RAM buffer containing valid IP address.
- fullDuplex: ethernet duplex mode switch. Valid values: 0 (half duplex mode)
and 1 (full duplex mode).