2024/12/31

2024/12/30

Beyond The Basics: Exploring Exotic Scope Trigger Modes

 Beyond The Basics: Exploring Exotic Scope Trigger Modes

by: Al Williams

Will Rogers once said that veterinarians are the best doctors because their patients can’t tell them where it hurts. I’ve often thought that electronic people have a similar problem. In many cases, what’s wrong with our circuits isn’t visible. Sure, you can visually identify a backward diode, a bad solder joint, or a blown fuse. But you can’t look at a battery and see that it is dead or that a clock signal isn’t reaching some voltage. There are lots of ways to look at what’s really going on, but there is no substitute for a scope. It used to be hard for the average person to own a scope, but these days, it doesn’t require much. If you aren’t shopping for the best tech or you are willing to use it with a PC, oscilloscopes are quite affordable. If you spend even a little, you can now get scopes that are surprisingly capable with features undreamed of in years past. For example, many modern scopes have a dizzying array of triggering options. Do you need them? What do they do? Let’s find out.

I’ll be using a relatively new Rigol DHO924S, but none of the triggering modes are unique to that instrument. Sometimes, they have different names, and, of course, their setup might look different than my pictures, but you should be able to figure it out.

What is Triggering?

In simple terms, an oscilloscope plots time across the X-axis and voltage vertically on the Y-axis. So you can look at two peaks, for example, and measure the distance between them to understand how far apart they are in time. If the signal you are measuring happens repeatedly — like a square or sine wave, for example — it hardly matters which set of peaks you look at. After all, they are all the same for practical purposes.

Pretty square waves all in a row. Channel 2 is 180 degrees out of phase (inverted). But is that all there is?

The problem occurs when you want to see something relative to a particular event. Basic scopes often have level triggering. They “start” when the input voltage goes above or below a certain value. Suppose you are looking at a square wave that goes from 0 V to 5 V. You could trigger at about 2.5 V, and the scope will never start in the middle of a cycle.

Digital scopes tend to capture data before and after the trigger, so the center of the screen will be right on an edge, and you’ll be able to see the square waves on either side. The picture shows two square waves on the screen with the trigger point marked with a T in the top center of the display. You can see the level in the top bar and also marked with a T on the right side of the screen.

What happens if there are no pulses on the trigger source channel? That depends. If you are in auto mode, the scope will eventually get impatient and trigger at random. This lets you see what’s going on, but there’s no reference. If you are in normal mode, though, the scope will either show nothing or show the last thing it displayed. Either way, the green text near the top left corner will read WAIT until the trigger event occurs. Then it will say T’D.

What’s Wrong with Edge Triggering?

Edge triggering — triggering when voltage goes above or below some trigger point — is tried and true. Why go beyond that? Well, the picture above is a little misleading. Watch the video below and see if you notice anything odd.

Video Player
00:00
00:05

The square waves are as they appear in the still picture, but there is a little flickering. That’s a clue that something else is going on, but what? Well, using different triggers, we can investigate further.

Let’s speculate that one of the signals may be getting stuck briefly. Maybe that’s a sign that something is wrong. Or maybe it is supposed to be like that, and we want to verify it. You can set up a timeout trigger.

This is what causes the flickering!

This timeout trigger tells the scope that if the signal stays low after a falling edge for too long, it should trigger.  You can pick the level — the voltage that indicates a falling edge and the timeout. Note the scope is in normal mode, so nothing will show until the scope triggers (or, at least, nothing will update). The result?

Turns out the signal source pauses just a little bit every so often. Hard to see in the video, but crystal clear now that the trigger is set to detect it.

More Triggers

There are other ways to detect this pattern, too, especially once you know what to look for. For example, you can use the delay trigger to note when there is a long gap or look for a pattern where both signals are low. You can even move where the trigger occurs by modifying the timeout. Finally, since the event occurs every 100 pulses, you can simply count pulses. That’s sort of cheating, but if you had some other thing you wanted to sample on a specific number of pulses, it would be worthwhile.

You can see the different configurations below. The output screen will look more or less the same, with just slight variations on exactly where the trigger point occurs.

Triggers on Data

A digital waveform decoded as RS232 and triggering on a capital H character

Most modern scopes have — at least as an option — a way to decode data using different protocols. For example, the scope can interpret RS232, CAN bus, I2C, SPI, and so on. It isn’t uncommon to have a way to trigger when specific data appears on a decoded bus.

Sometimes, you really do want to see the bus, but you might also want to look at some other signals when the bus triggers. The example in the images shows a serial port sending out “Hackaday” and a count. The scope is triggering on a capital “H.” While the scope input, in this case, is digital, this works on an analog signal, too.

Serial trigger setup

