A method programs an implantable medical device such that it is configured for stimulating neural tissue by at least one electrode. The method includes: performing, by means of the implantable medical device, an evoked compound action potential (eCAP) threshold search by stimulating the neural tissue with test stimulation pulses; determining, based on the eCAP threshold search, an eCAP threshold amplitude and a coupling factor that is indicative of a coupling between the at least one electrode and the neural tissue; and generating a first set of stimulation parameters containing at least a stimulation amplitude that is determined in dependence on the eCAP threshold amplitude and the coupling factor.