Design and characterization of avalanche photodiodes in submicron CMOS technologies