Fabrication and characterization of n-on-n silicon pixel detectors compatible with the Medipix2 readout chip