ATMEL 24C02 EEPROM - Trouble understanding how the addressing works
Are you being confused by the common mistake that many people make where they treat the address of an I2C wrongly? Some parts will refer to the address as a 7-bit quantity that does not include the R/W bit. Others will refer to the address as an 8-bit quantity that includes the R/W bit. Even the data sheet that you linked can lead to confusion in this regard. In figure 4 they refer to the address as an 8-bit quantity:



And in the immediately following figure 5 they refer to the address as the 7 bit quantity from MSB to LSB:



Also be aware that the A0 to A2 pins on the device package are meant to remain static in a design. If a total of eight 24C02's are used in the design then each of the devices will have these three pins hard strapped in a different combination from the set of 000b, 001b, 010b, 011b, 100b, 101b, 110b and 111b. When you say that you are "writing" to the pins this does not make clear exactly what you are doing. Normally there is no writing to the 24C02 pins. Instead the three bits that you supply out on the interface in the device address field must match the hard strapped values on the pins in order for the device to be selected.

If by chance you had decided to add some other MCU GPIOs that tied to the A0, A1 and A2 pins on a single device that would really not be a valid usage scenario. On top of that I have never been sure that it is even possible to dynamically change the strapped value on the A0, A1 and A2 pins of a 24C02 after it has powered up.