Avalanche pulse generator- part 1

I wanted to make a fast pulse generator like the one designed by the great Jim Williams1. Unfortunately, the required chip for the high voltage power supply (LT1073) is not available where I live. I found several similar circuits using different approaches to generate the required voltage. I particularly liked the one in Dangerous Prototypes2, in which an astable multivibrator made with transistors is used to drive a step-up and It got me thinking ¿could be possible to “make” the entire LT1073 with transistors?

I looked for the datasheet3 and found a block diagram of the device.

bloque

Figure 1. LT1073 internal block diagram.

Comparator A1 compares the feedback pin voltage (Fb) with the internal voltage reference. When the feedback drops below 212mV the comparator A1 switch on the oscillator. The driver amplifier boosts the signal level to drive the output NPN power switch Q1. The switch cycling action raises the output voltage and the feedback pin voltage. When the feedback voltage is high enough the comparator turn off the oscillator.

Oscillator

I made the oscillator with an astable multivibrator (like the one in DP). I opted for the version with waveform correction4.

osc

Figure 2. Astable multivibrator with diodes for edge correction and a transistor to control it.

I added a transistor to control the oscillator. When the feedback voltage is lower than the reference the comparator goes low and the oscillator is activated in order to rise the output voltage. According to the datasheet the oscillator is set internally for 38µs ON time and 15µs OFF time. I calculated the resistors needed using a 1nF capacitor but later on I tweaked the values in the breadboard until I got close enough to the required ON and OFF time.

NewFile43

Figure 3. Oscillator output.

Voltage reference

For the reference I made a variable zener with a pair of transistors5.

zener

Figure 4. Variable zener.

I set it to 1V and made some measurements to see how stable the reference was:

Figure 5. Reference voltage (yellow) with power supply variations (blue)

The measurements were done with the converter working making the reference voltage quite noisy. Without a 1uf capacitor between Vref and ground (not shown in the schematic) it looked even worse:

NewFile14

Figure 6. Voltage reference without the 1uf capacitor.

These are the measured values in a much compact graph:

Ref output_vs_vcc

Figure 7. Voltage reference output with variations in voltage supply

Comparator

I build the simplest comparator I could find:

comp

Figure 8. Comparator schematic.

For testing I connected the (-) input to a potentiometer and the other input to the oscillator output:

comp_test

Figure 9. Comparator test setup.

Moving the potentiometer up and down changes the comparator output width:

image

Figure 10. The comparator output is the yellow trace, the potentiometer value is at the top left corner and the blue trace is the oscillator output.

It is not the best comparator you could find but it is good enough for this application. I’m not using hysteresis like the comparator inside the Lt1073 does.

Switching transistor

Tried first with a single BC548 but couldn’t get more than 30V, adding a 2N2222 in a Darlington configuration I could reach a little more than 50V:

Sw

Figure 11. Output Darlington switch.

I also added a diode-capacitor voltage step-up network (as in the original circuit with the LT1073) and this is what the final circuit looks like:

sch

Figure 12. Complete schematic.

and the block diagram of my version:

bloque2

Figure 13.

Then did some test to see if the whole thing was regulating properly and how the output changed with voltage supply variations.

HVoutput_vs_VCC

Figure 14. Output (yellow) vs power supply (blue).

Again the values from the previous oscilloscope captures in a single graph:

HV output_vs_vcc

Figure 15. High voltage output from the converter with variations in the power supply. The converter is configured to output a little bit more than 82V.

I also made some captures of the output from the oscillator as the supply voltage decrease:

osc(blue)_HV output(yellow)_variable VCC

Figure 16.

It can be seen how the pulse trains increase with the reduction of voltage supply. With voltages lower than 1,7 V the converter can’t regulate properly.

I was able to source locally the 2N2369 used in the original application. I connected it in the protoboard to see if the converter could get it to avalanche. The blue trace (Figure 16) shows the voltage in the capacitor, it charges until the voltage is high enough to avalanche the transistor rapidly discharging and generating a fast rising pulse shown in the yellow trace.

NewFile39

Figure 17.

All this testing was done on the protoboard so is no surprise that the pulse looks like crap:

NewFile38

Figure 18. Collector capacitor discharge (blue) and pulse from the avalanche transistor (yellow). It can be seen that the breakdown voltage is around 67[V]

I used a 22pF capacitor but even without using one the parasitic capacitance in the protoboard where high enough to make it work anyway. Now I need to build a proper board.

Reference

