Hi, I am using DS89C450 micro-controller chip.
I read the DS89C450 datasheet. To save power, CD1 and CD0 (PMR.7-6) bits need to set to 1, which sets an operating rate of 1024 oscillator cycles for one machine cycle. And SWB (PMR.5) bit need to set to 1 for the switchback function.
I am confuse with this paragraph stated in the datasheet. It state that when CD1 and CD0 are programmed to the divide-by-1024 mode and the SWB bit is also enabled, the system forces the clock-divide control bits to automatically reset to the divide-by-1 mode whenever the system detects an externally enabled interrupt.
So does that mean that the divide-by-1 mode is activated when I also enabled my external interrupts? Or else how do I actually use the power-management mode? Or how do I know it is actually in power-saving mode? And below is my programming.
void main(void) { SerialPorts_Initialise(); Serial_txString1("Serial Ports Running."); tx_port1(CR); tx_port1(LF); SetEdgeRiseFall(); Serial_txString1("Set Rise/Fall Edges."); tx_port1(CR); tx_port1(LF); Interrupts_Enable(); Serial_txString1("Enabling global and external 0, 2, 3, 4 and 5 INTs."); tx_port1(CR); tx_port1(LF); PMR=0xE0; //set CD1, CD0 & SWB (PMR.7-5) bits to 1 (reduce cycle rate & enable switchback function) while(1); }
You have to notice the big difference between "enabling" and "detecting" an interrupt.
The processor can run in low-speed mode, and automatically switch back to full speed to service an interrupt.