In SX Microcontrollers, SX/B Compiler and SX-Key Tool, ShadowsSoldier wrote: "Doggone" : ) I saw your SX-B code only after I struggled with the RTCC in assembly on my own. Downside: got blurry vision reading and less sleep. Upside: learned a lot. Here is my intial code as a foundation of the final program I am writing. I am controlling 2 seperate bursts with long waits in between, but that code is pending. Checked on SX-Sim the interrupt occurs every 64 cycles = 12.5 us (on + off = 40 KHz). I know my interupt routine can only be nc-7 cycles long otherwise I get an error. I'll post my final code when I get it working. ;5.120 MHz version Device SX28L, Turbo, Stackx, OSCHS3 IRC_CAL IRC_SLOW FREQ 5_120_000 RESET Start ORG $000 Interrupt ; interrupt Routine - always starts at $00 Mov w,#-64 Retiw Start ; configure ports Mov M, #$0f ; access TRIS mode Mov W, #%0000 ; bits 0-3 are outputs Mov !Ra, W ; make Ra0-Ra3 outputs Mov M, #$0f ; access TRIS mode Mov W, #%0000_0000 ; all bits output MOv !Rb, W ; set Port B pins to output Mov M, #$0f ; access TRIS mode Mov !Rc, w ; set Port C pins to output ; configure RTCC rollover interrupt Mov w, #$9f Mov !option, w ;enable RTCC rollover interrupt Mov w, #$c0 Mov rtcc, w ;initialize RTCC value to 192 ; de-glitch initial state Mov w, #%1001 Mov Ra, w ;set register A output to Ra0,Ra3 = 1 Ra1,Ra2=0 Mov w, #%0000_0000 Mov Rb, w ;set register B output to digital LOW Mov w, #%0000_0000 Mov Rc, w ;set register C output to digital LOW MAIN Loop JMP LOOP ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=107862#m108627 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)