|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#20
|
||||
|
||||
|
Re: Real time clocks, out of the question?
Quote:
One of the interrupt options is to interrupt on timer overflow, and that is how some of the other examples posted work. If you: - stop the timer - load a 16 bit value into the timer register - reset the interrupt flag - start the timer You will get an overflow interrupt in however many timer ticks it takes for the pre-load value to reach the point of overflow (0xffff -> 0x0000). Having the timer value available could also be useful for calculating the period between two events, such as a transition on an input pin that triggers an interrupt. The input interrupt could read the current timer value, and subtract the timer value of the last input transition to calculate the amount of time elapsed since the last input interrupt. Ideally, one would use something like the CCP module to time stamp an input transition, but in the case of IFI's RC, those pins aren't available as for user Digital I/O pins. As an example, for something like motor velocity control, at slow speeds, if a rotational speed slower than 1 pulse per sample period was desired, you could use period measurement to gain some additional resolution, and above a certain rotational speed, you could switch to counting the number of pulses per period method. Each microcontroller manufactuer has their own ideas on the degree's of flexibility that they make available. Microchip's 8 bit PIC family is pretty average. Some parts have less flexibility, others have quite a bit more. In this case, you have to do the best you can with what they give you... |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Networkable real-time game simulation for 'Aim High'! test it out now | Bongle | General Forum | 11 | 19-03-2006 23:10 |
| Real time photos from the buckeye regional | Greg Needel | Regional Competitions | 4 | 25-03-2004 12:46 |
| Robot motion after the time has run out. | Randy Ai | Rules/Strategy | 1 | 06-01-2003 17:17 |
| Real Time Scoring | archiver | 2000 | 2 | 24-06-2002 00:09 |
| real time chat | SharkBite | CD Forum Support | 4 | 07-02-2002 21:22 |