Doc. # 1-0003314
Date Updated 07-07-2005 Date Created 07-27-2000
Document Type Knowledge Base Related OS
Related Product
How to change CPU speed through software programming on PCA-6143P?
Solution:
In PCA-6143P, user can program to change CPU speed easily through software on ALi chipset. The configuration of ALi M1217/M1219 is controlled through I/O port 22H(index) and 23H(read/write). For CPU speed, it is controlled by bit 3 with index=30H. If bit 3 is set to 1, CPU will run in fast speed. Follow is a simple program for your reference. Undocument *** To change the CPU speed, you have to read the register again after you change the register. *** Change CPU speed to fast status: outportb(0x22,0x30); outportb(0x23,0x08); Rember to read again outportb(0x22,0x30); inportb(0x23); Change CPU speed to slow status: outportb(0x22,0x30); outportb(0x23,0x00); Rember to read again outportb(0x22,0x30); inportb(0x23); For normal operation, the other bits (bit 0-2 and bit 4-7) must remain their original values. The example program in C language as below : #include #include void main(void) { char key_press; clrscr(); do { if (key_press=='f' || key_press=='F') // set CPU to run in fast speed { outportb(0x22,0x30); outportb(0x23,0x08 | inportb(0x23)); outportb(0x22, 0x30); printf("After is 0x%X \n\n", inportb(0x23)); } else if (key_press=='s' || key_press=='S') // set CPU to run in slow speed { outportb(0x22,0x30); outportb(0x23,0xF7 & inportb(0x23)); outportb(0x22, 0x30); printf("After is 0x%X \n\n", inportb(0x23)); } printf("Please press f for fast speed, s for slow speed, or q to quit\n\n"); key_press = getch(); outportb(0x22, 0x30); printf("Before is 0x%X \n", inportb(0x23)); } while (key_press != 'q' && key_press != 'Q'); }