Using analog controller to control AD5242

AD5242 is a dual digital potentiometer and comes in 1Mohm range. Analog stick only comes in 10k and 100k, and I needed 1Mohm for an older game console that uses it as resistor divider. I have tried looking for a replacement 1Mohm variable resistors that can be used directly in the analog stick but none fits without extensive modification.

Is there any reason an ATTiny85 can't work to read analog position (2 pins), compute digital value, and control digital potentiometer via I2C bus (3 pins)?

What is an analog stick?

The only show stopper to your idea would be if the required pot voltages fall outside the range of VDD to VSS. The datasheet defines those absolute limits.

The only way the range would fall outside Vss and Vdd is if my ATTiny85 board suffers a malfunction but at that point, the ATTiny85 would have been fried before the analog range became an issue. The analog stick by itself do not have power requirement and do not require power just to work.

ATTiny has a wide range of operating voltage from 2.7 to 5.5v (dependent to its clock speed). One side of the analog stick's range would be connected to common ground, other side to Vss and the wiper to ATTiny's analog in. The digital potentiometer also have similar operating voltage and the target project is 5v so it should be doable.

My only concern was if that ATTiny can handle this or not. The 8 pin package has 5 usable pins for 2 analog in plus 3 I2C out. If ATTiny85's I2C ends up using the 2 or 3 analog pins, I wouldn't be able to use it with analog stick and would have to use next chip, ATTiny84 that has 11 usable pins (6 analog) but I'd rather try to use the smaller chip for smaller footprint.

May I ask why I2C need 3 pins? You mean I2C/TWI (Two Wire Interface) using pin SDA and SCL right?

I dont see any reason why Attiny85 cant work with that configuration. But good luck with the USI feature, I have use Attiny45 for a while and I give up to configure it as UART device (never try to configure it to be I2C device).

May I ask why I2C need 3 pins?

That's not what the OP said. It was:

The 8 pin package has 5 usable pins for 2 analog in plus 3 I2C out.

Which is to say there are three pins on the '85 for hardware serial functions which include SPI as well as I2C.