Semtech ( SMTC) reversed a year-ago loss and matched the second-quarter earnings estimate, but forecast lower third-quarter earnings due to weak consumer demand for semiconductors.

The shares were selling off, down 21% to $14.97, on the guidance.

The company earned $11.1 million, or 14 cents a share, in its second quarter compared with a loss of $5.1 million, or 7 cents a share, last year. Analysts polled by First Call/Thomson Financial had also predicted the company would earn 14 cents a share.

Revenue rose 29% to $52.1 million from $40.5 million a year ago. Orders were up 41% compared with last year. Still, the company said orders were affected by lowered consumer demand, vendor consolidations, "a decline in power consumption in desktop computers," and lower sales during August, a month already normally negatively affected by the seasonality of sales.

The quarter's results include a one-time gain of $415,000 due to the sale of inventory, which had been written off in last year's quarter. The company also spent $30.7 million buying back convertible subordinated notes, resulting in a gain of $600,000.

Looking ahead, Semtech expects third-quarter EPS of 14 cents and revenue to be unchanged to down 5% from the second quarter. First Call/Thomson Financial has predicted an EPS of 15 cents.

Separately, the company said it is in talks with an unidentified customer to settle a disagreement over weather a Semtech chip caused failures in some of the customer's products.