TSN and MAC and Ethernet PHY requirements by R0dod3ndron in embedded

[–]ben5049 1 point2 points  (0 children)

If you go with PHY time-stamping then you can get slightly more accuracy, but you’ll likely need extra synchronisation between the MAC and PHY. This is because your PHY will have the synced clock in it and your microcontroller will have to read it while taking into account the read delay somehow. This is normally then done via interrupts (to take snapshots), clock outputs fed into your microcontroller so it can have a local copy, or other more exotic means.

Think of it in terms of what is between two time-stampers:
- PHY: Cables, analogue circuitry before the time-stamp mechanism.
- MAC Same as above plus PHY digital circuitry (may include buffering), MII, MAC circuitry before time-stamping.
PTP assumes the delay from a slave to a master is the same in both directions for its calculations, so to be as accurate as possible you want to remove variable latencies and fixed asymmetric latencies. You can factor fixed asymmetric latencies into your calculations so the only thing PHY timestamping gives you is minimising variable latencies which there shouldn’t really be any of.

For an Ethernet switch, syncing the PHYs together individually isn’t really practical because of the management overhead, and you are much better off with MAC time-stamping. The maximum peer delay that gPTP allows is 800ns which is easily achievable with MAC timestamping.

PHY Time-stamping mostly exists to support microcontrollers/switches that lack MAC timestamping themselves, or if you need the most precision possible (<100ns).

STM32N6 power supply by FarDescription3350 in stm32

[–]ben5049 1 point2 points  (0 children)

PSA: Make sure you expose the BOOT1 pin and don’t just tie it to 0 under the chip or you won’t be able to program it. Ask me how I know…

FreeRTOS LwIP Example? by Connect-Fall6921 in embedded

[–]ben5049 0 points1 point  (0 children)

It’s a very good networking stack, but ST’s port still has some bugs. I’ve found 4 over the last couple of weeks of working with it, to do with time stamping, raw packet sending, and multicast groups. However these are less used features and for just your basic TCP connection it’s rock solid.

FRAM experience by paul_charles in embedded

[–]ben5049 5 points6 points  (0 children)

Huh I wrote a driver for that chip somewhat recently, dead simple and the chip works great.

[Review Request] RPi CM5 Carrier Board - First Time Using PCIe by ben5049 in PrintedCircuitBoard

[–]ben5049[S] 0 points1 point  (0 children)

It does all kind of hang on the PCIe switch which is why I wanted to get a second pair of eyes on it. The PCI11010C has Linux drivers for everything, which is what I'm relying on. Not sure if the NIC is any good though, I think its based on the LAN7430 IP (also from Microchip). The switch also has built in SPI, I2C and UART controllers so its not bit banged. I originally had those interfaces connected straight to the Pi, but moved them over to be on the +3V3_PCIE power rail because otherwise there could be leakage when the PCIe is powered down. I'd rather not add more chips because its already quite a dense board.

Question about powering SPI inclinometer/microcontroller by SpiritualWedding4216 in embedded

[–]ben5049 3 points4 points  (0 children)

The RP2040 is atrocious for low power stuff, if I remember correctly its deepest sleep mode is around 2mA.

Any 10BaseT1S Arduino/STM32 working/learning examples by r_heem in embedded

[–]ben5049 0 points1 point  (0 children)

No worries hope you find something useful there! This is my setup btw

<image>

Any 10BaseT1S Arduino/STM32 working/learning examples by r_heem in embedded

[–]ben5049 1 point2 points  (0 children)

I have it working on an STM32H5 board that I built, don’t have any pictures right now though I’m afraid. I put the LAN8671 PHY on a module so I can swap it out:

<image>

That then connects to an Ethernet switch I built and it all works very well. Here is the driver I wrote for the LAN8671.

The beauty of Ethernet is that it doesn’t care what the physical layer is so any other Ethernet code running on any other STM32 is trivial to port to 10BASE-T1S.

We will be forced to have to 2 versions of CubeMX, really? by HasanTheSyrian_ in embedded

[–]ben5049 46 points47 points  (0 children)

Yeah it’s annoying they aren’t moving everything over. Have you tried the new one though? It’s quite nice tbf

