Post Go back to editing

TMCM-6110 Initiating IRQ using DI

Category: Software
Product Number: TMCM-6110

Hi,      I'm trying to initiate an IRQ using Vect 40 instruction but cant get it to respond.

The Timer interrupt sample code (below) in the TMCM-6110 firmware manual works fine but there is no guidance on using DI apart from a Vect number.

VECT 0, Timer0Irq

SGP 0, 3, 5000 //configure the interrupt: set its period to 5000ms

EI 0

EI 255

Loop:

MVP ABS, 0, -2900

WAIT POS, 0 ,0

MVP ABS, 0, -290

WAIT POS, 0 ,0

JA Loop

Timer0Irq:

SIO 0, 2, 1

WAIT TICKS, 0 ,200

RETI

The manual indicates to use Vect 40 for Input 1
39 Input 0
40 Input 1
41 Input 2
42 Input 3

My code below which does not work....

VECT 40, DigitalInput1       // 40 = input 1

EI 40

EI 255

Loop:

MVP ABS, 0, -2900

WAIT POS, 0 ,0

MVP ABS, 0, -290

WAIT POS, 0 ,0

JA Loop

DigitalInput1:

MVP ABS, 0, -1900

WAIT POS, 0 ,0

RETI

Any help will be appreciated, thank you.