Each mode will be a little different, but, in general, you’ll need to set the threshold if you are using an analog input and if the data is inverted or not. You’ll also provide any specific parameters for the protocol, like baud rate and number of bits, of course. In this particular case, the scope can trigger on data or certain conditions like framing errors or a start bit.

Of course, each scope is different, and each protocol will be slightly different, too. Sometimes, the biggest value of this is not so much looking at the data stream but, instead, using the data trigger to look at other, possibly analog signals simultaneously.

Not Just for Digital

So far, the trigger data has been more or less digital pulses. However, sophisticated triggers exist for things like slope. To work with that, I used a little extra circuitry. Next time, we’ll look at runt triggers, slope triggers, and another digital trigger for setup and hold violations.

All of these various waveforms were created using a few different C++/Arduino programs on a Raspberry Pi Pico. You can pick up the code in a Gist if you want to try it out for yourself.

Todays Thought

The past is a foreign country; they do things differently there. 

-L.P. Hartley, writer (30 Dec 1895-1972)

2024/12/29

The Simple Trick That Rules Biology

Here Are the Secret Locations of ShotSpotter Gunfire Sensors

 Here Are the Secret Locations of ShotSpotter Gunfire Sensors

The locations of microphones used to detect gunshots have been kept hidden from police and the public. A WIRED analysis of leaked coordinates confirms arguments critics have made against the technology.

By Dhruv Mehrotra and Joey Scott

The gunshot-detection system ShotSpotter has for years drawn criticism from activists and academics who believe the company behind the system, SoundThinking, places its microphone sensors primarily in low-income communities of color. Now, a WIRED analysis of data leaked from the company reveals the secret locations of ShotSpotter sensors around the globe and the US communities most directly impacted by the surveillance.

The Walmart Effect

 The Walmart Effect

New research suggests that the company makes the communities it operates in poorer—even taking into account its famous low prices.

2024/12/26

The Failure, Fear, And Frenzy around Luigi Mangione

Bronski Beat - Smalltown Boy (Official Video)

Todays Thought

If you pray for rain long enough, it eventually does fall. If you pray for floodwaters to abate, they eventually do. The same happens in the absence of prayers. 

-Steve Allen, television host, musician, actor, comedian, and writer (26 Dec 1921-2000)

2024/12/25

Todays Thought

The tools of conquest do not necessarily come with bombs, and explosions, and fallout. There are weapons that are simply thoughts, attitudes, prejudices, to be found only in the minds of men. For the record, prejudices can kill and suspicion can destroy; and a thoughtless, frightened search for a scapegoat has a fallout all of its own for the children, and the children yet unborn. 

-Rod Serling, writer of the science fiction TV series "The Twilight Zone" (25 Dec 1924-1975)

2024/12/24

Todays Thought

Where it is a duty to worship the sun, it is pretty sure to be a crime to examine the laws of heat. 

-John Morley, statesman and writer (24 Dec 1838-1923)


2024/12/20

White Christmas by The Drifters - 3D Animation 4K 1954

Seven reasons why Americans pay more for health care than any other nation

 Seven reasons why Americans pay more for health care than any other nation


Americans spend far more on health care than anywhere else in the world but we have the lowest life expectancy among large, wealthy countries.

A lot of that can be explained by the unique aspects of our health care system. Among other things, we reward doctors more for medical procedures than for keeping people healthy, keep costs hidden from customers and spend money on tasks that have nothing to do making patients feel better.

"We spend more on administrative costs than we do on caring for heart disease and caring for cancer," said Harvard University economist David Cutler. "It's just an absurd amount."

The nation's rising health bill affects just about everyone.

The amount working-age Americans spent on health insurance through the payroll deductions has jumped nearly three times faster than wages over the past two dozen years. Health bills are the leading cause of personal bankruptcy. And medical bills accounted for more than half of all debt on consumers credit records in 2022, according to the Consumer Financial Protection Bureau.

Public anger over high costs and poor results has been squarely focused on health insurance industry in the wake of the assassination earlier this month of UnitedHealthcare CEO Brian Thompson.

Massachusetts Sen. Elizabeth Warren said that while violence is never the answer, the public's frustration should serve as a warning for the health care industry, and in a Huffington Post interview last week cited the "visceral response" from people who feel "cheated, ripped off and threatened by the vile practices of their insurance companies."

But health economists say the entire health care systemnot just insurers, deserves scrutiny for runaway medical bills.

Health insurance companies took in $25 billion in profit last yearwhile hospitals collected an eye-popping $90 billion, Rice University economist Vivian Ho said.

"It's become quite clear how angry the public is with health care costs," said Ho. "I'm glad people are voicing their anger against insurers, but they should be directing equal anger against hospitals, particularly since so many are nonprofit."

Reason 1: Lack of price limits

