/* Encoder.Asm Copyright ©1998, 1999 Larry Barello Author: Larry Barello lbarello@accessone.com You are allowed to use this file for personal use only. You may use, embed, modify or distribute the contents of this file in any way you see fit as long as you include this copyright notice in the resulting file. Any commercial or industrial use including publishing or distributing in any form requires the written authorization of the copyright holder(s). No guarantees are made about fitness, functionality, correctness or performance of this file. The file is supplied on a "AS IS" basis, with no responsibility assumed by the author(s) for bug fixes, support, or damages of any sort arising from the use of this file. Contact the author with problem reports or fixes, feature requests or additions and questions. They are welcomed and will be incorporated as time and energy permits. */ #include "registers.inc" #include "AvrX.inc" ; ; New Encoder ; ; Interrupt driven off of INT0 and INT1 ; NAME ENCODER ;+ ; Position/Velocity Encoder stuff ; ENCODER = PIND ENCODER_INIT = 0xCC ; Pull ups on Encoder inputs Right_Enc_A = PD2 ; INT0 Right_Enc_B = PD6 Left_Enc_A = PD3 ; INT1 Incremental encoder inputs Left_Enc_B = PD7 ;- PUBLIC Init_Encoder INT0_Interrupt INT1_Interrupt RSEG CODE ;+ ; Init_Encoder ; ; Initialized both external interrupts to falling edge ; trigger and enables their interrupt flag. ;- Init_Encoder: in R30, MCUCR sbr R30, 1<