At 03:11 AM 12/29/99 -0500, I wrote: >At 12:33 AM 12/29/99 -0600, John wrote: >>I think the designation of the pins is GP1, GP2 >>and so forth. >> >> >I wrote the following sample ("sqwave.sti"): >> > >> >!12.28.99 23.15 SQWAVE.STI >> >!stimulus file for SQWAVE.ASM >> >CYCLE GPIO1 GPIO2 GPIO3 >> >1 1 0 0 >> >2 1 1 1 > >Thanks, John. The "GPIO" version was a relic of my trying everything to >get this to work. > >Now, with GP1-GP3 as pin names AND all comments removed, the inputs do >seem to be appearing at the GPIO port register! Ta-Dah! > >However, now I've got a new problem. Although I've configured ~MCLR off, > > __CONFIG _CP_OFF & _WDT_OFF & _MCLRE_OFF & _XT_OSC > >MPLAB continues to go into reset whenever GP3 goes low. The 12c509a burned >with the program works correctly, though. > >Any suggestions as to how to deal with this? MPLAB apparently won't give >up on GP3 being ~MCLR instead of an input pin. After considerable fooling around with this, I have now doped out the rules for using the MPSIM function in MPLAB: 1. No comments at top of .STI file. 2. Start first line with "CYCLE" followed by pin names. 3. Pin names are GP0-GP5 for 12C509A. 4. Save file as "name.STI". 5. Under OPTIONS|PROCESSOR SETUP|HARDWARE, set your configuration, regardless of any __CONFIG line in the assembler file. Only this option's settings will be used, including clock type and various enables. 6. Set DEBUG|STIMULATOR STIMULUS|PIN STIMULUS|ENABLE to the "name.STI" file used. ONLY the saved file will be used. Any open window with changes will be ignored. You must perform this function EVERY time the project is loaded. The setting is NOT saved! 7. Clear the StopWatch (WINDOW|STOPWATCH), or have it clear itself on reset. 8. Reset the simulator and step through the program. If you do all of this, the simulator seems to work correctly. (Whew!) It is annoying to have to assign the stimulus file each time the project is accessed, but I guess you can't have everything. PS. Myke! For your 2nd edition, you should correct the examples in your book to match the results listed above. ================================================================ Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral@lcfltd.com Least Cost Formulations, Ltd. URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239 Fax: 757-467-2947 "Vere scire est per causae scire" ================================================================