U.S. hospitals have more specialists than do medical facilities in other nations. Having access to 24/7 specialty care, particularly for hospitals in major metro areas, drives up costs, said Michael Chernew, a health care policy professor at Harvard Medical School.

Patients have more elbow room and privacy here. U.S. hospitals typically have either one or two patients per room, unlike facilities abroad that tend to have open wards with rows of beds, Chernew said. He said differences in labor markets and regulatory requirements also can pack on costs.

Of the $4.5 trillion spent on U.S. health care in 2022, hospitals collected 30% of that total health spending, according to data from the Centers for Medicare & Medicaid Services. Doctors rank second at 20%. Prescription drugs accounted for 9% and health insurance − both private health insurance and government programs such as Medicare and Medicaid − collect 7% in administrative costs.

Most U.S. hospitals are nonprofit and get federal, state and local tax breaks. These nonprofits are expected to provide free or reduced-cost care to low-income patients as well as other community benefits. Federal law requires hospital to assess and stabilize every patient who seeks care in an emergency room, even if they can't pay their bills.

But research suggests many hospitals don't live up to their charity care and other community benefit obligations.

Johns Hopkins University and Texas Christian University researchers estimated the nation's nearly 3,000 nonprofit hospitals were spared $37.4 billion in federal, state and local taxes in 2021. That same year, Medicare filings show hospitals paid out $15.2 billion in charity care.

Chernew has proposed health care price caps to curb runaway health costs. Such caps might be used in markets where large hospitals control a significant share of a local health market, which allows them to demand higher prices from insurance companies who might not have other options.

Reason 2: Hospitals and doctors get paid for services, not outcomes

Doctors, hospitals and other providers are paid based on the number of tests and procedures they order, not necessarily whether patients get better.

The insurer pays the doctor, hospital or lab based on negotiated, in-network rates between the two parties.

Critics of this fee-for-service payment method says it rewards quantity over quality. Health providers who order more tests or procedures get more lucrative payments whether the patients improve or not.

"This is not the way health care should be delivered in our country," U.S. Rep. Vern Buchanan, R-Fla., said during a hearing in June exploring an alternative health payment called value-based care.

After the Affordable Care Act passed in 2010, the Centers for Medicare and Medicaid Services funded small programs that encouraged hospitals and other health providers to emphasize value over volume.

But the U.S. health system has been slow to adopt value-based care programs. Of 50 such models launched by CMS over the past decade, only six delivered health savings and two demonstrated improvements in quality, according to June testimony from U.S. Rep. Lloyd Doggett, D-Texas.

Reason 3: Specialists get paid much more ‒ and want to keep it that way

Doctors who provide specialty care such as cardiologists or cancer doctors get much higher payments from Medicare and private insurers than primary care doctors.

Some see that as a system that rewards doctors who specialize in caring for patients with complex medical conditions while skimping on pay for primary care doctors who try to prevent or limit disease.

Under the current system, doctors are chosen or approved by the American Medical Association to a 32-member committee which recommends values for medical services that Medicare then considers when deciding how much to pay doctors. Some have compared the idea of doctors setting their own payscale to the proverbial fox guarding the henhouse.

The health news publication STAT first reported that Robert F. Kennedy Jr., President-elect Donald Trump's nominee to become Secretary of Health and Human Services, is seeking to limit the AMA's influence over these medical billing codes.

Medicare payment rates not only determine how much taxpayers shell out for older Americans' health care, they set the base for health care prices. Private insurers typically use Medicare rates to decide how much they pay doctors and hospitals.

If such an overhaul resulted in more lucrative payment for primary care doctors who emphasize preventive care, it could help make people healthier and reduce costly spending on specialists, Ho said.

Reason 4: Administrative costs inflate health spending

One of the biggest sources of wasted medical spending is on administrative costsseveral experts told USA TODAY.

Although Medicare's official health care spending report doesn't calculate how much the nation spends on administrative tasks, Harvard's Cutler estimates that up to 25% of medical spending is due to administrative costs.

Health insurers often require doctors and hospitals to get authorization before performing procedures or operations. Or they mandate "step therapy," which makes patients try comparable lower-cost prescription drugs before coverage for a doctor-recommended drug kicks in.

These mandates trigger a flurry of communication and tasks for both health insurers and doctors, Cutler said.

Although medical records are computerized, too often medical computer systems don't communicate with outside organizations such as health insurers, Cutler said. That results in extra administrative tasks, when doctors attempt to get authorization from an insurer on behalf of a patient.

Such communication could be more seamless − and result in less busywork − if insurers could track patients records electronically, Cutler said

Instead, they often turn to calls and throwback technology such as fax machines.

"The only use of fax machines now are in medical care," Cutler said.

Cutler said government-run Medicare is a much more efficient operation. Doctors who provide care for Medicare patients are allowed to bill and collect payment in relatively seamless transactions without the same level of oversight that private insurance companies apply.

