So I actually did swap PCMs but my truck wouldn't start. I figured it must programmed to my VIN or have some security feature.
How do I make this new (to me) PCM work? Is there something I can do without having to visit a dealer?
Perhaps you need to do a Passlock relearn. There seems to be a lot of mystery surrounding how Passlock actually works, so I'll spell it out in case you're unfamiliar (or familiar with the "urban legends"). The PCM you installed has a stored "password" that it's expecting to see from the Theft Deterrent Module. The TDM (which is actually integrated into the Power Steering Control Module on 97+ trucks) sends this "password" which is nothing more than a string in serial data communication that tells the PCM which voltage value it sees as the result of sending 12 volts through the Passlock sensor - a hall effect sensor with a pre-determined resistance that "latches" a transistor to send a subset of that voltage back to the TDM when the magnet in the lock cylinder passes through the sensing coil(s?).
The idea behind Passlock of course is security. But in my experience and probably several others, it only prevents the owner from using HIS truck at THE MOST inopportune times, and in my case, the 10 minute wait has never ever worked. Further, the premise behind Passlock is if you destroyed the lock cylinder, you'd destroy the magnet and probably the Passlock sensor too. But why bother? With only 6 tumblers in the lock, you could easily start it with a "bump key" or a screwdriver and a pair of vice-grips! But I digress...
There are several different resistor values - at least 12 or 13 if I recall correctly. Most likely your PCM has a different stored value (because your other truck uses a different resistor in its Passlock cylinder). You'd need to either program the PCM (more on that later), or run the non-interactive 30 minute Passlock Relearn procedure. I'm sure it's been posted many times in many places on this forum, but it basically involves attempting to start the truck, and when it fails, waiting 10 minutes (with the key on) until the security light goes off, turning the ignition off and waiting at least 20 seconds, and repeating that process 2 more times. After the third time when you turn the ignition off and wait for 20 seconds, you'll hit the starter again and it should crank and the PCM will simultaneously re-learn the new "password". Note, if you want to, you should be able to permanently disable Passlock by making sure the PCM doesn't receive a password ever again (dead TDM's can't talk, right?) - you'd have to interrupt the serial line feeding the SCM. I have this problem on my Yukon where the SCM/TDM seems to be without power most of the time. It's fine by me, the first moment I get, I'm going to clip the serial line from the SCM - as best I can tell it only communicates from TDM to PCM and there is no steering-related communication. Maybe someone can set me straight on that; i'll have a better idea when I yank out the SCM for analysis.
However, I believe as SunlitComet alluded to, your PCM is going to start (when Passlock is out of the way) but shutdown soon thereafter, I can't recall if it's 2 minutes or something shorter. (The reason why, btw, is because all of the various modules - VCM, BCM, SCM, etc. all have VINs embedded in their EPROM. They all "exchange" VINs periodically, and if they see an inconsistent VIN, everything shuts down according to the way they're programmed - at least that's what I recall reading in a shop manual). To address this, I guess you can do a crank relearn as others have suggested. But if you're really interested in both having a strong diagnostic tool, as well as being able to fix this yourself (programming VINs into PCMs, running crank relearns, or transmission shift adapt resets, or other bi-directional communication procedures), I'd recommend looking at the HPTuners software. You won't see it mentioned on this board much because BlackBearTune (one of this board's vendor sponsors) uses a competing software called EFIlive, or at least that's the most logical thing I can come up with. However, at $500 for the basic and $650 for the professional wideband edition, it's one powerful tool. In addition to being able to reprogram the PCM VIN, you can prevent the PCM from acting on Passlock information (effectively disabling Passlock), and access a whole host of tuning options - it's my understanding that HPtuners is just as capable as EFIlive, they even have a realtime OS replacement for the truck's standard firmware. In addition, it has a rather extensive scan tool, which I understand beats Palmer Performance's ScanXL hands down, and rivals more expensive scan tools (the reason it beats Palmer is because Palmer is completely uninterested in making sure features are 100% compatible on GM, whereas HPtuners is dedicated to GM performance - see Palmer's forums for an example of what I mean). For example, on the scan tool portion of the software (included), you can monitor the command of the compressor on/off from the PCM, and I would think you can monitor the cycling switch's input to the PCM too (if not, you could always probe the switch directly and measure for voltage if it passes any, or if not, build an "open collector" circuit (if the switch is just providing continuity to ground) that feeds an LED when the transistor base is grounded, though that's somewhat of an advanced topic). Any parameter you can imagine, you can probe with HPtuners on the scantool. The list of GM-offered diagnostic outputs is incredible. I'm like this close: (holds up fingers) || to ordering HPtuners Pro. They've been very responsive in answering my questions, and if I'm wrong about Passlock working the way it seems to work for me regarding the storage of a null passcode value, I'm going to cop their program without hesitation.
Hope that helps.