TOKYO, Aug 12 (Reuters) - Japanese stocks edged higher on Wednesday as some investors bought shares of major exporters on the back of a slightly weaker yen, although sentiment was cautious due to a stalemate in talks over additional U.S. economic stimulus.

The Nikkei 225 Index ended up 0.41% at 22,843.96, with the industrial and consumer discretionary sectors leading gains. The broader Topix rose 1.23%.

A weaker yen inflates exporters' earnings when repatriated from overseas. The yen, which briefly fell to the lowest in almost three weeks on Wednesday, last traded at 106.74 per dollar.

Many investors are closely watching debates in Washington about economic stimulus, because Republicans and Democrats are struggling to agree the details of a package needed to support the world's largest economy.

"Rising Treasury yields cause the yen to weaken against the dollar, which is normally good for Japanese exporters," said Ayako Sera, market strategist at Sumitomo Mitsui Trust Bank.

"But markets are struggling to digest recent events because there is so much uncertainty about the coronavirus."

The largest percentage gainers in the index were environmental plant manufacturer Ebara Corp up 11.4%, followed by precision parts maker NSK Ltd gaining 7.06%, and industrial equipment maker IHI Corp up by 5.95%.

The top percentage losers in the index were Internet commerce firm Rakuten Inc down 7.79%, followed by drugs maker Eisai Co Ltd losing 5.29%, and electronic parts maker Taiyo Yuden Co Ltd down by 4.22%.

SoftBank Group Corp fell 2.66% as investors booked profits following its earnings announcement after market hours on Tuesday.

There were 188 advancers on the Nikkei index against 33 decliners.

The volume of shares traded on the Tokyo Stock Exchange's main board was 1.3 billion, compared with an average of 1.21 billion in the past 30 days. (Reporting by Stanley White; Editing by Subhranshu Sahu)