Dear Mr. Wakefield,

A look at the schematic with the associated code may help forum members to track down your problem. Otherwise only blind guesses.