From: Mark on
Hi

I'm implementing software GPIO based SMI protocol for a small embedded
microcontroller, and got stuck with turnaround bits. As I understand it,
after reading 802.3 spec, it consists of two bits, and only the first bit
depends on operation - read or write. For write it's always '1', but I can't
understand how it is asserted for reading.

And seconf half of my question: I use two gpio pins, one for MDC and the
other for MDIO. To set turnaround bits, do I have to drive only MDIO? As far
as I understand the standard, MDC is not affected, isn't it ?

Thanks.

--
Mark

From: salimbaba on
>Hi
>
>I'm implementing software GPIO based SMI protocol for a small embedded
>microcontroller, and got stuck with turnaround bits. As I understand it,
>after reading 802.3 spec, it consists of two bits, and only the first bit

>depends on operation - read or write. For write it's always '1', but I
can't
>understand how it is asserted for reading.
>
>And seconf half of my question: I use two gpio pins, one for MDC and the
>other for MDIO. To set turnaround bits, do I have to drive only MDIO? As
far
>as I understand the standard, MDC is not affected, isn't it ?
>
>Thanks.
>
>--
>Mark
>
>
for reading as soon as you have sent the register address bits, you set the
MDIO pin to high impedance i.e. z .
yes, MDC is not affected by whatever you do with MDIO since MDC is only a
clock signal. MDIO runs in sync with MDC .

---------------------------------------
Posted through http://www.EmbeddedRelated.com
From: Mark on
salimbaba wrote:
>> I'm implementing software GPIO based SMI protocol for a small
>> embedded microcontroller, and got stuck with turnaround bits. As I
>> understand it, after reading 802.3 spec, it consists of two bits,
>> and only the first bit depends on operation - read or write. For
>> write it's always '1', but I can't understand how it is asserted for
>> reading.
>>
>> And seconf half of my question: I use two gpio pins, one for MDC and
>> the other for MDIO. To set turnaround bits, do I have to drive only
>> MDIO? As far as I understand the standard, MDC is not affected,
>> isn't it ?
>>
> for reading as soon as you have sent the register address bits, you
> set the MDIO pin to high impedance i.e. z .
> yes, MDC is not affected by whatever you do with MDIO since MDC is
> only a clock signal. MDIO runs in sync with MDC .

I found a reference code implementing software MII managament for LPC1700,
the way they implement turnaround functions is like this:

static void turnaround_MDIO(void)
{
GPIO2->FIODIR &= ~MDIO;
GPIO2->FIOSET = MDC;
delay();
GPIO2->FIOCLR = MDC;
delay();
}

Why do they toggle direction of MDIO line?

--
Mark

From: Boudewijn Dijkstra on
Op Tue, 30 Mar 2010 04:33:19 +0200 schreef Mark
<mark_cruzNOTFORSPAM(a)hotmail.com>:
> salimbaba wrote:
>>> I'm implementing software GPIO based SMI protocol for a small
>>> embedded microcontroller, and got stuck with turnaround bits. As I
>>> understand it, after reading 802.3 spec, it consists of two bits,
>>> and only the first bit depends on operation - read or write. For
>>> write it's always '1', but I can't understand how it is asserted for
>>> reading.
>>>
>>> And seconf half of my question: I use two gpio pins, one for MDC and
>>> the other for MDIO. To set turnaround bits, do I have to drive only
>>> MDIO? As far as I understand the standard, MDC is not affected,
>>> isn't it ?
>>>
>> for reading as soon as you have sent the register address bits, you
>> set the MDIO pin to high impedance i.e. z .
>> yes, MDC is not affected by whatever you do with MDIO since MDC is
>> only a clock signal. MDIO runs in sync with MDC .
>
> I found a reference code implementing software MII managament for
> LPC1700, the way they implement turnaround functions is like this:
>
> static void turnaround_MDIO(void)
> {
> GPIO2->FIODIR &= ~MDIO;
> GPIO2->FIOSET = MDC;
> delay();
> GPIO2->FIOCLR = MDC;
> delay();
> }
>
> Why do they toggle direction of MDIO line?

As salimbaba said: to turn the Hi-Z on and off.


--
Gemaakt met Opera's revolutionaire e-mailprogramma:
http://www.opera.com/mail/
(remove the obvious prefix to reply by mail)