User manual
504
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Returns Nothing.
Requires Global variables:
- SPI_Ethernet_24j600_CS: Chip Select line
- SPI_Ethernet_24j600_CS_Direction: Direction of the Chip Select pin
- SPI_Ethernet_24j600_RST: Reset line
- SPI_Ethernet_24j600_RST_Direction: Direction of the Reset pin
must be dened before using this function.
The SPI module needs to be initialized. See the SPIx_Init and SPIx_Init_Advanced routines.
Example
‘ mE ehternet NIC pinout
dim SPI_Ethernet_24j600_CS as sbit at LATF1_bit
dim SPI_Ethernet_24j600_CS_Direction as sbit at TRISF1_bit
‘ end mE ehternet NIC pinout
myMacAddr as byte[6] ‘ my MAC address
myIpAddr as byte[4] ‘ my IP addr
...
myMacAddr[0] = 0x00
myMacAddr[1] = 0x14
myMacAddr[2] = 0xA5
myMacAddr[3] = 0x76
myMacAddr[4] = 0x19
myMacAddr[5] = 0x3F
myIpAddr[0] = 192
myIpAddr[1] = 168
myIpAddr[2] = 20
myIpAddr[3] = 60
SPI1_Init()
SPI_Ethernet_24j600_Init(myMacAddr, myIpAddr, SPI_Ethernet_24j600_MANUAL_
NEGOTIATION and SPI_Ethernet_24j600_FULLDUPLEX and SPI_Ethernet_24j600_
SPD100)
Notes None.