and don't forget the configuration fuse... See FAQ to know how to set them in the code.

Usually.. XT = 4MHZ HS > 4 MHZ