In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Stolzie wrote: Hi guys, I have got an issue where the RTCC interrupt keeps firing in the middle of my subroutine. I have put in code to turn the interrupt off in the subroutine before I do anything and then turn it back on after I have finished. Can I actually do this? As it doesn't seem to be working. If I turn the interrupt off at the beginning of the code, it runs perfectly. SX48 Datasheet doesn't offer much information on this. Any tips or suggestions, the interrupt has to stay as it is used as a base timer for timeouts in other subroutines. Cheers Stolzie [code] ReadEE ; ; Read Word at EEAddr to EEDatL,EEDatH ; ****************************************************************************** mov w, #%01001000; #(RTCC_PS_OFF) ; setup option register mov !option, w clrb SPI_CS call @E2Delay300nS clrb SPI_CLK setb SPI_CS _bank SPI_BANK mov spim_out_dat,#$01 ; send start bit call @spia ;rl,rl eeadr and then clear carry rr clear carry rr ;this will set bit 6,7 to known state of $00XXXXX ; _bank EEPROM_BANK ; rl EEAddr ; rl EEAddr ; clc ; rr EEAddr ; clc ; rr EEAddr ; mov w,EEAddr ; xor w,#$80 _bank SPI_BANK mov spim_out_dat,#$80;w ; move $00 Control byte for EWEN call @spia mov spim_out_dat,#$00 ; move EEDATH call @spia mov globtemp1,spim_in_dat mov spim_out_dat,#$00 ; move EEDATL call @spia mov globtemp2,spim_in_dat clrb SPI_CS setb SPI_CS _bank EEPROM_BANK mov EEDatH,globTemp1 mov EEDatL,globTemp2 mov w, #(RTCC_PS_OFF) ; setup option register mov !option, w retp [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=211276 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)