inaccurate frequency using TMR1 PI18F452


Results 1 to 15 of 15

Threaded View

  1. #13
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Let me edit a small part.


    Code:
    @Timer1 = TMR1L
    Timer1  VAR  WORD EXT
    
    Disable  
    miint:
    	IF PIR1.0 = 1 THEN
    		T1CON.0 = 0
    		Timer1 = Timer1 + FRECUENCIA
    		T1CON.0 = 1
    
    		IF ARRANCA_MOTOR = 1 THEN
    			PORTC.5 = 0	'PULSO DE STEP
    			PORTA.5 = 0	'SALIDA PARA SHAFT
    			PORTA.5 = 1	'SALIDA PARA SHAFT
    			PORTC.5 = 1	'PULSO DE STEP
    		ELSE
    			IF EMULACION = 1 THEN TRIGGER = ACTIVA_PRESENCIA 
    
    		ENDIF
    	'*********************************************************
    	PIR1.0 = 0
    	ENDIF
    	'**************** INTERRUPCION POR TIMER 0  **************
    	
    salida1:
    	Resume                 ' retorna al programa principal
     	Enable
    --------------------------------------------------------------------------------
    Last edited by sayzer; - 14th October 2006 at 04:48.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Code Measure Frequency by TMR1
    By blinkstar88 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2011, 10:51
  2. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 19:11
  3. HPWM command and oscillator frequency
    By RussMartin in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th March 2009, 23:41
  4. HPWM10 Frequency Updating
    By duncan303 in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 19th January 2008, 13:30
  5. Measuring change of frequency with PIC
    By Aussie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th July 2007, 02:47

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts