[1] http://haxit.blogspot.com/2013/08/hacking-transcend-wifi-sd-... [2] HN Discussion at https://news.ycombinator.com/item?id=6195627
http://en.wikipedia.org/wiki/Commodore_1541 indicates that my memory is correct, but http://en.wikipedia.org/wiki/Commodore_64 says that the chip on the C64 itself is a bit different, though.
They're pin-compatible enough that in some devices you can swap them around and get things to work (e.g. putting a 6510 in a 1541 has a decent chance of working unless the GPIO pin register clobbers something important in the 1541 memory map; with the reverse you'll at least have problems, though a 6502 in a C64 might work if you only run things like cartridges and/or put the right voltage on the right pins to map the ROMs into place).
Also, the Amiga 500 keyboard had a 6502 compatible CPU with built in PROM and RAM as well (MOS 6570).