How to get predefined MAC from ENC624J600

General discussion on mikroBasic PRO for AVR.
Post Reply
Author
Message
marcm4711
Posts: 13
Joined: 06 May 2010 13:23

How to get predefined MAC from ENC624J600

#1 Post by marcm4711 » 25 May 2011 09:38

Hello,

how can i read out the predifined MAC inside the ENC624J600 from Ethernet Board 2.

Marc

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: How to get predefined MAC from ENC624J600

#2 Post by filip » 26 May 2011 10:31

Hi,

You can do something like this (this is written in C, but the logic behind it can be easily implemented in Basic) :

Code: Select all

void ReadMAC(){
SPI_Ethernet_24j600_CS_Direction = 0;
SPI_Ethernet_24j600_CS = 0;
SPI1_Write(0xCA); // system reset , preprogrammed MAC address is available after the system reset
Delay_1sec();

SPI1_Write(0xC6); //Select Bank 3

// read MAC registers
myMacAddr[0] = SPI_Ethernet_24j600_readReg(MAADR1L);
myMacAddr[1] = SPI_Ethernet_24j600_readReg(MAADR1H);
myMacAddr[2] = SPI_Ethernet_24j600_readReg(MAADR2L);
myMacAddr[3] = SPI_Ethernet_24j600_readReg(MAADR2H);
myMacAddr[4] = SPI_Ethernet_24j600_readReg(MAADR3L);
myMacAddr[5] = SPI_Ethernet_24j600_readReg(MAADR3H);
}

SPI1_Init();
ReadMAC();
SPI_Ethernet_24j600_Init(myMacAddr, myIpAddr, SPI_Ethernet_24j600_AUTO_NEGOTIATION) ;
Regards,
Filip.

marcm4711
Posts: 13
Joined: 06 May 2010 13:23

Re: How to get predefined MAC from ENC624J600

#3 Post by marcm4711 » 26 May 2011 11:49

Hello Filip,

thanks for the code - That's exactly what I looking for.

But the Problem is that the current ENC624J600 library version of MikroBasicPro has no support for the 24j600_readReg function.

@MikroE Team: when will the new version of the ENC624J600 library version of MikroBasicPro released? With the final release of the MikroBasicPro 4.8 compiler?

In library manager (only there, not in the help) of the current beta version i can see the new features already.


Regards,

Marc

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: How to get predefined MAC from ENC624J600

#4 Post by filip » 26 May 2011 14:29

Hi,

You can find this routine declaration and it's description in the following folder of the compiler :
Uses\GT64KW\__EthEnc24j600Private.mpas

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for AVR General”