Whether a computer could feel pain shouldn't depend on fine detail of how the CPU synchronization works or whether the CPU is implemented with electricity, or light, or gears. It's only the computational characteristics that matter if computers can be conscious.
Let's imagine a simplified picture of a computer's synchronization. There is a synchronizing clock. Each time the clock ticks, the computer very quickly executes the next instruction and enters a new state. Then it stays in its new state until the next clock tick.
Let's imagine that the dynamic stuff that is triggered by each clock tick takes places over a small portion of the time between ticks—most of the time between ticks, the computer is staying in a static state. For instance, if the computer is made up of gears, as a computer could well be (though it would be impractically big), then the picture is this. The computer is still for a while. Then the clock ticks. The gears make a quick movement to a new configuration. And then the computer is still until the next tick.
Suppose the computer feels pain. When does it do that? It is hard to believe that the computer is feeling pain when it is statically maintaining its state in between ticks. Suppose the computer got stuck between ticks—the clock broke down. Would the computer be permanently in pain?! I guess I just find it incredible that a contraption made of gears should feel something when the gears are not even moving.
So I think the best candidate for when the computer would feel pain would be when it is transitioning between states. But remember the intuition that only the computational characteristics matter to things like pain if computers can be conscious—the details as to implementation should be irrelevant. Assuming it's possible for a computer to feel pain, we should thus be able to have a possible world with a computer in pain whose state transitions are instantaneous. For a nanosecond all is still. Then a clock ticks. The computer instantaneously jumps to a new state. Another nanosecond of stillness. And so on.
The computer in this story, then, feels pain only during a series of instants. The total amount of time it spends feeling pain is zero. Yet it feels pain. Is that possible? Can there be pains that take no time at all?
Perhaps, though, the computer's subjective time doesn't line up with objective time. Maybe objectively the pains take zero time, but subjectively they take a lot more time? I don't know if this is possible.
There may be an argument against the possibility of computers feeling pain in the vicinity. In any case, there are interesting questions here.
Note: When I talk of a computer feeling pain, I mean a merely material computer. As Swinburne has pointed out to me, God could give a soul to a computer. And then there could be consciousness. But the subject of the pain, I think, wouldn't be the computer. The computer would be like a body. My body never feels pain. It is I (the whole of which the body is a part) who feel the pain.