Can't read KSZ8851 device id

Discussions around product based on ARM Cortex M0+ core.

Moderator: nferre

muhu J
Posts: 1
Joined: Thu Jul 21, 2016 11:07 am

Can't read KSZ8851 device id

Sat Jul 23, 2016 1:48 pm

Right now, I am trying to interface SAM L21J18B with Ethernet xplained pro having KSZ885SNL PHY controller. ASF offered LWIP in their example projects for SAM D21 and KSZ8851SNL. I changed it to SAM L21. What problem I am facing now is that I couldn't read device ID of the KSZ8851.
I can send OP code and address of Chip ID and Enable Register of KSZ8851 to KSZ8851. But I didn't get any reply from that.

This is my code

while (!spi_is_ready_to_read(module)) {
}


static inline bool spi_is_ready_to_read(
struct spi_module *const module)
{
/* Sanity check arguments */
Assert(module);
Assert(module->hw);

SercomSpi *const spi_module = &(module->hw->SPI);

/* Check interrupt flag */
return (spi_module->INTFLAG.reg & SERCOM_SPI_INTFLAG_RXC);
}
When while function calls the below function, it creates infinite loop as RXC not set. RXC will set once recieved buffer filled with data. This is why I suspect SPI read operation.

Pls help me.............

Return to “SAM D20 Cortex-M0+ MCU”

Who is online

Users browsing this forum: No registered users and 1 guest