Greetings, YouTubers. Here is the guy with a Swiss accent again.
In episode number 23,
62, and 70, we took care that we optically see everything on our boards.
But we are not watchmakers who work with small mechanical parts.
We work with invisible electrons.
How to make them visible is the topic of today's episode.
One of my projects is an electronic dummy-load, with a few nice features.
I want a nice display,
and I want also to have a locking function that transmits the measured values of a time to a
computer. I could build such an electronic load from scratch,
But I saw in a video of VoltLog that Banggood and others sell a very good and extremely cheap device.
Which fits part of my expectations. VoltLog even did a reverse engineering of the analog parts.
He did not cover the parts I am interested in most: the display.
To reach my goal, I have to replace the display and the buttons by my own
microcontroller and a next-gen display.
Fortunately the display is connected by a 10-pin connector to the mainboard,
So let's disconnect it and connect it through homemade adapter cables. These cables
have a male and a female end, which are both connected, and
for each lead, it has a tap in the middle to connect to your analytical instruments.
Let's start to make the invisible visible.
The easiest way to do this is to use a multimeter.
They usually can measure at least volts, amperes, and Ohms.
This helps us already a lot to make the invisible visible.
For example, if we want to know if the display runs on 3.3v
or 5v logic, we just measure the voltage of the VCC pin, or if we want to check if the module
draws some current, we measure the ampere and
of course, very important, if you want to check if two
points are really connected, we measure the ohms between the two. Very handy is also the beeper in most of the
multimeters, which signals us if the pins are connected,
without looking at the meter.
With this method we find the ground pins,
the two pins of the rotary encoder, the pin of the push-button of the rotary encoder, and the run button.
Please be aware that you have to disconnect your PCB from power if you measure ohms,
otherwise you get wrong results or
you destroy even parts of your multimeter.
So we already found the meaning of seven of the ten pins. Very good!
But these meters have limitations.
The most important one for debugging our devices is that they are very slow
if I want to know if a button is pressed, I have to wait a moment till I get
the result. If the button is frequently pressed, you quickly get wrong results,
and you cannot determine when the button is pressed and when not. If we connect our
multimeter to the remaining three pins, we even get a negative reading,
which is not possible in a 5-volt logic system.
This has to do that these multimeters are not made to handle
fast-moving
voltages. This is why oscilloscopes were invented.
They are more expensive than the multimeters, but have a big advantage:
they show us the voltage over time.
If we connect now an oscilloscope to the same button,
we see exactly what's happening. Oscilloscopes can measure also much, much faster
signals; up to many megahertz or even gigahertz, if you are able to spend the money.
Today we concentrate on our normal microcontroller stuff. There, a small oscilloscope like this one is usually sufficient.
Oscilloscopes can only measure voltage. We have to use a trick to measure current; I will show this in a future video.
Oscilloscopes as
multimeters show us the exact analog measurements. If we look at a sine curve
we see all its different voltages on our display, but currently we do not see a lot. An
important function of such oscilloscopes is the trigger. You can set the trigger that
it places the point where the signal crosses. For example, the 1v border to the middle of the screen.
With this trick we get the standing sine signal, which is much better for analysis.
You can buy oscilloscopes with two or four channels: the more the better,
but also the more expensive. With oscilloscopes, we can debug many problems on our devices.
Let's continue with the remaining three pins.
Immediately, we see that three of these pins carry fast-changing signals.
Maybe these signals are somehow synchronized.
Unfortunately my oscilloscope only has two inputs, so at least I can look at two signals at the same time,
but I don't see a lot. The voltage changes fast and other way the sine signal before
Also, the trigger function does not really help.
We see that the two signals are somehow synchronized, and there are packets of change.
Now another important function of the oscilloscope comes to help us.
The storage function. Most of the numerous oscilloscopes are called digital storage oscilloscopes, or
DSOs.
They have the capability to store the signal for better analysis.
So let's use this function. With the press of a button,
many things become clearer. We see that one package has a pattern in itself, and
if we have a closer look, we see that one signal has a quite regular pattern and the other not.
These signals are typical for serial bus connections like i2c or SPI.
The lower signal, then, would be the clock, and the upper signal would be the data line.
But now we come to the limitations of our oscilloscope.
We have no clue which protocol is used and which data are transferred.
Some more expensive DSOs offer the capability to decipher the data on these lines.
However, I do not like this function because it's usually
complicated to use.
Fortunately we have a much better instrument to solve this problem: the logic analyzer.
As its name says, it helps to analyze logic signals.
When I was young, these devices were extremely expensive and not affordable for a larger community. Today,
it's different. You can buy a very small box and hook it to your PC.
There are even the really cheap clones available, but of course you are not allowed to use the software with these devices,
even if suppliers claim that it works. These devices can monitor eight or sixteen channels in parallel. As
the name says, they only show logical levels. If we connect our two channels to the logic analyzer,
we see the following curve.
Because we can sample along a period, like five seconds, we get a pretty good overview, and
we also can zoom in to the detail.
This is a clear advantage over the oscilloscope.
However, if we connect our sine wave from before, we only see a digital signal, which gives us a complete
wrong impression, even if it shows us that its frequency is 1 kilohertz. But let's continue with our
re-engineering.
We discovered now that we have three different signals,
which are somehow synchronized. Now, we use another big advantage of these logic analyzers. We have many different
decoders built in. As we saw before, two of the signals might build an i2c channel.
One being the SCL, and the other being the SDA pin.
The SCL is the clock, and therefore it has to be more regular than the other.
Let's check by enabling a decoder for the two signals, and really we get valid signals.
The analyzer shows us
where one byte begins, and where it ends. We also always see an address and the data byte,
one after the other.
But we see also
unrecognized bytes without begin and end marks. We count four valid address-data pairs.
Let's add now the third pin. Here,
we have a similar situation,
and we see that the valid bytes of one channel are where the invalid part of the other channel is.
So with the help of this tiny device, we were able to find out how the mainboard communicates with the display board,
but we still have no clue about the meaning of the individual bytes.
So we can read the letters, but we do not know the language.
In order to find out about the language, it is easiest to know the receiver.
Unfortunately looking at the display, we see no chips.
So here another friend has to help us. Our soldering iron to desolder one of the displays and
Really we find the chip: it is a Titan TM-1650.
Not really a well-known chip, and the only documentation is in Chinese.
So we have to bother a next tool, Google Translate. With its help,
we can read the data sheet and start to decode the language. Because we have two channels,
We assume that each of the two i2c channels is connected to one chip,
which then drive the seven digits plus the different LEDs. Each chip then drives four digits,
with accords with the number of bytes found earlier.
Now we can start to select very distinct display
combinations to find out which code is sent through the channels and which digit is displayed at which place of
the display, and
finally we have to find out the codes for the LEDs.
Not an easy work, but feasible with the help of our logic analyzer.
This is the end of our
re-engineering effort for the display. As always, I post the links to the results in the comments.
Summarized: we have started our re-engineering with our multimeter, which is capable of measuring voltage, current, and resistance.
Especially the
resistance measurement helps us in finding which devices are
connected to which pins, and we found out that the display uses 5v and not 3.3v logic.
But because multimeters are slow, we used our
DSO to find out about the different fast moving signals on some pins. Here,
we clearly needed the storage function of the oscilloscope.
We found out which pins carry fast moving signals and also who is the originator, the
main board, or the display. We saw also that the signals were digital and not analog,
but because the signals were not very regular,
we were not able to further decode them with the oscilloscope. To do that, we had to use a logic analyzer.
With its help we found out that the connection between the main board and the display
consists of two parallel i2c
buses, with a common SCL line.
we had to desolder one of the displays to find the name of the display driver chips, and
together with Google Translate and a lot of time,
we were able to decode the whole protocol. In the next episode,
we will use all this knowledge and start to build our own
microcontroller and display. Because I want to have a locking function, I will use an ESP8266
chip. Because it does not exist,
we have to build an i2c slave functionality. We have also to understand
how a rotary encoder works, and also to emulate one in software.
To build all of that,
we will use our best friend in Arduino
development, the serial monitor, to provide us with an debugging information.
But because we will work with fast moving signals and interrupts, we have to learn how to use our logic analyzer
for software development. Stay tuned.
I hope this episode was useful or at least interesting for you. Bye