Skip to content

How Does a W5500-EVB-Pico2 Run a Solar Radio Telescope's Front End over Modbus TCP?

MicroPython on a W5500-EVB-Pico2 serves Modbus TCP for EOVSA's front-end controller, applying attenuator and noise-source commands on each 1 PPS edge.

Grace_Koo

Published November 20, 2026

Original author: oweng1Original source (new tab)

How Does a W5500-EVB-Pico2 Run a Solar Radio Telescope's Front End over Modbus TCP?

Components

Hardware components

Project description

๐Ÿ“š Context: oweng1/EOVSA-FEM-Interface โ€” MicroPython firmware for new front-end interface cards on the 2-m antennas of EOVSA (Expanded Owens Valley Solar Array), the solar radio array NJIT operates at Owens Valley Radio Observatory in California. A W5500-EVB-Pico2 serves Modbus TCP, sets the front-end attenuators and noise source, and reads its power detectors, all on the array's 1 PPS.


01 โ€” Where the card sits

EOVSA 2-m Front End Module, production version: RF chain with couplers, amplifiers, 2.5 GHz high-pass filters, step attenuators, noise diode and optical transmitters; the Front End Interface block at top right carries Ethernet, I/O lines and the trigger. Diagram: EOVSA documentation, NJIT
EOVSA 2-m Front End Module, production version: RF chain with couplers, amplifiers, 2.5 GHz high-pass filters, step attenuators, noise diode and optical transmitters; the Front End Interface block at top right carries Ethernet, I/O lines and the trigger. Diagram: EOVSA documentation, NJIT

EOVSA observes the Sun every day at 1โ€“18 GHz with fifteen 2-m antennas and a 27-m calibration dish. Behind each 2-m feed is the Front End Module (FEM), a temperature-controlled box with the amplifiers, step attenuators, a calibration noise diode, and the optical transmitters that put both polarizations on one fiber. In the FEM diagram, a Front End Interface block links the box to the antenna network through Ethernet, I/O lines and a trigger input. The repository's card does the same job:

FEM partCard side
Two step attenuators per polarization, H and VGPIO 0โ€“4 data bus, GPIO 5โ€“8 latch enables
Calibration noise diodeGPIO 9, DC power on or off
H and V power detectorsADC 26, ADC 27
Temperature sensorADC 28
1 PPS triggerGPIO 10, rising-edge interrupt
Antenna networkW5500, Modbus TCP

02 โ€” The board and the network

Array control talks Modbus TCP over Ethernet to the W5500 on a W5500-EVB-Pico2; the RP2350 drives the FEM attenuators and noise diode through GPIO, reads detectors and temperature through ADC, and takes 1 PPS on GPIO 10
Array control talks Modbus TCP over Ethernet to the W5500 on a W5500-EVB-Pico2; the RP2350 drives the FEM attenuators and noise diode through GPIO, reads detectors and temperature through ADC, and takes 1 PPS on GPIO 10
SettingValue
BoardW5500-EVB-Pico2 (RP2350); the README also lists the W5100S and W6100 versions
FirmwareMicroPython, WIZnet-ioNIC UF2 build for the EVB-Pico2
Drivernetwork.WIZNET6K(), onboard SPI pins set by the build
AddressDHCP with a MAC-to-IP reservation per front end
ServiceModbus TCP server on port 502, Unit ID 0xFF
Rolloutone main.py for front ends fe1 to fe16, no per-unit edits

Because the address comes from the DHCP reservation, the same file goes onto every card. The README's deployment notes are three steps: flash the UF2, save the code as main.py, and repeat across the fleet.


03 โ€” Four attenuators on nine pins

Inside a 2-m FEM during a bench test: RF parts beside the optical-link module (black case), with control lines labeled BIT 1 to BIT 5 at the right. Photo: EOVSA documentation, NJIT
Inside a 2-m FEM during a bench test: RF parts beside the optical-link module (black case), with control lines labeled BIT 1 to BIT 5 at the right. Photo: EOVSA documentation, NJIT

Each polarization has two 5-bit attenuators (0โ€“31 dB). The four share one data bus on GPIO 0โ€“4, and each has its own latch enable on GPIO 5โ€“8. Setting one attenuator means putting the inverted value on the bus and pulsing that attenuator's latch:

def set_attenuators(pol, a1, a2):
    idx = pol * 2                      # 0 = H POL (latches 0, 1), 1 = V POL (latches 2, 3)
    for i, b in enumerate(get_attn_bits(a1)):   # bits = ~value & 31
        attnpins[i].value(b)
    lepins[idx].value(1)
    lepins[idx].value(0)
    # ... same for a2 on latch idx + 1

Nine GPIOs cover twenty attenuator bits, and the other three channels hold their values while one is written.


04 โ€” Every change waits for the second

Modbus writes for the H POL attenuators and the noise source arrive mid-second and are held as pending flags; on the next 1 PPS rising edge the interrupt applies the noise diode, then the H and V latches, then averages the ADCs; a later FC 04 read returns the value sampled at that edge
Modbus writes for the H POL attenuators and the noise source arrive mid-second and are held as pending flags; on the next 1 PPS rising edge the interrupt applies the noise diode, then the H and V latches, then averages the ADCs; a later FC 04 read returns the value sampled at that edge

In EOVSA's control commands, a front-end attenuation change takes effect on the next second boundary. The card enforces that itself. A Modbus write only stores the value and sets a flag. The GPIO 10 interrupt does the rest:

