Hi,
Is there a way of simply limiting the word to 4095 something like B_PWM VAR Word size 4095 ??
Two ways that I can Think of right now, your way which you've somehow implemented wrong and the way I tried to explain in my previous post.
Code:
IF pcaPwmValue >= 4095 THEN pcaPwmValue = 4095 ' Clamp value at 4095
LCDOUT $FE,$D4+0,"PWM ",dec pcaPwmValue
Or....
Code:
pcaPwmValue = (B_PWM & 4095) ' Roll over value at 4095
LCDOUT $FE,$D4+0,"PWM ",dec pcaPwmValue
By your explaination it sounds as if the PCA chip is basically doing what the second approach above does, ie start over at 4096 and again at 8192 and again 12288 and so on.
/Henrik.
Bookmarks