The invention discloses a method for reading and writing on-line serial data of an on-chip system, and belongs to the technical field of integrated circuits. The method comprises the following steps of: generating an ISP (in-system programming) module by using a comprehensive hardware description language, and inserting the ISP module into the on-chip system with a program memory to implement read-write of the on-line serial data of the program memory. The ISP module comprises a controller module, a status register module, an SPI (serial peripheral interface) module, a data path module, a timer module, an address generator module and a control signal generator module. The controller module is connected with the SPI module, the status register module, the data path module, the timer module, the address generator module and the control signal generator module; the timer module is connected with the control signal generator module; and the control signal generator module is connected with the address generator module. The module in the method is clear to divide, simple to implement and high in reliability, is easily transplanted in different on-chip systems, is convenient to develop and debug the on-chip system, and shortens the development period of the on-chip system.