Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ENC28J60 ARP request problem

Status
Not open for further replies.

RUKAEF

Newbie level 2
Joined
Nov 15, 2019
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
This time I'm working with ENC28J60. I tried to obtain IP address using ARP request. Controller transmit packet correctly instead every 8th byte incrimented by one! What is the problem? Can anyone help me.

Code:
void sendPacket1(uint8_t length){
    setReg8(ECON1, ECON1_TXRST);
    clrReg8(ECON1, ECON1_TXRST);

    writeReg16(EWRPT, TXSTART_INIT);
    writeReg16(ETXND, TXSTART_INIT+length);

    setReg8(ECON1, ECON1_TXRTS);
}


void writeBuffer1(void){
    uint8_t arprequest[62] = {ENC28J60_WRITE_BUF_MEM, 0x00, 
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,  
    Ethaddr0 ,Ethaddr1 ,Ethaddr2 ,Ethaddr3 ,Ethaddr4 ,Ethaddr5,  
    0x08,0x06,0x00,0x01, 
    0x08,0x00,0x06,0x04,0x00,0x01,  
    Ethaddr0 ,Ethaddr1 ,Ethaddr2 ,Ethaddr3 ,Ethaddr4 ,Ethaddr5,  
    0xC0,0xA8,0x01,0x35, 
    0x00,0x00,0x00,0x00,0x00,0x00,  
    0xC0,0xA8,0x01,0x01,   
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};


    HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
    HAL_SPI_Transmit(&hspi2, arprequest, 62, HAL_MAX_DELAY);
    HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET);
}


Wireshark packet capture image attached below.
Capture.PNG

However transmist buffer is correct.
Capture2.PNG

How this happen?
Can anyone help me?
 

what happens when you send target mac with broadcast address?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top