Toyota Repair: 96 Prizm missing at certain RPMs, geo prizm, crank sensor


Question
I've got a tough one with my '96 Geo Prizm.  It is a 5-speed manual with the 1.8 liter engine.

It died on me a few times, including on a road trip.  It would die on idle, but be okay it speed until I needed to slow down.  If it did die, it tended to not be restartable.  Replacing the plugs, wires, cap and rotor (due anyway) didn't solve this.  The fuel pump checked okay.  Changing the distributor (with everything on it--including the coil pack) took care of the problem.

But a new problem arose.  No more dying on idle or failing to start.  Instead, it misses at some RPMs.  It's fine on idle and up to about 2000 RPMs.  At about there, it misses badly.  The miss clears up around 2200, and is back again from 2500-2700 or so.  This occurs in any gear and in neutral.  Again, it misses every time at these RPMs, but runs beautifully everywhere else.

We've checked or changed the crank sensor, camshaft sensor, MAP sensor, knock sensor, igniter and the O2 sensor.  Nothing has helped.

It isn't giving any sort of missfire code, either general or specific to certain cylinders.  It did give a knock sensor code, which is why that was changed, and doing so got rid of that code but resulted in a O2 sensor code.  Again, the O2 sensor checks fine.

The throttle body is clean, the compression is fine, the timing is correct.  We're rather stumped.

Answer
What is the trouble code number you are getting now and how was the O2 sensor checked to confirm that it was bad, were both front and rear sensors checked and what were the results. If possible can you give me the fuel trim data from freeze frame information.