To improve the constant output voltage accuracy of primary-side controlled flyback converter, this study described a digital control scheme based on accurate sampling and cable voltage drop compensation. The voltage drops of output diode and the cable were analysed first, they were two most important factors that influence the accuracy of output voltage. Then, an accurate sampling method that can eliminate the voltage drop of the output diode was proposed. With output current estimating and digital resistance capacitance (RC) filter, the compensation of cable voltage drop was also designed. Finally, the software simulation and prototype test results verified the proposed scheme, and the constant voltage accuracy of the prototype achieved -0.6 approximate to +0.6%.