Overall (excess HI, heat):
CH3OCH3+2HI⟶2CH3I+H2O
Step 1 – protonation of the ether: HI is a strong acid.
CH3–O¨–CH3+H–I⇌CH3–O+(H)–CH3+I−
Step 2 – SN2 attack by iodide: I− is a good nucleophile; it attacks a methyl carbon of the oxonium ion and methanol leaves.
I−+CH3–O+(H)–CH3⟶CH3I+CH3OH
Step 3 – with excess HI at high temperature, methanol is also converted: protonation of methanol, then SN2 attack by I−.
CH3OH+HI⇌CH3O+H2+I−
I−+CH3O+H2⟶CH3I+H2O