1. Application Note 72, APPENDIX B, Measuring Probe-Oscilloscope Response
2. Avalanche pulse generator, and some scope porn
3. LT1073 Micropower DC/DC Converter Adjustable and Fixed 5V, 12V
4. Transistors Tutorial, Part 7: “Oscillators”
5. Simple Transistor Circuits For Experimenting, Fun and Education. Variable Zener Diode

Advertisements

Constant Current Electronic Load

I’m building a power supply and an electronic load might be useful for testing it, so I made one.

Electronic Load/ Carga electrónica

The design is based on some of the various diy electronics loads out there (like the one from Dave Jones). The mosfet is a P45N03LT , most likely I took it from some of the PC power supply I’ve “recycled”.  I’m using two 25k potentiometers, one for coarse adjustment and the other for fine adjustment (10 turn pots are kind of expensive…). The control voltage varies between 0 and 5 volts and is divided by two with a couple of 10k resistors. The op-amp is an OPA2336, It has rail to rail output so the load can sink roughly up to 2,5. The op amp is powered with a 7805.

Electronic Load/ Carga electrónica

The sense resistor is made with a series of 10 0.1 ohm, 1[w], 1% resistors. I made two “resistors” soldering 5 of them and then I put these two back to back and used kapton tape to keep them electrically isolated.

Electronic Load/ Carga electrónica

Finally a heat sink (scavenged form a PC supply as well) for the mosfet and some female banana plugs. The heat sink is too small and it gets really hot, I will have to find a bigger one or put some kind of cooler fan.

Electronic Load/ Carga electrónica

A few components for a very handy piece of equipment.

Electronic Load/ Carga electrónica

MSP430 and a HC-SR04 Ultrasonic Ranging Module

A while back I bought an HC-SR04. It sat in a box until yesterday when I tried to use it with an MSP430G2553 but unfortunately it wasn’t working. I used Energia to program the Launchpad but I wasn’t getting any response from the device. I hooked up my Logic analyzer to see what was going on and….

hc-sr04…the trigger pulse (channel 1) is there but the device will produce essentially the same echo (channel 0), regardless of whether I put an object in front of the module or not. It wasn’t working.

A quick visual inspection and a comparision with other boards photos showed that two components where missing, a capacitor and a SOT-23 device.

hc-sr04

The capacitor was easy to replace. The device near it is a MAX232 used to drive the piezo tranducer and the capacitor is connected between GND and the VCC pin. Acording to the datasheet a 1uF decoupling cap is used.

hc-sr04_2

For the SOT device I made a search looking for a module similar to the one I have but I needed a photo in which the device markings were readable. Eventually I found one with the marking J3Y which turned out to be a S8050LT1 NPN transistor and I replaced it with a PMBS3904.

DSC09562

A quick test with the Launchpad and….It’s working!!!!… now the module responds (now is channel 1) to the trigger (channel 0) with a longer pulse proportional to the distance being measure and the MSP430 is sending data. The Analyzer is showing an echo of 7,206 mS and that translate to 124,24 cm, quite a difference with the value calculated with the Launchpad. The MSP430 is using the internal oscilator as the main clock and is not as accurate as the crystal used for the clock in the Logic analyzer. The error quoted in the datasheets for the MSP430 give the calibrated DCO frequencies a tolerance over temperature and any other changes of ±3%.  The difference in this case is close to 10% and I don’t think it can be entirely explained by the clock source.

hc-sr04_ok

Interfacing the ADS8328 to an MSP430

The ADS8328 is a high-speed, low power, successive approximation register (SAR) analog-to-digital converter (ADC) that uses an external reference. The ADS8328 has an internal clock that is used to run the conversion but can also be programmed to run the conversion based on the external serial clock, SCLK.

The ADS8328 has two inputs. Both inputs share the same common pin—COM. The ADS8328 can be programmed to select a channel manually or can be programmed into the auto channel select mode to sweep between channel 0 and 1 automatically.

The ADS8327/28 can operate with an external reference with a range from 0.3 V to 4.2 V. A clean, low noise, well-decoupled reference voltage on this pin is required to ensure good performance of the converter. A 10-µF ceramic decoupling capacitor is required between the REF+ and REF– pins of the converter. These capacitors should be placed as close as possible to the pins of the device. REF– should be connected to its own via to the analog ground plane with the shortest possible distance. The test was performed on a breadboard with poor decoupling. The goal was to test the library and the SPI interface to be used in the final setup.

