Inside Electronic Gain Control

Normally, if you want to control the gain of an amplifier, you’ll use a variable resistor. You know, like a volume control. But what if you want to control the amplifier’s gain with a voltage? [Engineering Prof] explains a circuit that can do this using a pair of op amps and a pair of matched JFETs.

The analysis is simple because you assume the op amps are not in saturation, so you can assume that the op amp will do what it needs to do to make the input terminals equal. The left-hand op amp has one input grounded, so the output will drive the first FET  to ensure the negative terminal is also 0V. It is easy to see that the current through R1 must then be the current through the FET, which is going to be the control voltage (which is negative) divided by R1.

Continue reading “Inside Electronic Gain Control”

Repairing An HP Power Supply

One of the interesting things about living in modern times is that a confluence of the Internet and rapid changes in the electronics industry means that test gear that used to be astronomically priced is now super affordable. Especially if, like [Frankie Mashockie], you can do a little repair work. He picked up an HP6038A power supply for $50. We couldn’t find the original list price, but even refurbs from “professional” sources go for around $800. However, the $50 price came with a “for parts” disclaimer.

The power supply is autoranging. You usually think of that as a feature of meters. In a power supply, autoranging means the device can adjust the voltage based on load as you can see explained in the video below.

Continue reading “Repairing An HP Power Supply”

Quick Negative Voltage For An Op Amp

It is a classic problem when designing with op amps: you need the output to go to zero, but — for most op amps — you can’t quite get down to the supply rail. If your power options are a positive voltage and ground, you can’t get down to zero without a special kind of op amp which might not meet your needs. The best thing to do is provide a negative supply to the chip. Don’t have one? [Peter Demchenko] can help. He uses a simple two-transistor multivibrator along with some diodes and capacitors to generate a minimal negative voltage for this purpose.

The circuit is simple and only produces a small negative voltage. He mentions that into a 910 ohm load, he sees about -0.3V. Not much, but enough to get that op amp down to zero with a reasonable load. Unlike other circuits he’s used in the past, this one is efficient. With a 5-volt input, it draws less than 1.5 mA.

Continue reading “Quick Negative Voltage For An Op Amp”

The Nintendo Switch CPU Exposed

Ever wonder what’s inside a Nintendo Switch? Well, the chip is an Nvidia Tegra X1. However, if you peel back a layer, there are four ARM CPU cores inside — specifically Cortex A57 cores, which take up about two square millimeters of space on the die. The whole cluster, including some cache memory, takes up just over 13 square millimeters. [ClamChowder] takes us inside the Cortex A57 inside the Nintendo Switch in a recent post.

Interestingly, the X1 also has four A53 cores, which are more power efficient, but according to the post, Nintendo doesn’t use them. The 4 GB of DRAM is LPDDR4 memory with a theoretical bandwidth of 25.6 GB/s.

The post details the out-of-order execution and branch prediction used to improve performance. We can’t help but marvel that in our lifetime, we’ve seen computers go from giant, expensive machines to the point where a game console has 8 CPU cores and advanced things like out-of-order execution. Still, [ClamChowder] makes the point that the Switch’s processor is anemic by today’s standards, and can’t even compare with an outdated desktop CPU.

Want to program the ARM in assembly language? We can help you get started. You can even do it on a breadboard, though the LPC1114 is a pretty far cry from what even the Switch is packing under the hood.

Porting CP/M To A Z80 Thing

It is hard to describe the Brother SuperPowerNote. It looks like a big old Z80-based laptop, but it says it is a notebook. The label on it says (with lots of exclamation marks) that it is a word processor, a communications system, a personal scheduler, and a spreadsheet organizer. Brother also promises on the label that it will “Increase your power to perform on the job, on the road or at home!” Plenty of exclamation marks to go around. The label also touts DOS or Windows, but [Poking Technology] didn’t want that. He wanted CP/M. See how he did it in the video below.

This is a very early laptop-style word processor with a floppy and a strange-looking screen. It also had serial and parallel ports, odd for a word processor, and probably justified the “communication system” claim on the label.

Continue reading “Porting CP/M To A Z80 Thing”

X86 ENTER: What’s That Second Parameter?

[Raymond Chen] wondered why the x86 ENTER instruction had a strange second parameter that seems to always be set to zero. If you’ve ever wondered, [Raymond] explains what he learned in a recent blog post.

If you’ve ever taken apart the output of a C compiler or written assembly programs,  you probably know that ENTER is supposed to set up a new stack frame. Presumably, you are in a subroutine, and some arguments were pushed on the stack for you. The instruction puts the pointer to those arguments in EBP and then adjusts the stack pointer to account for your local variables. That local variable size is the first argument to ENTER.

The reason you rarely see it set to a non-zero value is that the final argument is made for other languages that are not as frequently seen these days. In a simple way of thinking, C functions live at a global scope. Sure, there are namespaces and methods for classes and instances. But you don’t normally have a C compiler that allows a function to define another function, right?

Turns out, gcc does support this as an extension (but not g++). However, looking at the output code shows it doesn’t use this feature, but it could. The idea is that a nested function can “see” any local variables that belong to the enclosing function. This works, for example, if you allow gcc to use its extensions:

#include <stdio.h>

void test()
{
   int a=10;
   /* nested function */
   void testloop(int n)
   {
      int x=a;
      while(n--) printf("%d\n",x);
   }
   testloop(3);
   printf("Again\n");
   testloop(2);
   printf("and now\n");
   a=33;
   testloop(5);
}

void main(int argc, char*argv[])
{
   test();
}

Continue reading “X86 ENTER: What’s That Second Parameter?”

Can Google’s New AI Read Your Datasheets For You?

We’ve seen a lot of AI tools lately, and, of course, we know they aren’t really smart, but they sure fool people into thinking they are actually intelligent. Of course, these programs can only pick through their training, and a lot depends on what they are trained on. When you use something like ChatGPT, for example, you assume they trained it on reasonable data. Sure, it might get things wrong anyway, but there’s also the danger that it simply doesn’t know what you are talking about. It would be like calling your company’s help desk and asking where you left your socks — they simply don’t know.

We’ve seen attempts to have AI “read” web pages or documents of your choice and then be able to answer questions about them. The latest is from Google with NotebookLM. It integrates a workspace where you can make notes, ask questions, and provide sources. The sources can be text snippets, documents from Google Drive, or PDF files you upload.

You can’t ask questions until you upload something, and we presume the AI restricts its answers to what’s in the documents you provide. It still won’t be perfect, but at least it won’t just give you bad information from an unknown source. Continue reading “Can Google’s New AI Read Your Datasheets For You?”