|
Hello, I am currently using speed.icb/shaft.c (IC v3.2 library files) to
count clicks on optical encoders for my two drive wheels using the Pulse
accumulator and the IC3 interrupt. I noticed that there was an inconsistency
in the _unassembled_ speed.asm file as noted below:
file speed.asm:
<snip>
TFLG1 EQU $1023
ORG MAIN_START
subroutine_initialize_module: /* This module runs whenever a reset
occurs */
ldd #IC3_interrupt_handler /* Get 16-bit address of interrupt
handler */
std $FFEA /* Store in IC3 interrupt vector
location */
cli /* Enable interrupts globally */
rts /* Return from initialzie_module
subroutine */
variable_left_clicks: /* Create right_clicks, a variable accessible by
IC */
fdb 0 /* Fill double byte (16 bits).
right_clicks = 0 */
IC3_interrupt_handler:
ldd variable_left_clicks /* Get the value in right_clicks */
addd #1 /* Add one more encoder count */
std variable_right_clicks /* Store back to right_clicks */
ldaa #%00000001 /* Clear the IC3 flag by writing a one
*/
staa TFLG1 /* Store in TFLG1 to clear IC3 flag */
rti /* Return from interrupt */
<snip>
It appears that the interrupt handler loads "left_clicks" increments it by
1, and then stores it in "right_clicks". This doesn't seem right. Has anyone
noticed this before? Is this the assembled (.icb) version different?
John
|
|
1 Message in This Thread: 
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|