The ADS8327/28 has an oscillator that is used as an internal clock which controls the conversion rate. The frequency of this clock is 10.5 MHz minimum. The oscillator is always on unless the device is in the deep power-down state or the device is programmed for using SCLK as the conversion clock (CCLK).

Channel selection can be done both manual or automatically if auto channel select mode is enabled. The manual conversion mode is used and the conversion cycle starts with selecting an acquisition channel by writing a channel number to the command register (CMR).

The end of acquisition or sampling instance (EOS) is the same as the start of a conversion. This is initiated by bringing the CONVST pin low for a minimum of 40 ns. After the minimum requirement has been met, the CONVST pin can be brought high. A conversion can also be initiated without using CONVST if it is so programmed (CFR_D9 = 0). To have more control over the whole process the CONVST pin is used to start conversion.

The status pin is programmed as EOC and the polarity is set as active low, with this configuration the pin works in the following manner: The EOC output goes LOW immediately following CONVST going LOW when manual trigger is programmed. EOC stays LOW throughout the conversion process and returns to HIGH when the conversion has ended (as seen in the last picture).

Internal Register

The internal register consists of two parts, 4 bits for the command register (CMR) and 12 bits for configuration data register (CFR).

Command Set Defined by Command Register (CMR)

CMR

The following table shows the Configuration Register (CFR) Map.

CFR

To start the communication first the CFR data is sent.

ADC_config

Then the converted values are read. The ADC reference is connected to 3,4 V and the channel is reading the 2,5 V from a DAC7564 internal voltage reference.

ch1_2_5v_ref_3_4v_newspi_closeup

References

ADS8328 Datasheet

Code

Interfacing the DAC7564 to an MSP430

In this article I’ll try to show how to use an MSP430 with a DAC7564. This is probably the first from a series of articles showing different devices I plan to use in a project.

The DAC7564

The DAC7564 is a low-power, voltage-output, four-channel, 12-bit digital-to-analog converter (DAC). The device includes a 2.5V, 2ppm/°C internal reference. The device is monotonic, provides very good linearity, and minimizes undesired code-to-code transient voltages (glitch).  A DAC is said to be monotonic if the output either increases or remains constant for increasing digital inputs such that the output will always be a nondecreasing function of input. The DAC7564 architecture consists of a string DAC followed by an output buffer amplifier. An N-bit string DAC simply consists of 2N equal resistors in series and 2N switches (usually CMOS), one between each node of the chain and the output. The output is taken from the appropriate tap by closing just one of the switches. The string DAC is inherently monotonic—even if a resistor is accidentally short-circuited, output n cannot exceed output n + 1.

Linearity error of a converter is a deviation of the analog values, in a plot of the measured conversion relationship, from a straight line. The string DAC it is lineal if all the resistors are equal.

A glitch is a switching transient appearing in the output during a code transition. The worstcase DAC glitch (in R-2R) generally occurs when the DAC is switched between the 011…111 and 100…000 codes. In sting DACs only two switches operate during a transition, resulting in a low-glitch architecture Also, the switching glitch is not code-dependent.

The DAC7564 uses a versatile 3-wire serial interface that operates at clock rates up to 50MHz. The interface is compatible with standard SPI, QSPI, Microwire, and digital signal processor (DSP) interfaces.

The DAC7564 input shift register is 24 bits wide. Bits DB23 to DB16 are used for control and configuration and bits DB15 to DB4 for data. Bits DB0, DB1, DB2, and DB3 are ignored by the DAC. All 24 bits of data are loaded into the DAC under the control of the serial clock input, SCLK.

The DAC7564 receives all 24 bits of data and decodes the first eight bits in order to determine the DAC operating/control mode. The 12 bits of data that follow are decoded by the DAC to determine the equivalent analog output.

The write sequence begins by bringing the SYNC line low. Data from the DIN line are clocked into the 24-bit bits wide shift register on each falling edge of SCLK. After receiving the 24th falling clock edge, the DAC7564 decodes the eight control bits and 12 data bits to perform the required function, without waiting for a SYNC rising edge. A new write sequence starts at the next falling edge of SYNC.

Data Input Register Format

The first two control bits (DB23 and DB22) are the address match bits. The DAC7564 offers hardware-enabled addressing capability, allowing a single host to talk to up to four DAC7564s through a single SPI bus without any glue logic, enabling up to 16-channel operation. The state of DB23 should match the state of pin A1; similarly, the state of DB22 should match the state of pin A0. If there is no match, the control command and the data (DB21…DB0) are ignored by the DAC7564. That is, if there is no match, the DAC7564 is not addressed.  Both pins are connected to ground therefore those bits are 0.

