So this question has to deal with my POV hardrive clock. If a mod wants to merge this thread with the other then it fine but I thought it best to keep them separate since this subject is different enough and hopefully others can learn with it without the confusion of the other thread.
As a refresher I have a rotating disk with numbers, Under the numbers are 8 LED positions. I have a hall effect home sensor that uses the CCP to determine the rotation speed of the disk. The LEDs should fire at the appropriate time to show a POV clock. As the disk moves to each "position" more LEDs will fire at the same time with the possibility of 8 LEDs all firing at the same time.
I have the rotation speed calculation working perfectly, thanks to the help of a number of members of this forum.
Now it comes to lighting the LEDs at the appropriate time. My first thought was to start a timer interrupt each time the CCP interrupt hits. This worked great for a single position and a single digit but I don't think that is going to work with multiple positions.
I then came across the idea of polling a timer in the main loop. But the problem I seem to be running across there is that by the time I poll the timer, it has moved on and never equal to the value I was looking for.
I was thinking I could look for a range of values. Is this an appropriate way to do this? Or is there a better way?
I was thinking that this is really nothing more than a propeller clock project. I do plan to do more research to see how others have don e it but wanted to get some input first. There is a lot of bad code out there. One of which I saw was the delays between positions where hard coded and the is certainly the wrong way to go.
As a refresher I have a rotating disk with numbers, Under the numbers are 8 LED positions. I have a hall effect home sensor that uses the CCP to determine the rotation speed of the disk. The LEDs should fire at the appropriate time to show a POV clock. As the disk moves to each "position" more LEDs will fire at the same time with the possibility of 8 LEDs all firing at the same time.
I have the rotation speed calculation working perfectly, thanks to the help of a number of members of this forum.
Now it comes to lighting the LEDs at the appropriate time. My first thought was to start a timer interrupt each time the CCP interrupt hits. This worked great for a single position and a single digit but I don't think that is going to work with multiple positions.
I then came across the idea of polling a timer in the main loop. But the problem I seem to be running across there is that by the time I poll the timer, it has moved on and never equal to the value I was looking for.
I was thinking I could look for a range of values. Is this an appropriate way to do this? Or is there a better way?
I was thinking that this is really nothing more than a propeller clock project. I do plan to do more research to see how others have don e it but wanted to get some input first. There is a lot of bad code out there. One of which I saw was the delays between positions where hard coded and the is certainly the wrong way to go.