This project is submitted for

Description

OpenGen is a DDS waveform generator which can generate sine and square waves put to 42.5MHz. It is in a rugged handheld case and has a built in power supply and Arduino-compatible microcontroller to allow it to function independent of a PC.

Details

R2 system design (zoom in or download the pdf from the dropbox link in the files section)

All design files can be found here or at the 'all project files' link in the sidebar. CAD files are in OpenGen/CAD files.

The following is now completely up to date with the new R2 design.

OUTPUT

OpenGen can output sine and square waves from 3kHz to 42.5MHz in increments of 0.0291Hz. The square output triggers from the sine so they cannot be different frequencies. There is a load switch (pushbutton controlling a relay) for each output to disconnect a load easily. The analog parameters (sine amplitude & offset, square duty cycle) are adjustable to an 8-bit resolution (2^8=256 steps).

Sine wave output: amplitude from ±39mV to ±10V and DC offset up to 10V. Note that the maximum output is just over ±10V so you cannot have maximum offset and amplitude at the same time. Maximum output current: 200mA.

Square wave output: selectable 3.3V or 5V peak voltage with adjustable duty cycle from 0.39% to 100% in steps of 0.39%. Maximum output current not rated (no info in the comparator's datasheet), but recommended >10mA.

POWER

There are two 3.7V lithium-ion 18650 cells inside OpenGen. First each cell goes through its own BQ29700-based protection circuit and then they are wired in series. The batteries power an LT3471 (dual switchmode power supply controller) which generates ±13V rails. Each rail then goes through a precision LDO to make them (collectively) low-noise ±12V rails. As well as this, there is a switching 5V digital rail and an LDO 5V analog rail.

Battery charging is handled by a BQ2057T 2-cell battery charger which charges the batteries at 1A. It requires an input of 8.5V or more (9V plug pack).

Power consumption is mostly dependent on the LCD backlight level and the output power. Specs will come in the future but a rough guide would be 1W minimum to 8W maximum.

PERIPHERALS

Frequency and other parameters are input using a 4✕4 membrane keypad (like this one). There is a 16✕2 character LCD (with an adjustable backlight) which displays the interface.

HARDWARE

The brains of OpenGen lie in an Arduino Pro Mini clone running an ATMEGA328 at 16MHz.

The Arduino Pro Mini clone interfaces with an ATtiny2313 which drives the AD9850 module. Having a separate microcontroller for the AD9850 module allows much faster update speed during frequency sweep mode.

The AD9850 is wired in a parallel configuration to the ATtiny2313 to allow maximum frequency update speed. For the same reason, the ATtiny2313 is clocked at 20MHz.

The LCD is a standard '1602' type (16 columns and 2 rows of characters). It is controlled over I2C using a PCF8574 port expander.

The sine output of the AD9850 first goes through an automatic gain control (AGC) circuit which takes a 300mV-1V pk-pk input and gives a 3.6V pk-pk output. After that it goes through an analog multiplier which controls output amplitude, and then a high-speed power amplifier. The power amplifier is a THS3001 (A=2.5) and THS3095 (A=2) 'daisy-chained' to give a gain of 5.

The square wave is generated by a comparator (TLV3501) which takes the sine wave AGC output and an input from the MCU which controls duty cycle. The power is switched by an adjustable precision LDO and an analog switch.

SOFTWARE

The software for the main MCU will be written in the Arduino IDE and therefore will be easily adaptable. It can be uploaded using the ISCP header on OpenGen (be sure to remove the PROG jumper link). The software for the ATtiny2313 will be written in Atmel Studio to allow access to lower-level functions to speed up operation. It can also be uploaded in a similar fashion with a different ICSP header.

Due to the nature of the software-controlled AGC (Automatic Gain Control) in OpenGen, the lowest frequencies (i.e., sub 100Hz) are already attenuated by around 5.7dB, reducing the level of further attenuation...

Project Logs

I've been really busy recently, and I doubt I'll have much time soon. Along with that, this project won't actually be very useful to me and there are several (simpler) ones which I am doing. Therefore, I'm 'pausing' this project: it's no longer actively under development but I might continue in the future.

I have made sure the Dropbox link to the KiCad files is up to date, so if anyone wants to use the project they are welcome to.

It's been quiet for a while, so I wanted to give people an update. OpenGen itself is currently not being developed, because I have put it on hold while I work on another project which will be critical to its functionality- the BTI framework. Since OpenGen will generally be pretty small, the interface will be very limiting; a 1602 LCD won't be able to display all the information necessary and it would require a more processing power and mucking around with cutouts (I don't like cutting out display windows) to add a graphic LCD. Instead, OpenGen will be controllable over Bluetooth by a phone, tablet or dedicated BTI interface. This will allow a simpler and easier flow of operation.

The final amplifiers in the output stage for the sine signal will now be the THS3001 and the THS3095 with gains of 2.5 and 2, respectively.

The output parameters will be written to the EEPROM when entered and loaded next time the device is booted.

The load disconnect switches will also feed two ADC pins on the ATmega328. When the load is disconnected, all circuitry that is not needed for the disabled channel is powered down to improve battery life. If both outputs are disconnected, the analog power rails will be shut down, drastically decreasing the load on the battery.

The AD9850 itself will be driven by an ATtiny2313A in a parallel configuration. The ATtiny2313A will only drive the AD9850 (and nothing else), which will enable a maximum of slightly over 9.5 million frequency updates per second when in frequency sweep mode. It will be programmed over I2C and this will only be possible when the interrupt pin is pulled high.

The two MCUs will probably be programmed with Atmel Studio (free software provided by Atmel) rather than Arduino to allow me to reduce the firmware size (and increase the speed of execution). I haven't decided whether to do this with both of them, but I will definitely do it for the AD9850 controller as it will improve its speed. I will still publish the source and the hex files so you can modify it!

R2 of OpenGen has been going well so far. I have made plenty of changes:

I will need a four-layer board for the fast analog parts, which provides easier power supply routing and much better grounding. However, they're expensive and I don't need one for everything else (control and peripherals), so there will be a larger (and cheaper) two layer board connected to the 4-layer one by a board-to-board interconnect.

The amplitude and offset adjustments for the sine output and the duty cycle adjustment for the square output will now likely be 8-bit resolution rather than 12-bit as they will be taken from the microcontroller's PWM outputs.

I will add a battery low indicator light (6.2V) and a FET switch that shuts down the device when the battery is critically low (6V). The FET will initially be set high by a 'soft' power button and from then on by a comparator. When the battery drops below 6V, the FET shuts off and the user must charge the battery to make the device stay on when they press the power button.

There will be some changes to the output stage to allow it to provide ±10V at 42.5MHz (the THS6022 did not have a high enough slew rate). Exact changes TBC.

I will add two load-disconnect switches (one for each output channel). These will control latching relays on the outputs of the op-amp and comparator. There will also be an 'active' LED for each channel. This indicates whether there is an output which can be connected, i.e., whether the channel is disabled in software (and therefore in a low-power shutdown state). If both channels are disabled in software (by the user or at startup), the analog supply rails will go into a shutdown state to save power.

The other day I realised, looking at the THS4631 (output amplifier) datasheet, that the frequency response with a gain of 75 was going to be awful. I thought about maybe having a quad op-amp, each one multiplying by the 4th root of 75 and feeding into the next, but that was a no-hoper too. Finally, I think I have found a solution thanks to this thread on the ever-useful EEVblog forum:

The amplitude of the AD9850 varies with frequency from 1V pk-pk to 300mV or less. I needed some sort of AGC to correct the amplitude to be stable for all frequencies, and the answer was the AD633, a variable gain amplifier. This will output a 1.4V pk-pk sine wave at all frequencies with a few external components. This will then go into a multiplying amplifier: the ADL5931. This takes the sine wave and multiplies it with the output of a 12-bit DAC, giving an output amplitude of 1mV to 4V pk-pk. Finally, this will be combined with a DC offset from another DAC and amplified by two consecutive amplifiers (one is the THS4631, other TBC) with a gain of 2.5 and 2 in that order.

I'm a firm believer in the principles of open source hardware and software. They stop people wasting their time designing similar parts and encourage people to share what they have produced with the world. Of course, there are limitations. Not everyone can use the source (i.e., compile the software or manufacture the hardware). However, even if this is the case, the source is still available and that's what counts.

Another point worth making is that while it may be technically correct to just dump your design files and call your design 'open', it isn't truly open in that people don't know what they're looking at, or how it works. For something to be completely open, there has to be comprehensive documentation which covers operation and functionality.

Why am I rambling on about this? Well, this project has now been entered for the Hackaday Prize, one of the criteria for which is openness. OpenGen is open source hardware, but alongside that hardware there is full documentation that is continually evolving and improving. Furthermore, the software (when it is completed; some is already written) will be open source as well, built on the open source Arduino IDE and well documented throughout through the use of comments.

All aspects of OpenGen are Public Domain, meaning there are no limitations on how you can use them. Knock yourself out!

I have just uploaded a link to the Dropbox folder containing all the design files so far (no PCB yet). The schematic is still unfinished, but it's getting there, and the online file will update as soon as I save a new version of the original.

I have decided to use an analogue switch for attenuation selection because they are cheaper, have a very high -3dB bandwidth and have a minimal capacitance between contacts. I chose the ADG734 which is a quad SPDT switch: 2.5ohm on resistance and 160MHz bandwidth. The larger on-resistance will slightly affect accuracy but not much. I may make some of the smaller attenuation resistors 3 ohms lower or so to try and negate the effect. Since there are 8 attenuation bits, there will be two ADG734s, probably controlled by a 74HC595 shift register rather than another PCF8574 (which is used for the LCD); they are one fifth the price.

I am also following rob77's suggestion on this thread to wire the keypad up so that only one ADC pin is required to read it. This will save me another PCF8574, so the only one being used now is on the LCD.

These changes should appear automatically in the Dropbox folder linked on the project page.