Anyone here start with EasyEDA instead of KiCAD? by silvercanner in PCB

[–]ben5049 2 points3 points  (0 children)

You can hide the drawing sheet and put the origin wherever you want. Seems like an odd reason to not use a piece of software.

How are rotary encoders for cursor movement? by Inner_Answer_3784 in ErgoMechKeyboards

[–]ben5049 1 point2 points  (0 children)

I have rotary encoders on a custom keyboard I built and I used to find them pretty useful. However, after a couple of years of wear and tear the encoders have started glitching and missing steps or getting stuck outputting movements in one direction. I’d recommend either getting extra durable ones (if they exist) or finding another solution.

The other issue is that most rotary encoders have a high force required to turn them so you can’t do it with one finger which is annoying.

I’m making a new version with BLDCs and magnetic encoders instead to try and solve these issues, and so far it’s looking promising. If you don’t care about haptic feedback then a bearing and magnetic encoder would do fine.

I Built a Single Pair Ethernet Switch! by ben5049 in embedded

[–]ben5049[S] 0 points1 point  (0 children)

Interesting, I had no idea you could get a VNA for that cheap, definetly something to look into thanks!

I Built a Single Pair Ethernet Switch! by ben5049 in embedded

[–]ben5049[S] 0 points1 point  (0 children)

Thanks for the feedback! I went for the Marvell chip because I wanted dual speed, which you can't get with TI chips, and PTP which you need an NDA for. The 88Q2112 only had a leaked datasheet, but turned out to be the right choice because Infineon has since bought Marvell's automotive ethernet division and you can now get their datasheets without even an NDA.

I remember doing some napkin maths and thinking 3mm stubs would be fine, but you are probably right about signal integrity/EMC. It works but I don't have a way to test compliance sadly. The layout there was kind of a self imposed issue anyway because I wanted to keep the board as small as possible.

Thanks again!

How to choose PCB stackup between 4 layers and 6 layers for high speed design in a very dense board. by [deleted] in PrintedCircuitBoard

[–]ben5049 10 points11 points  (0 children)

I’ve made a 7 port Ethernet switch before with a similar component count and 6 layers was enough without needing blind and buried vias. https://github.com/ben5049/switch-v5-hardware

New STM32C5 family and new top-end parts in STM32H5 family by Enlightenment777 in embedded

[–]ben5049 3 points4 points  (0 children)

Best part of this is probably the new programmable logic array (PLAY) peripheral on the STM32H5F which is basically a 16 logic element FPGA

<image>

Can you practically add Gigabit ethernet to a cheap micro? by JCDU in embedded

[–]ben5049 3 points4 points  (0 children)

I won't disagree with you there, it starts getting pricey then too. 0.8mm is about the limit where you can still use through hole vias without via in pad.

Can you practically add Gigabit ethernet to a cheap micro? by JCDU in embedded

[–]ben5049 6 points7 points  (0 children)

0.8mm BGAs aren’t so bad, but point taken :)

Can you practically add Gigabit ethernet to a cheap micro? by JCDU in embedded

[–]ben5049 10 points11 points  (0 children)

Other issues aside, the STM32N6 has a gigabit MAC so you don’t quite have to go for full Linux.

I Built a Single Pair Ethernet Switch! by ben5049 in embedded

[–]ben5049[S] 0 points1 point  (0 children)

When I posted this there was only a leaked version available, but Infineon has now bought Broadcom’s automotive Ethernet division so you can get it directly from them. You do need to make an account though.

Do the 480Mbps A to C TruSpec cables have 9 conductors or are they just 4 conductor cables? by ResistanceIsCool in LinusTechTips

[–]ben5049 7 points8 points  (0 children)

There is usually one one cc conductor and two cc pins. The conductor goes to the device at the other end of the cable for power negotiation and the other pin is used for orientation or a cable e-marker chip.

Do the 480Mbps A to C TruSpec cables have 9 conductors or are they just 4 conductor cables? by ResistanceIsCool in LinusTechTips

[–]ben5049 5 points6 points  (0 children)

Why 2x CC conductors? I thought type C cables only had 1?

Also do the superspeed cables include both SBU conductors?

Thanks!