RUKAEF
Newbie level 2
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.
Wireshark packet capture image attached below.
However transmist buffer is correct.
How this happen?
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.
However transmist buffer is correct.
How this happen?
Can anyone help me?