Yes, correct device selected in MCS. The 2520 is the same family as the 4520, just 28 pins, so no port D etc. I've been compiling as I go and up to now it's been fine. Basically I'm trying to make a single channel thermostat from the 4 channel PID code that you, I and the late DT worked on back in 2009, that uses the DTH11 sensor rather than ds18B20's, as the DTH11 includes a humidity sensor as well. I'll try and compile it for an 18F 4580 which was the original PIC used in the 4 channel version which by the way is still running six years later and maintaining the environment in my snakes enclosures without a hitch.