So far, 2022 has been a rough year for microchip stocks. Semiconductor stocks tend to more than double the return of the S&P 500 market index in the long run, but the broader market is down by 13% this year and the chip sector is falling twice as fast instead.

It's not hard to see why investors are so concerned with the long-term prospects of computer chip stocks. The chip shortage that started in the summer of 2020 is still going on, and the global economy isn't doing too hot in general. Inflation hangs like a dark cloud over many of the world's largest economies, including the U.S. market. And just when it finally looked like the COVID-19 pandemic might be under control, the monkeypox virus raised a whole new set of public health concerns.

Against that murky backdrop, could this be a good time to invest in microchip stocks? Let's take a look.

Person scratching their head and chewing on a pen while reading a computer screen.

Image source: Getty Images.

Why is the chip industry in trouble?

The semiconductor industry limited its manufacturing in 2020 as coronavirus lockdowns made it challenging to keep their chipmaking facilities fully staffed. At the same time, plunging demand for new vehicles reduced the demand for car-based microchips, so the manufacturing issue didn't seem too bad at first.

However, at the same time, the rise of remote work started a long-lasting surge of high demand for PCs, digital cameras, and other devices that are built around microchips. And when car factories started getting back to business, the restricted chipmaking volumes simply couldn't ramp up to meet the suddenly sky-high demand.

The effort to stabilize and boost chip supplies also faced headwinds from geopolitical conflicts, trade wars, natural disasters, and recurring COVID-19 outbreaks near important manufacturing hubs in China. So here we are, two years later, and the microchip industry is still playing catch-up.

How long will the chip shortage last?

The general consensus still indicates that chipbuilding capacity will fall short of incoming microchip orders at least until the first half of 2023. However, some recent rumblings have raised the hopes of a faster recovery.

For example, automotive computing giant NXP Semiconductors (NXPI 3.39%) saw some signs of improvement in last month's second-quarter earnings call. CEO Kurt Sievers noted that NXP is "probably moving away from supply constraints" in the mobile chip market and the auto industry has started to increase its vehicle-building volumes. Of course, the order backlog is still growing and NXP's customers have to count on lead times of several months, but NXP sees light at the end of the chip-shortage tunnel.

As inflationary fears hold consumers back from spending on new smartphones and other chip-powered devices, the swooning demand for these gadgets should help the manufacturing giants to get back on track. Third-party microchip maker Taiwan Semiconductor Manufacturing (TSM -1.33%) supported this view in its second-quarter earnings call last month. "Softness" on the consumer side allows the company to reallocate its manufacturing capacity to support more substantial order flows, where demand remains steady or rising. This way, Taiwan Semi is inching closer to meeting the total market demand. However, the fight isn't over quite yet. CEO C. C. Wei said that the manufacturing pipeline will "remain tight throughout 2022."

So even the optimists agree that the chip shortage should remain for at least a few more months. The exact endpoint to this problem depends on macroeconomic and geopolitical issues to a large degree, so companies in the chip industry don't have full control over the process. Nonetheless, the industry is getting over this three-year malaise, and financial results should be stronger reasonably soon.

Is this a good time to invest in the chip sector?

There are some bargains available in the microchip sector. Taiwan Semi and NXP are trading at some of their lowest price-to-earnings and price-to-free cash flow ratios in recent years. The same is true for PC chip underdog and graphics processor giant Advanced Micro Devices (AMD -0.80%), even if AMD looks pricey next to its more mature sector peers. The company makes up for that imbalance by delivering outstanding revenue growth even in this challenging economy. AMD's second-quarter sales rose 70% year over year, for example.

These stocks strike me as sensible buys right now. I don't recommend going all-in on any of them, though. The market, the chip sector, and every one of these stocks are still subject to volatility and unpredictable near-term results. Therefore, it's best to build your investment over time, picking up a few shares here and there as the market wobbles. Dollar-cost averaging can be your best friend in these unpredictable times, coupled with a long-term investment horizon. The high-quality chip stocks you pick up at reasonable prices today should serve you well in the long run.