back to the dilema, i am using PIC16F874A in a design to monitor
battery for a handheld.
still new to the PIC and the PIC basic, i try to initialize the I/O
ports (A through E) and set the corresponding bits to Input/output.
i am writing some values to PORTA, using the Debbuger and the watch
window, i monitor the values of PORTA, however, when i write a certain
value to it, the watchlist will show another value.
for e.g, here is what i do first
<code>
bsf	STATUS,RP0 		; select register bank 1  
        movlw	b'10011111'		
	movwf	TRISB			; set port B
	bcf	OPTION_REG,NOT_RBPU	; turn on pull ups
	movlw	b'00000011'	; 
	movwf	TRISA		; set the OUTPUT port (PORTA)
        movlw   b'10000000'     ; set Pic_txD as input, all others as
outputs
	movwf	TRISC		; set the CONTROL port (PORTC)
        movlw   b'00000000'     ; set port D as all outputs
	movwf	TRISD		; set the KEYSTRB port (PORTD)
        movlw   b'00000111'     ; set port E (not being used)
	movwf	TRISE		; set port E
</code>
i watch TRISA,B,... etc and all of them appear to have the right value
in the watchlist.
then, i try to init the ports to a certain values, like
<code>
; Intialize ports
bcf STATUS,RP0      ;select bank0
movlw	b'00011101' ;0x1D
movwf	PORTA
</code>
in the watchlist, PORTA seem to have a value of "0x0C" not "0x1D"
now why is that? what i am doin wrong?
ur help is appreciated
regards
You might want to take this over to the PIC list:
http://mailman.mit.edu/mailman/listinfo/piclist
Pay careful attention to the Topic prefix (your's would be:
[PIC]: PIC 16F874A
though you might want a better description of the problem).
-- 
Linux Home Automation         Neil Cherry        nch...@comcast.net
http://home.comcast.net/~ncherry/               (Text only)
http://hcs.sourceforge.net/                     (HCS II)
http://linuxha.blogspot.com/                    My HA Blog