I appologise for the lack of comments. I changed from a standard bcf on PORTC as I have read about the read-modify-write problems. When I call this sub, I put the number of the bit I want to clear in the W register. This then reads PORTC and places it in RAM_PORTC, clears the bit in the variable and writes the entire byte back to PORTC Regards Stewart > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Jan-Erik Soderholm > Sent: 28 June 2006 10:19 > To: piclist@mit.edu > Subject: RE: [PIC] LCD Interface HD44780 > > Stewart Abel wrote : > > > I have put my code below. Can anybody see where I have > > gone wrong or suggest anything I can try please? > > First, there is not a single comment in the code so one > can verify what you *think* you are doing. > > Then, please explain what this code does : > > > clear_PORTC_bit > > movwf R_BIT > > movfw PORTC > > movwf RAM_PORTC > > bcf RAM_PORTC, R_BIT > > movfw RAM_PORTC > > movwf PORTC > > > > return > > In particular how the BCF works... > > Regards, > Jan-Erik. > > > > -- > 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