I need to save the values of r1,r2,r3,r4 upon power failure for this shoul i have to use an external memory or can the micro controller can retain data in the powerdown mode
don´t misunderstand about power-down mode and a pawer failure...
in power down mode, the uC consumes less Current, ports are Hi-Z and data is retained as long as VCC don´t fall from (mmm don't remember exactly) 4V
it doesn`t mean that it'll retain data on a power failure...
just use an external memory (suggest an I2C 24Cxx) or a micro with internal EEPROM (maybe like the AT89S8252 or PIC or AVR)