One drawback: Unscrupulous providers can more easily fraudulently bill the federal health program, Cutler said.

Reason 5: Health care pricing is a mystery

Patients often have no idea how much a test or a procedure will cost before they go to a clinic or a hospital. Health care prices are hidden from the public. And because consumers with health insurance often must pick up a portion of their bill, health care prices matter.

An MRI can cost $300 or $3,000, depending on where you get it. A colonoscopy can run you $1,000 to $10,000.

Economists cited these examples of wide-ranging health care prices in a request that Congress pass the Health Care Price Transparency Act 2.0, which would require hospitals and health providers to disclose their prices.

Under a law that passed Congress during Trump's first term and was enacted under the Biden administration, hospitals must disclose cash prices and rates negotiated with health insurers for a broad list of procedures in a computer-readable format so the information can be analyzed. The rule also mandated hospitals post estimates for at least 300 services so consumers can compare prices.

However, the consumer nonprofit Patient Rights Advocate said in a November report that just 21% of hospitals fully comply with the existing federal price transparency rule, down from 35% as of February.

Reason 6: Americans pay far more for prescription drugs than people in other wealthy nations

There are no price limits on prescription drugs, and Americans pay more for these life-saving medications than residents of other wealthy nations.

U.S prescription drug prices run more than 2.5 times those in 32 comparable countries, according to a 2023 HHS report.

 In one study of 224 cancer drugs approved by the Food and Drug Administration from 2015 through 2020, the median price for a patient was $196,000 per year.

Lawmakers have scrutinized prices of weight-loss drugs such as Ozempic and Wegovy. During a September hearing, Sen. Bernie Sanders grilled Novo Nordisk's top executive over why U.S. residents pay so much more for these medications than people in other countries. Although the amount consumers pay at the pharmacy is often discounted, Novo Nordisk charged $969 a month for Ozempic in the U.S. ‒ while the same drug costs $155 in Canada, $122 in Denmark, and $59 in Germany, according to a document submitted by Sanders.

Reason 7: Private Equity

Wall Street investors who control private equity firms have taken over hospitals and large doctors practices, with the primary goal of making a profit. The role of these private equity investors has drawn increased scrutiny from government regulators and elected officials.

One example is the high-profile bankruptcy of Steward Health Care, which formed in 2010 when a private equity firm, acquired a financially struggling nonprofit hospital chain from the Archdiocese of Boston. The chain is led by a former heart surgeon who collected more than $100 million in compensation and bought a $40 million yacht while employees at Steward hospitals complained about a lack of basic supplies, according to a Senate committee. Layoffs and hospital closings followed.

Private equity investors also have targeted specialty practices in certain states and metro regions.

Last year, the Federal Trade Commission sued U.S. Anesthesia Partners over its serial acquisition of practices in Texas, alleging these deals violated antitrust laws and inflated prices for patients. The federal agency also sued private equity investor Welsh Carson that funded these deals, known as "rollups," but a federal judge in Texas dismissed Welsh Carson from the case.

FTC Chair Lina Khan has argued such rapid acquisitions allowed the doctors and private equity investors to raise prices for anesthesia services and collect "tens of millions of extra dollars for these executives at the expense of Texas patients and businesses."

A National Bureau of Economic Research paper by researchers from Yale, Northwestern and the University of Chicago shows 18 metro regions where such serial anesthesiology acquisitions, known as "rollups," resulted in fewer provider choices and higher bills for consumers.

The tragic shooting of an insurance executive has highlighted the distinctive aspects of the nation's health care system.

Andrew Witty, the CEO of UnitedHealth Group, parent company of UnitedHealthcare, said in an op-ed Friday that the slaying of Thompson was "unconscionable." But he also acknowledged the flaws that so many Americans see in their medical care.

"We know the health system does not work as well as it should, and we understand people’s frustrations with it," he wrote.

Ken Alltucker is on X at @kalltucker, contact him by email at alltuck@usatoday.com.

(This story has been updated to add new information.)

This article originally appeared on USA TODAY: Seven reasons why Americans pay more for health care than any other nation

Why Useless Knowledge Can Be So Useful

Todays Thought

Men are divided in opinion as to the facts. And even granting the facts, they explain them in different ways.

-Edwin Abbott Abbott, schoolmaster and theologian (20 Dec 1838-1926)

2024/12/18

Why Do These Christmas Monsters Want To Destroy the World? | Monstrum

Todays Thought

Art should be like a holiday: something to give a man the opportunity to see things differently and to change his point of view. 

-Paul Klee, painter (18 Dec 1879-1940)

2024/12/16

Todays Thought

The universe is made of stories, not of atoms. 

-Muriel Rukeyser, poet and activist (15 Dec 1913-1980)