def on_rising_edge(pin):              # GPIO 10, 1 PPS
    if setnd:
        set_noisediode(ndval); setnd = False
    if sethpolattn:
        set_attenuators(0, hpola1, hpola2); sethpolattn = False
    if setvpolattn:
        set_attenuators(1, vpola1, vpola2); setvpolattn = False
    latest_hpol_det = read_voltage(0)  # 16-sample average, 11-bit
    latest_vpol_det = read_voltage(1)
    latest_temp = read_temperature()

Every front end therefore switches on the same edge. Each detector reading is tied to a known second, which lets the control system compare antennas and step the attenuation from those readings.


05 โ€” Keeping the programming model

The card implements the "EOVSA 2-Meter Front End Assembly Programming Model", so the software on the other side of the network keeps its register map:

FCAddressUse
060x0000V POL attenuators: high byte #1, low byte #2, applied on the next 1 PPS
060x0001H POL attenuators, same format
050x0002Noise source power, 0xFF00 on, 0x0000 off, applied on the next 1 PPS
040x0000, 0x0001, 0x0002V detector, H detector, temperature, 0โ€“2047
040xFFFFFirmware revision, currently 2
010x0002Noise source state
030x01D4, 2 registersAttenuator readback V1, V2, H1, H2

The RP2350 ADC readings are averaged over 16 samples and scaled to 11 bits, the 0โ€“2047 range the model defines. The model's optical-transmitter commands (FC 03 at 0x0000 and 0x0042, FC 05 at 0x0000 and 0x0001) are marked obsolete and left out.


06 โ€” Staying up at the antenna

Auxiliary box at a 2-m antenna, with terminal blocks for the FEM control, power and temperature cables. Photo: EOVSA documentation, NJIT
Auxiliary box at a 2-m antenna, with terminal blocks for the FEM control, power and temperature cables. Photo: EOVSA documentation, NJIT

EOVSA's operating notes describe recovering a stuck front-end controller by a remote power cycle, or by the two breakers in the auxiliary box at the antenna. The firmware arms the RP2350 hardware watchdog at 8 s and feeds it from both of its loops:

SituationBehaviour
No master connectedaccept() times out every 1 s, watchdog fed
Master connected but silentrecv() times out every 2 s, link checked with nic.isconnected()
Link lostconnection closed, back to accept()
Firmware hangswatchdog resets the RP2350 after 8 s, DHCP hands back the reserved address

07 โ€” Where it stands

  • The repository was published on 2026-11-17 with a README and fem_interface.py. Hostnames, address ranges and the port are masked in the README.
  • The listing has its debug prints commented out. In the last except block this leaves the block empty, so it needs a pass before MicroPython will compile it. The code also imports a secrets module that is not in the repository.
  • The README does not say whether the TOE or the lwIP variant of the WIZnet-ioNIC firmware is flashed.
  • There is no license file yet.

One main.py runs the whole front-end fleet, and every attenuator and noise-source change lands on the second.


08 โ€” Similar Projects on WIZnet Makers


Q&A

Q. In what mode is the WIZnet chip used? Through MicroPython's network.WIZNET6K() driver in the WIZnet-ioNIC build, with sockets from MicroPython's socket module. The ioNIC releases come in TOE and lwIP variants, and the README does not say which one is used.

Q. Why Ethernet rather than Wi-Fi at the antenna? The repository does not give a reason. EOVSA's RFI notes describe interference near 2 GHz causing non-linearity in the optical link, and the FEM runs 2.5 GHz high-pass filters. A 2.4 GHz radio would sit in the band the array keeps filtering out.

Q. Which boards does it run on? The README lists the W5500-, W5100S- and W6100-EVB-Pico2. The repository description names the W5500 version.

Q. Can it be reused? There is no license file, so ask the author before reusing the code.


Appendix โ€” From the ioNIC build to upstream MicroPython

The firmware runs on the WIZnet-ioNIC MicroPython build, not on an upstream MicroPython release. That build's WIZnet changes are going upstream as a series of pull requests split out of micropython#18035. The first, micropython#19713, was merged on 2026-11-17. It points lib/wiznet5k at WIZnet's ioLibrary_Driver instead of a MicroPython-specific fork, so one driver covers W5100 through W6300. The PR lists the order of the rest:

StepContentState
1, micropython#19713lib/wiznet5k switched to WIZnet's ioLibrary_Driver; DHCP retransmits on a lost request; MAC and network settings survive active(False) and active(True)merged 2026-11-17
2, micropython#19984W5100S-, W5500- and W6100-EVB-Pico2 and W6100-EVB-Pico boards on the same driver; DHCP, DNS, TCP and UDP tested on all four with both lwIP and the WIZnet stackopened 2026-11-20
3machine.PIOSPI on the rp2 port, plus the W6300 and W55RP20 boardsplanned
4Socket timeout and setsockopt for the WIZnet stackplanned

For this firmware, that sequence is the path to upstream builds. Step 2, micropython#19984, adds all three boards the README lists. Until it lands, the ioNIC build provides them, which is why the code brings up the interface with network.WIZNET6K(). The socket timeouts its accept and recv loops use come to WIZnet-stack builds in step 4.


Original Link: https://github.com/oweng1/EOVSA-FEM-Interface

Firmware: fem_interface.py ยท Pinout and register map: README.md ยท EOVSA front end: Hardware Overview, Attenuation and Level Control, Dealing with RFI

Documents

  • EOVSA FEM interface firmware (MicroPython, Modbus TCP)

Comments

Similar projects you might like

Comments