Sorry Im not good at explaining. its Atmega328
heres what Im planing.
int reset= 29; // pin no. of atmega328 which is the reset
pinMode(reset, OUTPUT); // set reset as output
digitalWrite(reset, low); // use it when I want to reset the atmega328
I think digitalWrite is for analog and digital only.
You can't do what you are trying to do. The reset pin on a 328P can be set with fuse settings to be either the hardware reset signal for the chip or a general purpose I/O pin, it can't be used for both purposes. If fuses are set to use the reset pin as an I/O you lose the ability to program the chip via bootloader or ISP method so that pin is always used as a hardware reset pin only for any arduino IDE compatible board, and you have no program control over it.
If you want to be able to reset the chip while it's running your sketch, read up on using the watch dog time (WDT), it's easy to do and is the only correct method to perform a chip reset without using external components.