Data Input Register Format

Data Input Register

LD1 (DB21) and LD0 (DB20) control the loading of each analog output with the specified 12-bit data value or power-down command. In the final setup the DAC will need to update each channel individually and at different times so Single-channel update will be used which implies having DB21 = 0 and DB20 = 1.  The final control bit, PD0 (DB16), selects the power-down mode of the DAC7564 channels as well as the power-down mode of the internal reference. In this application there is no concern over power savings so bit SB16 will be 0.

Load commands

Load commands

Bit DB19 must always be ‘0’.The DAC channel select bits (DB18, DB17) control the destination of the data (or power-down command) from DAC A through DAC D.

The final control matrix to be used is as follow;

Control matrix

The initial test are done using the internal voltage reference enabled by default. The DAC7564 includes a 2.5V internal reference with 0.004% Initial Accuracy (typ) and 5ppm/°C Temperature Drift (max). In the future a 4.096 V reference will be used and for that the internal reference need to be disabled. To do that a serial command that requires a 24-bit write sequence must be used.

The software

An MSP430 is used to send the data and the SPI communication is done by bit-banging. A library provides functions to send, receive and transfer data using SPI protocol. Being a bit-bang communication there is no particular hardware module necessary and any MSP430 would work, in this particular case a MSP430F2274 is used. The function send 8 bit at a time and the data needs to be rearranged before sending. The first byte (DB23…DB16) corresponds to the address, the load command, power down bit and the channel selection. The second byte (DB15…D8) corresponds to the eight most significant bits of the 12 bits DAC value. In the third and last byte the remaining 4 bits of the DAC value is sent. The image below shows a capture of the data pattern made using a logic analyzer.

 1024_chB_newspi_closeup

Testing

A Launchpad was used as an oscilloscope to see the DAC’s outputs (I don’t have a scope, I’m saving for one. If you have found the site useful, please consider making a donation and help me buy one 🙂). For the test the internal 2.5 V voltage reference was used and the microcontroller generated a ramp style signal and a couple of sine waves. The picture shows the DAC’s outputs (sampled at 55[Hz]).

sine_and_halfsine_delay_10ms

The sine waves are generated using a 256 points look-up table. For the green one the value from the table is divided by two.

1prueba

References

The data conversion handbook. Analog Devices Series Electronics & Electrical. Walter Allan Kester. 3 Ed. Newnes, 2005.

DAC7564 Datasheet.

Code

Recycling electronics component

Electronics components can be recycled from discarded gadgets. The problem resides in identifying the parts. The passive components might be labeled like the resistors or resistor networks.

Recycling electronics component
Others might not, like capacitors or ferrite beads but you can easily find out the value measuring them. The active devices can be quite difficult to find and sometimes even impossible, for example if you happen to come across a chip with a custom marking code.

Here I’ll show how I do it using a motherboard as an example.

Recycling electronics component
The big parts (SOIC, TSSOP, TQFP, etc.) are relatively easy to find, just Google the marking on the top of the chip. It doesn’t need to be the complete code name; some of the numbers and the package type or the manufacturer could be enough. The board has several of these big chips but the most useful parts would be:

A29040BL: 512K X 8 Bit CMOS 5.0 Volt-only, Uniform Sector Flash Memory

AS324: LOW POWER QUAD OPERATIONAL AMPLIFIERS

74HCT14D: Hex inverting Schmitt trigger

93C46: Atmel, Three-wire Serial EEPROM

RT9214: 5V/12V Synchronous Buck PWM DC/DC Controller

There are a lot of D-PACK devices. This package is intended for high power dissipation so these might be some sort of transistors or diodes. One of them has the code “09NG” and the ON Semiconductors logo. In this case is a well-known company but in case you find some weird logo there are several sites that might help you identify the manufacturer’s name by the logo. So, we have a code, the package and the manufacturer, anything else? Well, yes. The PCB’s silkscreen has the letters S, D and G around the device and this tells you that the part is a FET (Source, Drain and Gate). After googling all that information that part turns out to be a NTD4909, Single N−Channel Power MOSFET (30 V, 41 A).

Recycling electronics component

The other D-PACK has the code “65A3” and the same letters in the silkscreen so it has to be another FET. This one was somewhat tricky to find but eventually I did, is a CEP65A3 N-Channel Enhancement Mode Field Effect Transistor.

