Finally I found the bug! Turns out PR2 was in bank1 and I forgot to switch banks before adjusting it! Result was PR2 always 255, and I never changed it! No wonder my adjustments to mnatch range for duty never took hold. KreAture ----- Original Message ----- From: "Kyrre Aalerud" To: Sent: Wednesday, June 11, 2003 7:18 AM Subject: Re: [PIC]: 16F628 and interrupt problem... > Because my main loop consists of: > > "Main: goto Main" > > In other words why bother... > > KreAture > > ----- Original Message ----- > From: "Picdude" > To: > Sent: Wednesday, June 11, 2003 2:13 AM > Subject: Re: [PIC]: 16F628 and interrupt problem... > > > Why you are not saving the values of STATUS and WREG when you receive an > interrupt, and then restoring them on exit? > > Cheers, > -Neil. > > > > On Monday 09 June 2003 16:23, Kyrre Aalerud scribbled: > > Hi, long time since I've posted, but I've been busy reading all your posts > > > > :-) > > > > Anyways... I have a problem getting some simple test-code to work with > the > > 16F628. > > Code uses: > > - PWM (Timer2) (Out on RB3) > > - Timer0 for a measure > > - Interrupt on RB0(INT) > > > > I don't see anything I have forgotten and still, interrupt only triggers > on > > first pulse after power-on/reset. > > (Pulse being sendt via ripple-free switch connected to +5v and pin is > > pulled low via 1k for testing...) > > > > Anyone got a clue to what's wrong? > > I thought I knew what I was doing after soo many years using PIC's? > > Obviously something is missing, but I reset the flag? What more could it > > ask? > > > > I've attached an .asm so you can try. It compiles in MPLAB 5.70.40. > > > > KreAture > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics