所以我用“MCC”配置了TCP IP Lite堆栈,但是它不能正常工作。在MiHoCHIGH代码配置器中,我不能在THE TCP/IP配置中选择一个SPI总线(它是一个bug),所以我必须单独配置SPI。在软件中,我必须注释芯片选择引脚的高和低设置(“EthnNCSLH(),EthnnCSLUW())),否则PIC在SPI LO中出现。因此,硬件处理芯片选择。根据我的PIC数据表,我可以用软件控制芯片选择,但它不工作。UTI88T SPI1Exchange 8BIT(UIT88T数据){/1字节传输计数SPI1TCNTL=1;SPI1TXBB=数据;([lt;字体],同时(PrI2BITS,SPI1RXIF==SPILRXYNIN进程)[≪字体] {[& lt;字体] }返回(SPI1RXB);} Wi这个改变栈可以通过SPI与EnC通信并初始化它。现在如果我ping以太网控制器,它将识别有一个传入的消息,但是“Health.ID.Type”是空的,所以控制器不知道它是什么类型的包,并且在交换盒上运行。TeWorkRead(VULL){CeTeNETFrimeStudioHead;char Debug GSTR(80);IF(EthyPosiTeClad()){EthnNeXPositUpDeDebug();EthyRead Bug((char *)和;页眉,SigeOf(页眉));Heal.ID.Type = ntoHS([lt;字体]页眉.ID.Type);//反向类型字段NETWorksSavestAtPARTIONTHORE();[Lt.Ford]开关(Health.ID.Type){CaseEthyType VLAN:Debug;ActhyType ARP:ARPV44PACKET();断案;EthyType IPv4:IPv4xPoCuTE();断言;EthyType IPv6:中断;默认:中断;} EthfFulHuffe(;)},我们还提供了1S刻度的Time2(在代码中更改)。因此TCP/IP Lite堆栈不完全支持。我的控制器和我必须改变代码中的东西…?PS:我使用这个HTTPS://Realth.DigiLel./PMOD/PMODIC100/启动
以上来自于百度翻译
以下为原文
So i configured the TCP IP Lite Stack with the "MCC" but it does not work properly. In the Michochip Code Configurator I can not choose a SPI Bus in trhe TCP/IP configuration (its a bug) so i have to configure the SPI separately.
In Software I have to comment out the High and low setting of the Chip select pin ("ETH_NCS_HIGH(), ETH_NCS_LOW()") otherwise the Pic stucks in the SPI loop. So the hardware handles the chip select. According to the datasheet of my PIC I could control the chip select by software but it doesn't work.
uint8_t SPI1_Exchange8bit(uint8_t data)
{
//One byte transfer count
SPI1TCNTL = 1;
SPI1TXB = data;
[
[
[
return (SPI1RXB);
}
With this change the The stack can communicate with the ENC via SPI and initialize it.
Now if i ping the ethernet controller it will recognize that there is an incoming message but "header.id.type" is empty, so the controller does not know what type of packet it is and runs over the switch case.
void Network_Read(void)
{
ethernetFrame_t header;
char debug_str[80];
if(ETH_packetReady())
{
ETH_NextPacketUpdate();
ETH_ReadBlock((char *)&header, sizeof(header));
header.id.type = ntohs([
Network_SaveStartPosition();
[
{
case ETHERTYPE_VLAN:
break;
case ETHERTYPE_ARP:
ARPV4_Packet();
break;
case ETHERTYPE_IPV4:
IPV4_Packet();
break;
case ETHERTYPE_IPV6:
break;
default:
break;
}
ETH_Flush();
}
}
I also us the Timer2 for the 1s tick (changed it in code).
So the TCP/IP Lite Stack is not supported fully by my controller and i have to change something in the code...?
PS: i use this one
https://reference.digilen.../pmod/pmodnic100/start