Hello,
I’m pretty new to WIZNet, and I was hoping someone could help me with an odd problem.
My nSS, sclk, and MOSI Lines all look how I expect them too, but my MISO behaves in the following way: when nSS goes low, MISO will go low and stay low until nSS goes high again. In other words, the WIZNet is not writing anything to MISO, even if I send a read request.
Additionally, after setting up the IP, I am unable to ping the device.
Looking through the posts, it sounded like maybe it was something to do with the Reset Line, but I polled that pin too and confirmed that it drops to 0V before I set it high again. I’ve posted my initialization code. Does anyone see anything wrong? (It’s a bit rough, but the logic should be sound)
[code]
void SPI_COM::WizInit(Uint8 *MacAddress_, Uint8 *IpAddress_, Uint8 *NetMask_, Uint8 *Gateway_){
//Initialize F28335 SPI FIFO
spi_fifo_init();
CLEARA.bit.GPIO21 = 1; // Set it low and hold for at least 2uS
DELAY_US(4);
SETA.bit.GPIO21 = 1; // Set it high and hold for at least 150ms to stabilize PLL
DELAY_US(50000); // such a long time....
DELAY_US(50000);
DELAY_US(60000);
WizWrite(MR8, (Uint8)0x80);
DELAY_US(4);
// Set socket mode?
for (int i=0; i<8; i++){
//0x61 = Multicasting disabled, MAC Filtering enabled, No ACK delay, TCP Mode
// There are 7 sockets available, this loop will set each one of them
WizWrite(SnMode_Reg + i*0x100, (Uint8)0x61);
}
// Set the MAC Address
SetMacAddress(MacAddress_);
DELAY_US(20);
// Set IP Address
SetIpAddress(IpAddress_);
DELAY_US(20);
// Set NetMask
SetNetMask(NetMask_);
DELAY_US(20);
// Set GateWay
SetGateway(Gateway_);
DELAY_US(20);
// Set Port#'s
Uint16 val;
for(int i=0; i<8; i++){
val = 50000 + i;
WizWrite(SnPORT16 + i*0x100, (Uint16*)&val);
}
}[/code]
I’m using the TMS320F28335 chip from TI.
Thank you in advance!