Hats off to Myke!! It works Myke. The PIC is a 16F84. The relevant code section now looks like :- org 0x04 int b1 call kbdgrab ;Grab the KPD data nibble. clrf LCDflag bsf LCDflag,RS ;Set RS=1 for CHARACTER mode. movf Keydata,0 ;Move'em left away from RB0 rlf Keydata,0 ;LEDs are on RB1,2,3 & 4 ; movf Keydata,0 ; movwf PORTB ;Send the result to the LEDs b2 nop ;rrf Keydata,1 ;restore the KPD data movf Keydata,0 ;Retrieve data for use as index call Hex2Asc2 call nib_tx IFNDEF DEBUG call DLY160 ENDIF int_ret retfie ;**************************************************************** ;HEX to LCD ASCII conversion using PCL jump ;Thanks to Myke Predko ;**************************************************************** Hex2Asc2 addwf PCL, 1 dt "0123456789ABCDEF",0 I called the conversion routine hex2asc2 cause it's the 2nd one of its kind. Never chuck out old code is best? Many thanks, Myke. Also thanks to Tony Nixon & Olin for advice. Keeping the rotated nibble in w is best. The programme needs to avoid plonking data bits in RB0 as that's the interrupt pin. I'm gonna try and build up a generic set of LCD/KPD interfaces so I can just roll out the same old code for various projects. I'm planning to put them up at my website (see below) so others can use them as well. I'll refine them as I go along based on what I learn from the PIClist. Ian ............................................. myke predko wrote: > > Ian, > > I think your problem is pretty fundamental, you are trying to execute the > code: > ... > What you actually want is: > > : > movf Keydata, 0 > call HexToASCII > call nib_tx > : > > HexToASCII > addwf PCL, 1 > dt "0123456789ABCDEF",0 > > You should simulate this code first and I think you'll find that it works > the way you want it to. > > Regards, > > myke -- ******************************** Ian Hynes email : elek@netstra.com.au ian.hynes@start.com.au URL : www.netstra.com.au/~elek ******************************** -- 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