RPi Pico: 100BASE-T with cheap ethernet PHY module
github.com
github.com
I have no idea how this works, but that stuck me as interesting.
https://github.com/maximeborges/pico-rmii-ethernet/blob/main...
(It sets the clock pin to 0, sleeps for a microsecond, puts the data bit on the data pin and sets the clock to 1, then sleeps for a microsecond.)
Main tx data loop that depends on the 50mhz clock generated by the rp2040 is here. https://github.com/maximeborges/pico-rmii-ethernet/blob/main...
If you are old enough to remember serial ports on computers, this is the “16 times oversampling!” bullet point. They oversampled and then state machined their way back to figuring out where the sending machine’s clock was thinking the bit changes were.
Bonus fun depressing asynchrony fact: Whenever your chip samples an asynchronous input there is a chance of the logic getting the change just at the wrong time and entering a meta stable state which is neither high nor low for an arbitrarily long time! The best you can do is minimize the probability and probable duration. So, happy new year, all your computers are just rolling dice billions of times per second.
I clearly remember having modified/written an FPGA logic analyzer that ended up entering impossible logic lockup states after a few minutes/seconds (Hardware, crashing? What?)... that was when I learned about metastability. Some synchronizers took care of the problem.
You're far better off starting with a micro controller that features USB and Ethernet built in, of which there are MANY.
If you want Ethernet on your pi pico, use an SPI Ethernet controller such as the Microchip LAN9250.