I'm assuming you mean the SNES? (You never actually specified ;P)
Both the code in the SPC and the code on the CPU have to be working together. Values written to 2140-3 on the CPU side are visible at $F4-7 on the SPC side and vice versa. A typical communication process is:
1) CPU sets some value to indicate it wants to start loading
2) CPU waits for SPC to respond
3) SPC notices value, and responds to CPU telling it it's ready to load
4) CPU writes target address and value to regs, then sets a flag tell the SPC that it's done supplying data
5) SPC waits for said flag, then takes the value/address and writes the byte appropriately.
6) SPC writes a value indicating the copy is done and it's ready for the next byte
7) CPU waits for that "done" notification, then repeats from step 4
Exactly how this communication is done depends on what code is running on the SPC side.
At startup/reset, when no code has been loaded to the SPC yet... the SPC has a sort of BIOS (or "IPL BOOT ROM") that can be swapped in which does this loading. This ROM and how to communicate with it to copy data is explained pretty well in Anomie's SPC docs on this site:
To properly manipulate this into uploading your data, the following procedure
seems to work:
1. Wait for a 16-bit read on $2140-1 to return $BBAA.
2. Write the target address to $2142-3.
3. Write non-zero to $2141.
4. Write $CC to $2140.
5. Wait until reading $2140 returns $CC.
6. Set your first byte to $2141.
7. Set your byte index ($00 for the first byte) to $2140.
8. Wait for $2140 to echo your byte index.
9. Go back to step 6 with your next byte and ++index until you're done.
10. If you want to write another block, write the next address to $2142-3,
non-zero to $2141, and index+2 (or +3 if that would be zero, otherwise
it'll screw up the next transfer) to $2140 and wait for the echo. Then go
to step 6 with index=0.
11. Otherwise, you can jump to some code you've just uploaded. Put the target
address in $2142-3, $00 in $2141, and index+2 in $2140 and wait for the
echo. Shortly afterwards, your code will be executing.