Path-Remebering Bot..

Status
Not open for further replies.
Code:
                movlw   B'00000001'
                movwf   T1CON;		enable timer 1
                movlw   low(d'50000')
                movwf   CCPR1L
                movlw   high(d'50000')
                movwf   CCPR1H
                movlw   B'00001011';	enable special event trigger on CCP1
                movwf   CCP1CON;

Sorry, I copied the code from a project that used the timer 1 oscillator.

Change the top line to be as shown above.

I've also made it clearer that the 50000 is decimal.

Mike.
 

Sorry, I copied the code from a project that used the timer 1 oscillator.

Change the top line to be as shown above.

I had noticed that the first time itself ... and I had made the corrections as above.. but it is still not working.. the CCP1F flag is not setting 'HIGH' when the comparison occurs. (i chkd this on the simulr) Please help..
Thanks
 
I just put the following in MPLAB and it works fine.

Code:
                LIST        P=16F73
                #include 	"p16f73.inc" 

                org	0

                movlw   B'00000001' 
                movwf   T1CON;      enable timer 1 
                movlw   low(d'10000') 
                movwf   CCPR1L 
                movlw   high(d'10000') 
                movwf   CCPR1H 
                movlw   B'00001011';   enable special event trigger on CCP1 
                movwf   CCP1CON; 

WaitTimeUp      btfss   PIR1,CCP1IF 
                goto    WaitTimeUp 
                bcf     PIR1,CCP1IF 
 
                goto	WaitTimeUp ;   <<<<<< Put Break point here

	end

If you put a break point where I have indicated then it should stop every 10mS = 1/100 th of a second.

Mike.
 

Hi Mike..
There seems to be somwrhing wrong with the simulator... I'm using Oshon Pic Simulr.. ver 5.33. The code is infinitely looping around
Code:
WaitTimeUp      btfss   PIR1,CCP1IF 
                goto    WaitTimeUp

I'm stepping the simuln run.. and the Flag Bit is not setting HIGH at all

I'll burn the code.. and program it to flash an LED after setting of the flag bit.. things will be clear then... will let you know..

Thanks
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…