LOW POWER OPERATION
To get the lowest power of typically 155�A use STANDBY to put the microprocessor into standby for most of the time. Resistors on the address bus ensure that the application PROM and the on-card RAM are not selected. The E-clock is stopped so the gate array draws only static power and the H8/532 microprocessor is in software standby mode.
A Non Masked Interrupt (NMI) from the on-board clock chip will cause the chip to leave standby and then the word following STANDBY is executed.
By default, the NMI occurs every 1 second (it is there all the time whether or not standby is being used). The word SECONDS sets up an NMI to occur after up to 99 seconds. With a current meter in the TDS2020F's power supply line try this to illustrate the principle:
10 0 DO 0 A-D 80000. I M+ E!
2 SECONDS STANDBY
2 +LOOP ;
On execution of TEST 5 samples of A to D converter channel 0 will be taken, one every two seconds and stored to address pairs in a RAM in the 32-pin socket starting at hex 80000. Power will be low most of the time since the loop rests inside STANDBY . TDS-PC for Windows may say 'serial data error' while the serial port is switched off during the low power standby time because of the illegal RS232 voltage level.
The method above does not give accurate loop timing, it depends on how long the processor stays in your code within the loop. The file #TIMED.TDS allows accurate loop times. Furthermore, the execution of the code, for instance logging data, can be synchronised to the minute, hour, quarter of an hour etc. using the word O'CLOCK . This example loop executes every 10 seconds, on the ten-second mark, with no cumulative time loss:
: TIMED-TEST ( -- ) \ Demonstrate low power mode
10 SECOND O'CLOCK \ wait for rounded loop time
BEGIN \ start of loop
W@ ." Time =" .TIME \ show real time each loop
CR 30 MS SUSPEND \ low power awaiting NMI
970 MS \ add artificial delay
KEY? \ exit on any key
UNTIL KEY DROP ; \ discard keystroke
File #ALARMS.TDS gives even more comprehensive facilities. In summary, there are three levels of timer sophistication:
Built into the kernel, e.g. 10 SECONDS STANDBY will
q Normal: File #TIMED.TDS, for accurate loop time. E.g. put this in an initialisation routine: 60 SECOND O'CLOCK . Then inside a loop put SUSPEND and the loop time will be exactly 60 seconds without any creep. Cycle times from 0.03 seconds to 99 days are available. The TDS2020F will be in standby during the delay.
q Advanced: File #ALARMS.TDS, for accurate non-standard loop times. E.g. put this in an initialisation routine: 0 23.56.04 09 ADJOURNMENT . Then inside a loop put ADJOURN and the loop time will be exactly 0 days 23 hours, 56 minutes, 4.09 seconds without any creep. The TDS2020F will be in standby during the delay. In this example the loop will cycle every sidereal (astronomical) day. Loop times can be up to a year.
Other programming of the PCF8583 clock chip is possible and this manual includes details of its internal registers, see PCF8583 CLOCK CHIP, page 328.
You can also exit STANDBY SUSPEND ADJOURN by providing your own NMI, with or without use of one of the above techniques. On the TDS2020F the NMI input is held at +5V by a 100k resistor and the clock chip output connected to it has an open drain output. This gives you the possibility of connecting a further open-drain output externally to create an NMI from an external event to wake up the system.
The NMI input on the H8/532 microprocessor does not have a Schmitt trigger circuit and a slow rise time can result in multiple Non Masked Interrupts. Normally this does not matter since the usual wake-up NMI just returns from interrupt without doing any work, but be aware that if you revector NMI to your own routine you may need to add an external pull-up of about 1k0 or add a Schmitt trigger.
Note that during standby the microprocessor is completely inactive, for example the timer-counters will not work. The only active element in the system is the chip clock, which is waiting for the time set. For instance, after any of the three standby words you will probably want to put W@ to reset the board clock.
Watch external loads because the output voltage levels are maintained during standby. You may choose to switch outputs to the levels that give least external current before entering standby. Also tie any unused inputs to ground or +5V through 100k resistors. If they were allowed to float to an intermediate value unwanted current drain would occur.
You can do anything you want once the microprocessor comes back on line-collect data from the Analog to Digital converter and put it to RAM for example. Or you may stay fully powered up until there is no input for ten minutes, say. Then standby can be entered to reduce power while inputs are inactive.
OTHER POWER REDUCTION TECHNIQUES
Serial ports not being used in an application can be turned off with 232OFF . If a serial port is used only occasionally, for transmitting data to a second computer for example, it can be turned on and off as required:
: LOWTYPE \ Like TYPE but turns RS232C power on/off
A delay of at least 100ms is advisable to allow the �8V generator to reach full voltage. This technique reduces the power consumption by about 8mA. Disconnection of the terminal when not in use will also save power.
When the negative voltage generator is switched off in this way, as with STANDBY SUSPEND ADJOURN , TDS-PC for Windows may give a 'serial data error' message.
Switching off external ICs can sometimes save further power. The TDS2020F provides a switched +5V supply for them on pin c15. This is the same as the supply to the serial port voltage generator and is controlled by 232ON and 232OFF . Use it to save power in external peripherals but take care-some chips will take current at their inputs if they are powered down.