Harry, I don't understand that. It worked for me perfectly when I programmed the chip after adding the extra code I spoke to you about. I didn't have to add any extra steps to abate any RMW problems. Oh well, as long as it's working for you, that's the main thing. Regards, Jim ----- Original Message ----- From: "Harry H. Arends" To: "'Microcontroller discussion list - Public.'" Sent: Saturday, August 30, 2008 1:10 PM Subject: RE: [PIC] No reaction using chanhe on interrupt > Hi Matthew, > > Your spot on, after the changes from Jim it still ditnt work. > I created some extra code in the main loop like this: > > bsf OUTPUT, 2 > Loop: > movf OUTPUT,w > andlw 0x0F > movwf PORTA > goto Loop > > And that dit the trick. Thanks now i have to get the timing right. > > Harry > > -----Oorspronkelijk bericht----- > Van: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] Namens > Matthew > Miller > Verzonden: zaterdag 30 augustus 2008 17:37 > Aan: Microcontroller discussion list - Public. > Onderwerp: Re: [PIC] No reaction using chanhe on interrupt > > Hi Harry, > > On Sat, Aug 30, 2008 at 04:04:17PM +0200, Harry H. Arends wrote: >> OK i added some more code but still the same result. >> >> Niether PORT becomes high > > Another possibly is that you're experiencing a read, modify, write issue. > This is very common on the mid-range parts. I'll give you an example: > Let's say that bits 0 and 1 on PORTA are outputs and you want to drive > them > both high. Here is the code you might use: > > banksel PORTA > bsf PORTA, 0 > bsf PORTA, 1 > > You may find that only output 1 is set high, while output 0 is still low. > This is because the second bsf read the port value (and read low for bit > 0!), set bit 1 high and then wrote the value back to PORTA. This is the > RMW > issue. > > The way around this is to use a shadow register. It's a good idea to do > this > on all 10,12, and 16 series parts. Here is how this is done: > > banksel shadowa > bsf shadowa, 0 > bsf shadowa, 1 > movf shadowa, W > > banksel PORTA > movwf PORTA > > It's a few more instructions, but is avoids the RMW problem. You could > also > put this code in a macro. > > Good luck! Matthew > -- > http://www.piclist.com PIC/SX FAQ & list archive View/change your > membership > options at http://mailman.mit.edu/mailman/listinfo/piclist > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist