Forum Discussion
Altera_Forum
Honored Contributor
11 years agoOk. I don't know exactly what you are attempting with your code, but I'm seeing several things that are suspect.
iup is never used. ireset is extranious, (both =1 and =0 case does the same thing) otvalue1, otvalue2 and otvalue3 are never used. iDATA_READY is never used. Only 16 bits of iDATA are used. So based on this, I'm seeing this functioning as follows; At irst = 0, the otvalue is set to 127. if iDATA[15:0] == 16'hA15E, you count up. But this is not qualified by iDATA_READY. if idown==0 or iDATA[15:0] == 16'e11e you count down. Again not qualified by iDATA_READY. Otherwise the value is held at it's current count. Let me know what you are seeing that is wrong. My guess, is since you are not qualifying with iDATA_READY, you are getting stuck with it continously counting down or up based on the current state of iDATA[15:0] Pete