Hello you all, First off all: sorry when this message is sended twice to you. It won't happen again! I am new on the piclist group. I have some trouble with the MPSIM simulator. A discussion is going on between me and Microchip, but they don't seem to be able to help me. Can someone help me ?? The conversations with Microchip are below ... Greetings: ... Sipke de Leeuw ... >Date: Fri, 15 Mar 1996 09:13:51 +0100 >To: Webmaster@microchip.com (Webmaster) >From: Sipke de Leeuw >Subject: Re: Re[2]: mpsim > >Richard, > >Thank you for your quick respons. I still don't understand a few >things. You are right about the interrupt latency. It is described >for the RB0/INT pin. But I have measured the frequency on my test >pin RA1 as described in my previous mail under 1) and the frequency >doesn.t change at all, so I have measured no fluctuation of 0.5 us. > >So I think and I know almost sure that there is NO delta time of .5 us >when using TMR0 int, even though the simulator let me think there is. > >My second problem 2) is also still open: MPSIM does not caluculate the >interrupt latency for TMR0 int ok. MPSIM thinks the interrupt latency >of TMR0 int is 2Tcy in stead of 4Tcy. > >So my questions are: > >1) Is there a delta time for the interrupt latency when using the TMR0 > interrupt? According to my measurements there isn't !!! > >2) Does MPSIM makes a mistake when calculating the interrupt latency? > Again: according to my measurements it does !!! > > >Thanks. ... Sipke ... > > > > >At 15:12 13/03/96 -0700, you wrote: >> Sipke, >> >> The data book, states that for the RBO/INT pin interrupt that the >> latency is the same whether Inst (PC) is a single cycle or a 2-cycle >> instruction. It does not say this about the TMRO interrupt. >> >> The interrupt latency for TMRO is 4Tcy, which at Fosc = 8MHZ is 2uS. >> >> So it is possible that the interrupt occurs during the goto >> instruction and a delta time of .5uS is realized from time to time. >> >> Hope this info helps! >> >> Richard >> >> >>______________________________ Reply Separator _________________________________ >>Subject: Re: mpsim >>Author: Sipke de Leeuw at Internet_Exchange >>Date: 3/12/96 3:26 PM >> >> >>Hi Richard, >> >>Ok, >> >>The best way to explain my problem is to give an example. >> >>I am using the TMR0 to give the program an interrupt every >>say 800 us. The program does the following thing: >> >>interrupt: >> ACKNOWLEDGE INT >> TMR0 := 0x31 >> toggle RA1 >> RETURN FROM INT >> >>main: >> while (TRUE) >> do nothing >> >>I have a breakpoint at address 4 (interrupt). There a two problems: >> >>1) The time between the interrupts are not always exactly the same >> as they should be according the MICROCHIP datasheets. Sometimes it >> is say 800us and sometimes it is 800.5 us. There seems to be a >> fluctuation of 0.5us. (I am running a 16C84 on 8 MHz clock) >> I think it has something to do with the 2 cycle instructions >> as GOTO and CALL. >> In the datasheets it is stated that there are no variable interrupt >> latency when using THR0. So the latency is not increased when the >> interrupt occurs when the processor is executing a GOTO intstruction. >> >>main >> NOP >> GOTO main >> >> In the code as written it occurs very often that the time between >> the interrupts are fluctuating a 0.5 us. When I change the code like >> this: >> >>main >> NOP >> NOP >> . >> . 100 times >> . >> NOP >> NOP >> GOTO main >> >> the problem does occur very less often. So I think it has something >> to do with the termination of the GOTO instruction by an interrupt. >> >>2) Using the code as described in (1). Suppose the MPSIM measured time >> between the TMR0 interrupts is 800 us. (using breakpoint) >> When the time is measured with a frequence counter (on RA1 pin) it is >> 1 us longer than MPSIM let me think it is! My Xtal is exactly running >> at 8MHz. It seems to be that MPSIM does not calculate the 1 us >> fixed interrupt latency extra when a TMR0 interrupt occurs. >> >> >>I hope I have explained my problem clear. If there are questions let me >>know. Thanks. >> >> >>Also have a great day.. ... Sipke ...