HP07 Digipot Interface Module


This is the first product design work that I have done and I did it for the auxiliary project (also called mini-project) required for my bachelor’s degree in my 7th semester. From the outset, I had one idea set firmly in my mind – “my mini-project should be a mini-product”. So, I wanted to create a module and spent 2 months designing an RF transceiver. In the very end, I realized I couldn’t fabricate it at home and had to scrap that idea. But, I was certainly not gonna back out and then this one came to me.

This idea is an interface module for digital potentiometers. Digital potentiometer ICs are those which enable you to control a potentiometer (simply a variable resistance) digitally. It is used in applications like digital control of an amplifier’s gain (especially for instrumentation, isolation amplifiers), voltage references etc. The snag is, most common digital potentiometer IC’s use an Up/Down counter interface that many hobbyists would need time to get around. So this module is designed to provide a selectable parallel/serial interface to the user. Also there is an on-board DIP switch that can be used to set a resistance directly. For example, if I had a mechanical potentiometer and wanted to set a particular resistance, it would be impossible to do so without measuring it. In this module, if you provide the correct binary code on the DIP switch, the resistance is set to that value automatically.

This article is about my experience of the ‘product development life cycle’ that was required to make a working prototype of the module. In the beginning, I spent a couple of days on finalizing what my module should have and should do. Once I settled that, I chose to use the ATTiny861 micrcontroller as the brain of the module. Then, I began writing the code for it and simulating it in Proteus. After several bouts with the USI (Universal Serial Interface), PCINT (Pin Change Interrupts) and WDT (Watch Dog Timer), I finally got a working version of the program in simulation.


Then came the breadboard where I soon realized that the simulation wasn’t exactly accurate. I had to make subtle changes to perfect the design. Over the course of another day with repeated testing (using the NI myDAQ), I completed and finalized the complete working version of the embedded C code for the microcontroller. Subsequently, the schematic or circuit diagram was also finalized.

20151009_195234 20151008_213208

The next step in the design process, is the PCB design. Since, I was creating a module, I wanted the PCB to be very compact and dense. I ended up creating a 34mm by 42mm double layer board using EagleCAD and the layout looked like this:


After this comes PCB fabrication and I did this in my own ‘facility’. I printed of the two layers of the PCB and transferred the routes to a copper board.

20151015_185832Since it is a double sided board, I transferred the top layer on one side of the copper board first. Used that as a reference and drilled necessary holes onto the board. Now I aligned the copper board holes with holes on the bottom layer paper and then transferred the back layer as well.  The  Toner transfers are not always perfect and so after some heavy correction work, this is what the bare board looked like:

20151016_143405   20151016_143415

Since I have already written an article about PCB Fabrication at home, I am gonna skip past that. But just for the sake of mentioning, the process continues with etching followed by mask removal, trace corrections, via connections, tinning of pads, component assembly and soldering (simultaneous trace and continuity corrections too). After a lengthy spell of hands-on work, the module was finally complete.


Now, the last phase of design – final testing. I connected the P/S mode select, DIN and CLK pins to the myDAQ for providing the necessary signals. I also used the myDAQ for measuring the resistance similar to the way I tested the breadboard version.

20151018_181438 20151018_205214

And to my great joy and disbelief, it worked. Here is a demonstration video:

Thus, I finished my very first product. I went through all typical stages of a product design and now I am generating the gerber files to have it manufactured and eventually sell a few, if possible. Since no true design process is complete without documentation (ofcourse I wasn’t gonna leave that), I have attached my user manual for the HP07 Digipot Interface Module.


Digital Clock built from Flip-Flops


This ,circuit as such, is arguably the most difficult and extensive project I have ever done till date. In fact, it actually took me 2 meters of wires for the connections, almost 17 IC’s, 3 days of continuous working and not to mention a month of Boolean calculations. But then and again, I enjoyed every second of it!

I posted the details of the construction along with the circuit itself at my Instructables page (another blog like page of mine where step by step instructions of projects will be there):  http://www.instructables.com/id/Digital-Clock-Sequential-Logic-Design/

This blog, however, is aimed only to tell what one can find in that link.

While most other hobbyists use micro-controllers to build digital clocks, I went a step backward (more basic) and did the same using flip flops. Micro-controllers themselves contain a lot of flip-flops. But what is a flip-flop and what are the different types? How do you design a circuit with them? I have answered all these questions in that link.

I have literally covered sequential logic design by using the digital clock and its various sub-circuits as examples. It even has an alarm function. It is difficult compared to the alternate ways like Arduino etc., but it’s fun if you love electronics!

I think all the IC's can be seen!

I think all the IC’s can be seen!


The Counter Experiments


Before I attempted to make the digital clock, there was a series of experiments that I did with counters. This coincided with one of my third semester courses – Digital Electronics which introduced me to the fundamental principles and logic required to design various counters.

Since explaining the logic behind these counters is a bit tricky, I have skipped them in this article. However, I have discussed the design (how to do) of such counters with their logic, state tables etc., in this link.

For all these counters, the 555 astable multivibrator (my personal favorite) provides the necessary clock signals. IC7447 is used to display the binary data, generated by the counter, to the 7 segment common anode displays.

0-7 Asynchronous T-FF Counter:

I used the IC7476 JK Flip Flop IC as a T Flip Flop and implemented a 3 bit counter. Since it is 3 bits, it counts from 0 (000) to 7 (111) and cycles back to 0.

0-5 Asynchronous T-FF Counter:

Since these experiments were in the lead up to the digital clock, I would need a 0-5 counter for the 10’s position in minutes and seconds. Applying a reset condition achieves this. This counter is essentially the 0-7 counter again but with a setting to reset the counter to 0 everytime it goes to 6. So the counter goes from 0 to 5 and instead of 6, it goes back to 0.

0-5 Synchronous D-FF Counter:

A synchronous counter is one in which each flip-flop is given the same clock signal. It is also far more complicated to design than asynchronous counters due to the requirement of combinational logic to go with the flip-flops. The positive edge triggered D Flip Flops available in IC7474 are used.

Comparing this with the 0-5 asynchronous counter, one can see that synchronous logic is obviously more complicated.eo:

0-9 Asynchronous T-FF Counter:

A 0-9 counter would require 4 bits. A 4 bit counter, without any reset condition, would count from 0 (0000) to 15 (1111). For a 0-9 count (1’s position in the minutes and seconds), the reset condition is set for 10. So the counter counts from 0 to 9 and then clocks back to 0.

0-9 Synchronous D-FF Counter:

This is one of the most complicated circuits I have ever attempted. The logic behind this counter is quite difficult, as can be seen from how dense the board looks. This clearly shows that synchronous logic is not the easy route. But one point that has to be made is that, synchronous counters can be designed to count in a required way i.e., 1 need not necessarily follow 0. Synchronous counts can be 0 then 6 then 2 then 5 and back to 0 (in a circular manner). This flexibility, not possible in asynchronous logic, comes with its inherent complexity.

0-9 Counter using 7493:

Since counters are so useful and simple, the asynchronous counter has been fabricated on single chip ICs.  One such IC is the IC 7493. Since using discrete flip-flop based counters like the ones above is out of the question when making a digital clock, these counters come in handy.

0 – 99  Counter using 7490 & 7493:

Another counter chip is the IC 7490. The differences between 7490 and 7493 are subtle with the 7490 being more general purpose in my opinion. These can be connected in such a way that one counter IC feeds the necessary clock signal for the other IC (asynchronous logic) to count in a decimal way.

1 – 12 Asynchronous Counter:

Asynchronous counters can count only in a sequential way but the doesn’t mean it can be designed to come back only to 0. This 1-12 counter, representing the hours in a clock, uses the T flip flops to count to 12 and reset at 13 but all bits except the LSB (least significant bit ) are reset. In other words, the counter counts to 12 (1100) and then counts to 13 (1101). When 1101 is detected, the first 3 bits are alone reset to give (0001) or 1. Thus achieving a 1-12 counter. Since the reset happens so fast, in any of these counters the reset trigger value is never seen just like how 13 is never seen here.

Johnson Counter:

Counters need not just be about numbers. In fact many of the decorative lamps that on and off in a musical way are based on such counters and logic. A special counter, called a Johnson counter provides an interesting display when 4 individual LEDs represent the 4 bit data.

These experiments with counters gave the experience and knowledge that carried on into making my breadboard level flip flop based digital clock, later on.