So, the two codes (I'm sure you already know them) are as follows:
41 - TPS Sensor Signal, diagnosis; simultaneous IDL and PSW signal to ECU.
52 - Knock Sensor, diagnosis; open or short curcuit in knock sensor, or signal in ECU
So, because the tps has to send several functions, it is possible that the ecu senses the tps is not in the correct spot for the amount of air/fuel, thus supplying either too much or too little fuel to match the metered air from the MAF sensor.
One of the functions of the tps is to show the idle, or "parked" spot on the throttle body, it is also a very, VERY miniscule area that it needs to be in. If its not there, you can sometimes not even get your error codes, it can also be just the opposite (depending on which way it is incorrectly set + or -). Other times it will just throw the code, knowing it is not correct and the ecu tries to adjust to what it thinks it should be.
I believe the latter is what's happening, and that your truck is running slightly lean, which is causing a slight knock, thus tripping code 52. Couple of things to check, the easiest being your plugs. See if they're the right color. If they're white or really light colored, its running lean. Here's a quick color guide:
That's just the quick test, my next test that I'd run would be to check the tps. Here's how I've set it for many, many years, it works perfectly, but it takes a very steady hand to get it right!
With the engine running and the tps loosened enough to turn by hand, rotate the tps till your idle drops, then turn it back VERY VERY SLOW, until the idle picks back up again. That is the exact spot where it is set correctly.
How slow is very slow? I'm talking about microns here! If you haven't set one before, you won't truly understand just how touchy it is! I have also replaced the stupid philips screws it uses with allen screws, as it is so much easier to rotate the tps then lock it in place!
Now, this works for the 22RE, I think the 3VZE has a dashpot that needs to be deactivated (read, throttle body set screw should be touching, dashpot should not be pushing throttle plate open when setting tps), you'll have to read up on that, but there's tons of step by step how to's on "setting the tps for 3VZE", via google.
Good luck!