Myke, How's the peepers coming along? All is well I hope. I also hope the Christmas season so far has been good to you and your family. Regards, Jim -----Original Message----- From: Myke Predko To: PICLIST@MITVMA.MIT.EDU Date: Tuesday, December 28, 1999 8:29 PM Subject: Re: Help beginner programmer >Hi Brian, > >Quick reply to your questions. > >The application looks good, the only comment I have is on the statement: > >> bcf TRISB & 0x07f, 0 ; Set bit 0 to output >> Here is where I have trouble. If I understand this correctly, this >should >> take 00000000 and (and) it >> with 01111111. Am I right? > >Most people would consider this to be 11111110, with bit 0 being on the >right. > >Other than that (and it's a nit), the code looks good. > >> Another thing I want to know is how can you clear PortB if you don't >switch >> banks first? I mean according to Mykes book, which is where I copied >this >> program from, the above code says it is ok to clear PortB, but to set the >> I/O direction, you need to switch banks first. > >If you write directly to the Port register, the new value will be saved even >though the port bits are in input mode. Once the Port register bits are put >into output mode, then the values written to them will be driven out of the >pins. > >Does this help explain it? > >myke >