Recycling electronics component
There are also a couple of SOT-223 chips. Whenever I’ve found these parts in the past they usually were some sort of voltage regulator and this is not the exception. The silkscreen is a big giveaway, the pins are labeled I, O and A, that is Input, Output and Adjust and the code number correspond to a AZ1117, 1A LOW DROPOUT LINEAR REGULATOR with adjustable output.

Recycling electronics component
Moving on to the smaller devices you’ll see a lot of SOT-23 parts. For this sort of devices there are a couple of sites that will help you to identify them;

(1) http://www.s-manuals.com/smd

(2) http://clivetec.0catch.com/SMD_Codes.htm

In some cases different devices could have the same or very similar codes, that’s where knowing the package or the possible function pays off.

There is one with the marking code “12W” and the silkscreens shows that it is supposed to be a MOSFET. Looking for the code mark in (1) shows that it is a 2N7002 60 V, 300 mA N-channel Trench MOSFET. There is another part that should be a MOSFET and has the marking “L1”, from (1); SI2301BDS P-Channel 2.5 V (G-S) MOSFET.

Recycling electronics component
A couple of devices have the letters E, C y B around them showing that these are bipolar transistors. The markings code are T06 and T04, form (2) these devices are a PMBS3906 PNP and a PMBS3904 NPN general purpose transistor respectively.

Recycling electronics component
Another part has the letters A, K and AK around the pins but I didn’t realized at first was this might means. I looked for the marking code “A7W” in (1) and found out that is a BAV99 High-speed switching diodes. I searched for the datasheet and the letters made sense, it has two diodes inside with the anode of one connected to the cathode of the other forming that “AK” pin.

Recycling electronics component

I couldn’t find one of this SOT-23 parts in neither of the sites with the “EB2” marking. I recognized the logo on top of the package but only because I saw it a just moment earlier while searching for the “bigger parts”. It is not very clear but that’s the logo of Advanced Analog Circuits (I saw it in the AZ1117 datasheet). So, after doing a search with all this information I found the part; it’s an AN431, adjustable precision shunt regulator.

Recycling electronics component
Well, that’s all. This is all the stuff I managed to desoldered.

DSC07964-001

I leave several parts on the board and destroyed a few in the process, at one point I lost my patience and increased the hot air gun temperature melting some of the plastic parts and damaging a couple of capacitors. The excessive heat increased the capacitor’s inner pressure and a lot of gas came out of the capacitor valve. It might be a good idea to keep your face away from the capacitor pressure valve while desoldering…now I know that.

Hopefully someone will find some of this useful.

Adding Bluetooth to the MSP430 Launchpad

The National Semiconductor LMX9838 Bluetooth Serial Port module is a fully integrated Bluetooth 2.0 baseband controller, 2.4 GHz radio, crystal, antenna, LDO and discreets; combined to form a complete small form factor Bluetooth (BT) node[1] . I made a board (not my best soldering job) to connect an LMX9838 to a Launchpad and test it out. The circuit is really simple, the module needs a couple of resistor to set the baud rate (9600) and 3.3 volt, that it’s!

DSC07715-001

The basic circuit (just sending data) use  three wires; VCC, GND and the TX->RX connection.

Adding Bluetooth to the MSP430 Launchpad

After powering up the module is recognized by the PC as a Bluetooth Serial Port Device and the installation was pretty straight forward.Sin5

I programed the Launchpad (LP) using Energia but I wasn´t receiving the right data using the BT module. The circuit seemed to be fine so I tried with a simpler program that just send “hello world” every time I press the S2 switch. This is what I got:

comparacion

D is an MSP430G2452 using the LP serial interface to send the message, C is the same MCU with the BT module. The data was there but for some reason the BT module wasn’t sending the whole message. Then I changed the MCU and used an MSP430G2553 instead and A shows the LP serial interface and B shows the data received through the BT module.  It seemed like the BT module doesn’t like the software UART implemented in the MSP430G2452 but works fine with the hardware UART in the MSP430G2553. I connected the Open Bench Logic Sniffer to see what’s going on and the signals seemed to be the same with both microcontrollers. I analyzed the data stream with the software and there was a little difference between the signals.

uartsw uarthw

The first image shows that the baud rate using the MSP430G2553 with hardware UART is 9523, pretty close to 9600. The other one is the software UART and the baud rate there is 9090, a 5.31% difference that the BT module seems to not be able to handle.