Hi,
Provided the hardware is sound I suspect you're writing outside of an array or something like that, corrupting whatever is there. You know that PBP doesn't verify the bounds of an array so it's perfectly valid to say myArray[6] =123 even though myArray is only 3 bytes long. It will then, obviously, overwrite something else - whatever is at that memory location.
It is of course possible that the multi channel PID routine, which IS using arrays, is doing just that (in error of course) but then I would suspect it misbehaving in when doing multiple channels as well.
Anyway, the single channel version is available on the in post #57 in this thread. I strongly suggest you read that thread as well since it covers a lot of details on how it's implemented, how it handles negative numbers, what to do when you don't want "negtative drive" (which is the case in your case) and so on.
Or, you're just getting bad reads from the clock chip.....there are a lot of DIP switches to configure those developmement boards. Are you sure you don't have something "cross connected" or whatever?
/Henrik.
Bookmarks