Exploiting the inherent cyclic and periodic free-spectral-range (FSR) properties of arrayed-waveguide grating (AWG) routers, the time-spreading and free-spectral-range (FSR) group hopping code, which is embedded by maximum length sequences (called TS/GH embedded M-sequence code) is configured over a fiber-to-the-home (FTTH) network. For constructing the proposed code, we use the same prime code for generating the time code (time-spreading code) and the spectral domain code (group hopping code). Therefore it is referred to as a two-dimensional (2-D) optical code. Importantly, for the proposed broadband light source (BLS), the total number of available wavelengths is partitioned into G different groups according to the length of the M-sequence code. Every group is referred to as a hopping pattern and characterized by the FSR interval of the AWG router. Improving the prime-hop code (PHC) and the modified prime-hop code (MPHC) with cascading one additional AWG router, the cardinality of the proposed scheme is significantly increased by a factor of 15 under the optimum arrangement for a group hopping number of G=7. Moreover, the correlation property and bit error rate (BER) of proposed scheme is evaluated and the result reveals an improvement of the BER compared to MPHC and PHC.