OpenEtherCATsociety / SOES

Simple Open Source EtherCAT Slave
Other
578 stars 249 forks source link

fifo_cnt variable #40

Closed Sulymarco closed 5 years ago

Sulymarco commented 6 years ago

Hi everybody, I don't understand the use of the variable _fifocnt in the _ESC_readpram and _ESC_writepram functions: it is loaded, decrement and never used.

According to the LAN9252 datasheet we have to use it to see how many read/write we can perform without needing to check the status again, but this seems not to be the case in the code.

I know that the Microchip LAN9252 SSK code is exactly the same, but this doesn't confort me.

Am I missing something? Any comment is greatly appreciated.

Marco

Sulymarco commented 6 years ago

I am referring to the _eschw.c file for the LAN9252

Marco

nakarlsson commented 6 years ago

Seems wierd indeed, have you tried asking Microchip?

Sulymarco commented 6 years ago

No, not yet.

Sulymarco commented 6 years ago

I have submitted the issue to the Microchip support. I will update you about it.

In the meantime any comment is welcome.

Marco

Sulymarco commented 6 years ago

So far no answer from Microchip support :-( @nakarlsson (or @everybody else) please can also you submit the question to the Microchip support , just to give them a little bit pressure on the issue? It would be really interesting to have an answer from them !

Marco

Sulymarco commented 5 years ago

Finally I received an answer from Microchip (after more than one year)

Each FIFO will update at about 800nSec. So, we don’t need to poll the register every time since the PIC is running at a slower speed and polling will reduce the speed even further. If we add code to poll the available count, it will further decrease the throughput. If a high-performance MCU is used it is recommended to use a 1uSec delay or poll the available counter.

Marco

nakarlsson commented 5 years ago

Thanks , Ill close this