Hi Debbie, On Sun, Feb 02, 2003 at 12:10:53PM +1100, Debbie Hynes wrote: > Hi PICers, > > I'm trying to send letters to an LCD by indexing PCL > from within a MACRO. It goes to "loop" OK & calls > "standby" OK but it gets lost soon as I add w to PCL. > > Is not supposed to happen? :( Uh ... any ideas? > > Thankz if can help -Debbie :) > > > STANDBY_MSG MACRO > LOCAL loop > clrf count > goto loop > standby movf count,w > addwf PCL,f > DT "STANDBY" > > loop > > call standby > movwf temp ;Stash the letter for tx to the LCD > LCD_MSG ;Send a nibble to the LCD. Works. > incf count > movlw 0x07 ;The number of letters to be sent > andwf count,w > btfss STATUS,Z > goto loop > nop > ENDM Before changing PCL you need to correctly set PCLATCH (I may not have the mnomonic correct). This can be done by hand or using an assembler directive. I've had this bite me too. Matthew -- Matthew Miller SVCC College Bound, Technology Coordinator -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads