If you are wanting to learn about embedded programming and small micros, work first in assembly, writing small programs. It will give you a much clearer idea of what's going on inside the chip, and when you later progress to bigger programs and C, you will understand what the compiler is doing, and be able to write much better C.
When moving code between two devices with the same core, the main difference is the peripherals. Make sure your program is well structured, with direct access to the peripherals only in clearly limited sections of the code. That way you have a minimum amount to change when you move devices.