now to get the 40mhz osc to work
Use a 10MHz crystal or resonator then set the config to HS4.