decoding quadrature encoders


Results 1 to 40 of 94

Threaded View

  1. #20
    ice's Avatar
    ice Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Luciano,
    Im read up the pbp manual and others for interrupts...
    ..however my test program isnt compiling..

    Code:
    		wsave 	VAR BYTE $20 system				'bank0
    		wsave1 	VAR BYTE $a0 system				'bank1
    		'wsave2 	VAR BYTE $120 system		'bank2
    		'wsave3 	VAR BYTE $1a0 system		'bank3
    		ssave 	VAR BYTE bank0 system
    		psave 	VAR BYTE bank0 system
    		led 	VAR PORTB.1
    		
    		GoTo start_0 					' Skip around interrupt handler	
    
    
    		DEFINE INTLHAND myint			' DEFINE INTERRUPT handler
    		Asm
    myint:	bsf _led 						; Turn on LED (for example)
    		bcf intcon.0
    				
    		retfie
    		EndAsm
        
    	
    		
    										' Assembly language INTERRUPT handler    
    		
    
        
    start_0:
    		
    		TRISB=%11111101	
    		Low led 						' Turn LED off
    		INTCON = %10001000				' Enable INTERRUPT ON PORTB.0
            
    	
    loop: 		GoTo loop 						' Wait here till interrupted
    1> compile error "DEFINE INTHAND myint"
    ....undefined symbol myint
    however if i relpace it with DEFINE INTLHAND myint,(which is only for th 18x series),it complies ok..

    2>im using a 16F873A,which has a 4K flash,meaning 4 banks...
    according to the PBP manual, i have to define wsave,wsave1,wsave2,wsave3...
    it takes in wsave and wsave1...but when i declare wsave2 and wsave3..it gives a RAM_END 255 error

    3>i cannot get the LED to blink either by using the int0 or the Interr On change<4:7>
    Last edited by ice; - 6th May 2005 at 13:14.

Similar Threads

  1. Quick thoughts: DT Ints with encoders
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 7th January 2010, 02:01
  2. PMDC SERVO MOTOR WITH quadrature encoder DRIVE ?
    By phoenix_1 in forum Schematics
    Replies: 37
    Last Post: - 22nd November 2009, 20:45
  3. 32-bit Quadrature Counter With Serial Interface
    By precision in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th June 2008, 03:49
  4. quad encoders
    By cpayne in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th March 2007, 18:49
  5. "momentary" IR decoding
    By sporker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th June 2005, 02:53

Members who have read this thread : 1

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