In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bfranke wrote: For anyone who might be slightly curious how this turned out. . . I never was able to get the timer to work properly using the "Software Timer Mode". I finally changed my method and got what I intended all along, without the timer. It's actually better this way. I'm just glad I can move on now. But there is a curious thing here. I have to put a NOP right before the RETI or it doesn't work right for me. I believe this is due to pipeline issues since the last thing I do is write to the port register, but I'm not sure. Anyway, I posted the code for my interrupt in case anyone else has experienced this same thing or can explain why a NOP would be needed there. Thanks, Bill org $10 ;$10 should be available. fifo never actually uses it. FIFO = $ ds 9 Temp ds 1 BitPointer ds 1 ; this is the bit pointer for each byte (8 max); FifoPointer ds 1 ; this is the current byte BitWaste ds 1 ; needed to get rid of non-data clock pulses in interupt and final pass WasteClk ds 1 ; same VoltBits ds 1 org $000 ;--------------------------------------------------- ; ISR ; FIFO interupt - Triggers off the clock pulse (Port 'A' pin '7') and captures the data (Port 'A' pin '8') ; after a 36 count display flash is complete and captured, this transfers the final 4 bytes into another ; 4 bytes that are read by FifoSend ;--------------------------------------------------- bank $10 inc BitWaste stc cjb BitWaste,WasteClk,FillPointerRet ; we want to loose the first 3 clock pulses (they have no data) mov w, #FIFO ; indirect address the FIFO memory add w, FifoPointer ; FIFO pointer mov fsr, w movb c,rb.7 ; capture the data into carry rl ind ; rotate c into the current FIFO dec BitPointer snz jmp FillPointer FillPointerRet mov w,#$19 ; enable pending reg. mov m,w mov !rb,#%10111111 ; clear the pending register so we can do this again. [purple]nop ; needed apparently because of pipeline problems[/purple] reti FillPointer mov BitPointer, #8 dec FifoPointer sz jmp FillPointerRet mov BitWaste, #$FF ; have to waste the final bit also mov FifoPointer, #4 ; use this variable temporarily as a loop counter :loop mov w, #FIFO ; indirect address the FIFO memory add w, FifoPointer mov fsr, w mov Temp, ind ; temporarily save the value add fsr, #4 ; incr 4 mov ind, Temp ; store it decsz FifoPointer jmp :loop ; loop four times mov FifoPointer, #4 jmp FillPointerRet ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=116812#m118212 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)