I must measure the voltage of a wire with ac and will connect it rto the port2 of the cpu But i do not know how to isolate it and think we must use an opto isolation to stop the heat. We cannot use a transformmer. If you have circits please send them to me.
Why not?
And what does this have to do with Keil tools??
Are we talking about measuring the mains voltage?
If so, the answer is trivial: If you do not know how to do it, then you are (by law, in a number of countries) not suitable to do this job.
For a low-volume product, buy existing hardware to measure the voltage. For a high-volume product, hire a consultant to design the interface.
A high-quality way of measuring is to have the processor on the "hot" side, and have an isolated power supply and send opto-isolated serial data back. This allows max linearity/bandwidth when measuring. Isolating the analog signal before measuring it requires a lot of knowledge about voltages, impedances, frequencies, required measurement precision, allowed price, ...
There are a number of existing solutions or components that can isolate the analog signal, but a suitable solution depends a lot on the requirements.