Time-series observations of geochemical tracers and diazotroph abundances in the northern subtropical gyres suggest variability in nitrogen fixation on interannual and longer timescales. Using a highly idealized model of the biogeochemistry and ecology of a subtropical gyre, we explore the previously proposed hypothesis that such variability is regulated by an internal "biogeochemical oscillator." We find, in certain parameter regimes, self-sustained oscillations in nitrogen fixation, community structure and biogeochemical cycles even with perfectly steady physical forcing. During the oscillations of nitrogen fixation, "blooms" of diazotrophs occur at intervals between a year and several decades, consistent with the observed variability. The period of the oscillations is strongly regulated by the exchange rate between the thermocline and mixed-layer waters. The oscillatory solutions occur in a relatively small region of parameter space, but one in which the relative fitness of diazotrophs and non-diazotrophs are closely matched and the time-averaged biomass of each class of phytoplankton is maximized.