I am fairly new to C programming and I need help in designing a program that will read 4 parallel inputs and ensure that they are incrementing sequentially. That is from 0000 to 1111.
If I may add, I am trying to test the functionality of a 4-bit absolute encoder. So my plan is to design a sequential test using a PIC18F4525 to achieve this.
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
Posted: Mon Aug 08, 2011 2:22 pm
Do you have any sort of strobe signal that tells you the pins have changed? If not you just have to keep reading and subtract the "old" value. If the result is 0 nothing has changed. If the result is 1 then they have incremented and you have a new "old" value. If the result is anything else you have an error, though if it is 2 or 3 you may have just missed a count or two. _________________ The search for better is endless. Instead simply find very good and get the job done.
Maqhawe
Joined: 04 Jul 2011 Posts: 2
Posted: Tue Aug 16, 2011 8:48 am
thanks SherpaDoug
I have taken your advice into consideration and now Implementing it in code
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum