Did you set the fuse to disable low voltage programming? John At 10:57 AM 12/25/01 +0000, David J Binnington wrote: >Hi all, > >Yes I know it's Christmas day and I am a very sad person but I have had some >16F628 code on my mind and just had to sneek away and test it during a lull >in the festivities. I only have the MPLAB simulator to play with as the >hardware is not accessible at the moment. > >I am using MPLAB V5.4. The problem is that I can't get RB3 to work as an >input with either asynchronous stimulus or a stimulus file. All other bits >work OK and RB3 works with the same portion of code on the 16F84 simulator. >I know RB3 is shared with the Comparator and CCP modules but they are >switched off. I suspect (and hope) that the simulator is broken for this >pin. > >Am I missing something obvious? Any other sad PIC people out there care to >respond? ;-) > >David > >PS - Here is some barebone code just to prove the point. Run in animate >mode and toggle PORTB pins individually and check the result in TEST. RB3 >refuses to change. (sorry if the formatting gets lost):- > > INCLUDE "P16F628.inc" > > org H'00' ;Reset vector > goto init ; > org H'04' ;Interrupt vector. ISR > not used here > >init > >TEST EQU H'20' ;Define test register location > > movlw H'07' ; > movwf CMCON ;Set for Digital inputs, > disable analog comparator > clrf CCP1CON ;Turn CCP module off (should be > off by default anyway) > > bsf STATUS,RP0 ;Set BANK 1 > movlw H'FF' ; > movwf TRISB ;Set PORT B for all I/P > bcf STATUS,RP0 ;Set BANK 0 > > clrf PORTB ;Clear PORTB output > latches. Don't really need to do this > >loop > movfw PORTB ;Read PORTB and > movwf TEST ;copy to TEST > goto loop ;Repeat forever > > end > >-- >http://www.piclist.com hint: The PICList is archived three different >ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.