Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Help needed timing a pulse (2004 Robovation) (http://www.chiefdelphi.com/forums/showthread.php?t=49617)

Kevin Watson 29-10-2006 15:24

Re: Help needed timing a pulse (2004 Robovation)
 
Quote:

Originally Posted by yongkimleng
...get a signal generator/constant pulse source to test, if possible...

Just use one of the PWM outputs to generate a pulse. A PWM value of 127 should generate a pulse width of about one millisecond.

-Kevin

Kevin Sevcik 29-10-2006 15:27

Re: Help needed timing a pulse (2004 Robovation)
 
Your problem is almost certainly that you're clearing the timer in the wrong order for a 16-bit Read/write mode. In this mode TMR1H is a buffer. so you write to the buffer first, then write to TMR1L. Your code for RB7_State == 1 should be:

TMR1H = 0x00; // MSB-TMR1
TMR1L = 0x00; // LSB-TMR1

As it is, your high bits aren't being cleared, so the value is effectively random, which is what you're seeing.

Josh Siegel 29-10-2006 16:20

Re: Help needed timing a pulse (2004 Robovation)
 
Switching the clear order worked!
Thank you to everyone!

mluckham 22-11-2006 12:07

Re: Help needed timing a pulse (2004 Robovation)
 
Good, simple information about CCP programming here http://ww1.microchip.com/downloads/e...Doc/41214a.pdf


All times are GMT -5. The time now is 20:46.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi