It seems simple enough (using Ohms law). But there are a few design decisions to be made - and that makes it more interesting.
Is 80 volts the maximum? Or might this be variable even up to a peak of 100 volts? And how fast is this square wave? (Fast might need compensation). Lots of unknowns.
I thought about a diode clamp to the 3v3 rail... but then wondered if a zener might be preferable? Anyone got thoughts here?
Assuming slow frequency, my design settled on the following (with a 1:40 resistor ratio to allow for spikes)...
View attachment 14936