I am working in Microchip Studio v7.02542. My project was created for the ATTiny441 and has been working successfully. Now I tried changing the device type to the ATMega328P for my Arduino Uno from the Project Properties->Device menu. The type successfully changes in Properties:Device:Current Device. However, the compilation still targets the 441. I can see this throughout the "Toolchain" menu and the build output as the mcu still specifies the 441.
* Toolchain:AVR/GNU Common/General:Target Device: "-mmcu=attiny441 -B "$(PackRepoDir)\atmel\ATtiny_DFP\1.8.332\gcc\dev\attiny441"
I've tried cleaning and rebuilding my solution and reopening Microchip Studio but the mcu never updates.
Out of frustration I ported my project to MPLABX and changing the target device via the same process works to correctly define -mmcu. However, I then have a different problem. Compilation succeeds for the ATTiny441 but fails for the 328P as the registes are no longer defined. This appears to be because the makefile defines __ATtiny441__/__ATmega328P__ while io.h requires __AVR_ATmega328P__/__AVR_ATmega328P__ to include include iotn441.h/iom328p.h. However, I'm not clear why the 441 does work while the 328P does not.
Any device on both issues? Thanks much!