Bifurcation for periodic differential equations at resonance