replacing atmega328p with atmega328 on UNO

HI! i have two atmega328 chips which i used to program with a usbasp programmer. the programmer went bad this morning and i was wondering if there's a way i can replace the atmega328p chip on my arduino uno with the atmega328 and program it. the atmega328 already has a bootloader. i can't hook up the arduino to a breadboard and program the chips. thanx

If the ATmega328 has the Arduino UNO bootloader I think you will get a signature error when you try to upload. The ATmega328 and ATmega328P have different signatures. I think you will need to make changes to boards.txt to create an Arduino UNO that uses mcu=atmega328 (or m328) insted of mcu=atmega328p.

It depends on what the bootloader is telling the IDE about the chip type. My preferred method is to use the standard 328p optiboot in the 328, and the standard "Uno" setting in boards.txt. optiboot will lie about the chip type (it's derived at compile time, not from the actual hardware), the IDE will happily compile and load 328p code into it, and everything will work fine. (with the exception of being about to turn off brownout detection, using the power control register. Which is irrelevant on an Uno, anyway.) The alternative is to compile a special bootloader for the 328, and create a special board type for the IDE to use.

Short version: switch the chips, call it an Uno, and see if it works...