----- Original Message ----- From: "Russell McMahon" To: Sent: Friday, June 14, 2002 12:18 AM Subject: Re: [PIC]: Debugging interrupt driven code with no ICD or ICE [snip] > Having a "heartbeat" pulse from the IRQ routine can help in syncronising > plus provide time in IRQ routine as well as above. . If I had done that in the first place, it would have saved me tons of trouble. It turns out that the PIC, which was running at 2MHz at the time, was operating just a bit (sorry about that pun) too slow. It was losing an edge that it needed to process, so it was messing up the following transmission. I increased the clockrate to something near 3.6MHz, and I'm not having the problem anymore. The way I figured that out, however, is slightly different. I looked at the time it had to porcess a single request, which turned out to be 22 cycles at the speed I was running, which isn't enough for the code I'm using. (takes time to do context saving, which is a must in an interrupt driven system) But, in my opinion, 22 cycles is more than enough to read a single bit in off of a synchronous port, so I'm considering switching from the interrupt driven code to continuous polling. That way it takes a max of 5 cycles to finish responding to an edge (little more if you want to do inline parity checking). I've never liked the interrupt system. I want an event based MCU!! Like that's going to happen any time soon... *sigh* --Brendan -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body