Thanks Melanie and Mister E for your kind advice - that was extremely helpful, as I will explain:
The crystal capacitors were actually 33 pF (!) but I changed them to 22pF and this improved the starting, but there was still a random re-start problem. On my board the DAC's control lines (Clock, Latch Enable & Data) are connected to PortB.7, PortB.6 and PortB.5, respectively, and I found that when the PIC sent controls to the Latch Enable pin the PIC froze. The problem was due to the fact that the Low Voltage Programming (LVP) fuse was set as Enabled in the MElabs programmer configuration, and of course these 3 pins on Port B are used for programming! The solution was to change the LVP fuse to Disable, and then the DAC and the PIC worked perfectly.
Thanks you guys!
Bookmarks