The paper presents the design of On-chip debug system based on JTAG for So C, the system mainly includes JTAG interface and On-chip debug mode control unit. By executing different debugging instructions, On-chip debug system can perform debug functions, for example, setting breakpoints, single step execution, monitoring the registers and memory,programming on line and configuring microcontroller's execution state. Meanwhile, this paper expatiates working principle and hardware structure of the On-chip debug system.