Hi,
For any project which uses an unstabilsed supply (e.g. batteries), it's worthwhile to check that it functions correctly over the whole range of likely supply voltages. For Alkaline (and similar) cells this can be quite a large range, ideally from 1.55 volts per cell down to at least 1.1 volts (which also allows rechargeable NiMH cells to be used). However, my primary purpose was for several recent projects which have required characterisation of the PICaxe operation over its full supply voltage range, i.e. from 5.5 volts down to less than 2 volts. Therefore I breadboarded a very simmple "Vdd sweeper" to slowly reduce the supply rail voltage from the maximum until the PICaxe "stopped working".
The circuit was very simple, just a 6 volt battery feeding an NPN emitter follower (emitter to the PICaxe Vdd) with its base connected to both a large electrolytic capacitor (negative terminal grounded) and a "flylead". In operatation, the flylead was briefly touched onto the battery positive terminal (to charge the capacitor), then the capacitor allowed to slowly discharge over several minutes (the only drain is the small base current of a few uA). The voltage doesn't ramp down entirey linearly, but the PICaxe can report its actual Vdd via SERTXD (using CALIBADC10). Then characteristic graphs plotted against voltage (rather than time) by using the X-Y option in Excel (or similar spreadsheet program). If necessary, a "Hard Reset" (for reprogramming) could be initiated by touching the flylead onto the battery negative terminal.
This test rig performed remarkably well, but I was slightly concerned that the solderless breadboard "lash-up" carrying a large electrolytic and a flylead might accidently "release the magic smoke" from the PICaxe. Also, I noticed that all my PICaxes stopped working at exactly the same supply voltage, and then realised that it was the serial communications (SERTXD) which were dropping out (CH340 USB chip) and the PICaxe was still running happily.
Therefore, I decided to build a combined interface board for Vdd-Sweeping with a buffer-amplifier for the SerOut signal. It could be built as a motherboard (i.e. with a socket for the PICaxe chip(s)), but I chose to construct it as a "daughterboard" with four pins at one end to "piggyback" just the four end pins (two each side) of any 08, 14 or 20 pin M2. As is common with my designs, there are numerous "optional" features and/or components which perform more than one function, so it might be built as just an enhanced programming interface, or as a "Vdd sweeper", or with various combinations from both.
The schematic diagram is shown below, with the first point of note that the toggle switch is a "Centre Off" type, which is important because the centre position is the basic "run" (sweep) position. However, if such a switch is not available then it can be replaced by two switches (an on/off and a push-button), or some of the functions may be omitted. Later in this post is a second schematic diagram that shows ALL the alternative component arrangements which might be "mix and matched" with the first diagram as required.
The 100 ohm resistor limits the current charging the electrolytic, the resistance might seem low but is (theoretically) required to achieve the dv/dt (risetime) specified in the PIC data sheet. The electrolytic capacitor might be any value between 100 uF and 10,000 uF depending on the required slew rate, the Vdd load current and the transistor gain. Generally 1,000 uF should be sufficeint, but I needed 4700 uF to achieve less than 1 mV/second for some crittical measurements.
The potentiometer and the additional discharge circuit are "optional": The pot is set to its lowest postion to force a Hard Reset (when closing the toggle switch) or it allows any (constant) supply voltage to be set for the PICaxe. The optional disharge components (diode + 120k) increase the speed of ramping down, either only down to a threshold voltage (set by the pot) or all the way to the PICaxe's dropout. The slowest ramp is obtained when the pot is set to the top of its track.
The primary purpose of the (optional) LEDs is to verify serial communications, one for the "break" signal (or program downloading) and the other for data transmission from the PICaxe. As the current in these LEDs is quite small, they generally need to be an Ultrabright type. Note that the "SerOut" LED does NOT specifically indicate a "High" on the pin, it indicates that the pin is "Not Pulled Low". Thus this LED lights (also) if the PICaxe is not fitted or when reset, etc..
The LED in the SerIn path has a secondary function: it blocks the negative voltage coming from a "real" RS232 port, which can inject a current into the PICaxe that upsets ADC measurements. However, the reverse breakdown voltage of a LED is rather low, so if the negative voltage blocking is a serious requirement, then a conventional diode is preferable (as shown in the alternative schematic diagram below). If not fitted, then this LED/diode must be replaced by a link (all other optional components should just leave an open circuit).
Similarly, the secondary function of the SerOut LED is to clamp the base of the transistor near to ground, so that the base-emitter junction can become reverse-biassed and remove any loading on the pin. This allows the SerOut pin to be used in its DAC output mode above about 1 volt, but again if this is a "serious" requirement then the alternative of two normal diodes might be preferable.
A sample Veroboard layout and typical software will be included in the next post.
Cheers, Alan.
For any project which uses an unstabilsed supply (e.g. batteries), it's worthwhile to check that it functions correctly over the whole range of likely supply voltages. For Alkaline (and similar) cells this can be quite a large range, ideally from 1.55 volts per cell down to at least 1.1 volts (which also allows rechargeable NiMH cells to be used). However, my primary purpose was for several recent projects which have required characterisation of the PICaxe operation over its full supply voltage range, i.e. from 5.5 volts down to less than 2 volts. Therefore I breadboarded a very simmple "Vdd sweeper" to slowly reduce the supply rail voltage from the maximum until the PICaxe "stopped working".
The circuit was very simple, just a 6 volt battery feeding an NPN emitter follower (emitter to the PICaxe Vdd) with its base connected to both a large electrolytic capacitor (negative terminal grounded) and a "flylead". In operatation, the flylead was briefly touched onto the battery positive terminal (to charge the capacitor), then the capacitor allowed to slowly discharge over several minutes (the only drain is the small base current of a few uA). The voltage doesn't ramp down entirey linearly, but the PICaxe can report its actual Vdd via SERTXD (using CALIBADC10). Then characteristic graphs plotted against voltage (rather than time) by using the X-Y option in Excel (or similar spreadsheet program). If necessary, a "Hard Reset" (for reprogramming) could be initiated by touching the flylead onto the battery negative terminal.
This test rig performed remarkably well, but I was slightly concerned that the solderless breadboard "lash-up" carrying a large electrolytic and a flylead might accidently "release the magic smoke" from the PICaxe. Also, I noticed that all my PICaxes stopped working at exactly the same supply voltage, and then realised that it was the serial communications (SERTXD) which were dropping out (CH340 USB chip) and the PICaxe was still running happily.
Therefore, I decided to build a combined interface board for Vdd-Sweeping with a buffer-amplifier for the SerOut signal. It could be built as a motherboard (i.e. with a socket for the PICaxe chip(s)), but I chose to construct it as a "daughterboard" with four pins at one end to "piggyback" just the four end pins (two each side) of any 08, 14 or 20 pin M2. As is common with my designs, there are numerous "optional" features and/or components which perform more than one function, so it might be built as just an enhanced programming interface, or as a "Vdd sweeper", or with various combinations from both.
The schematic diagram is shown below, with the first point of note that the toggle switch is a "Centre Off" type, which is important because the centre position is the basic "run" (sweep) position. However, if such a switch is not available then it can be replaced by two switches (an on/off and a push-button), or some of the functions may be omitted. Later in this post is a second schematic diagram that shows ALL the alternative component arrangements which might be "mix and matched" with the first diagram as required.
The 100 ohm resistor limits the current charging the electrolytic, the resistance might seem low but is (theoretically) required to achieve the dv/dt (risetime) specified in the PIC data sheet. The electrolytic capacitor might be any value between 100 uF and 10,000 uF depending on the required slew rate, the Vdd load current and the transistor gain. Generally 1,000 uF should be sufficeint, but I needed 4700 uF to achieve less than 1 mV/second for some crittical measurements.
The potentiometer and the additional discharge circuit are "optional": The pot is set to its lowest postion to force a Hard Reset (when closing the toggle switch) or it allows any (constant) supply voltage to be set for the PICaxe. The optional disharge components (diode + 120k) increase the speed of ramping down, either only down to a threshold voltage (set by the pot) or all the way to the PICaxe's dropout. The slowest ramp is obtained when the pot is set to the top of its track.
The primary purpose of the (optional) LEDs is to verify serial communications, one for the "break" signal (or program downloading) and the other for data transmission from the PICaxe. As the current in these LEDs is quite small, they generally need to be an Ultrabright type. Note that the "SerOut" LED does NOT specifically indicate a "High" on the pin, it indicates that the pin is "Not Pulled Low". Thus this LED lights (also) if the PICaxe is not fitted or when reset, etc..
The LED in the SerIn path has a secondary function: it blocks the negative voltage coming from a "real" RS232 port, which can inject a current into the PICaxe that upsets ADC measurements. However, the reverse breakdown voltage of a LED is rather low, so if the negative voltage blocking is a serious requirement, then a conventional diode is preferable (as shown in the alternative schematic diagram below). If not fitted, then this LED/diode must be replaced by a link (all other optional components should just leave an open circuit).
Similarly, the secondary function of the SerOut LED is to clamp the base of the transistor near to ground, so that the base-emitter junction can become reverse-biassed and remove any loading on the pin. This allows the SerOut pin to be used in its DAC output mode above about 1 volt, but again if this is a "serious" requirement then the alternative of two normal diodes might be preferable.
A sample Veroboard layout and typical software will be included in the next post.
Cheers, Alan.