The optimal procedure minimising the mean acquisition time is proposed to determine the parameter values of the code acquisition detector in code division multiple access (CDMA) wireless communication. The optimal relationships among the threshold (v(th)), the number of correlation samples (N) and the number of noncoherent accumulations (L) are obtained for the code acquisition detector. A suboptimal solution is presented to obtain the integer solution and is shown to reduce the code synchronisation time and the computational complexity of the CDMA receiver.