On Thu, 13 Apr 2000, Alice Campbell wrote: > Hello All, > > I am porting some 16f84 code to a shiny, > new 16f877 in the new IDE i got for my > birthday. I am having trouble getting > porta to work as digital I/O. Here is the > snip: > > list p=16F877 > __CONFIG _CP_OFF & _WDT_OFF & _RC_OSC > ;&_LVE_OFF<--hates this > include "P16F877.INC" > beep_pin equ 3 > ;----------------------------------------- > nop ;for use by ide > ORG 0 ;Reset Vector > ORG 4 ;Interrupt > bsf STATUS,RP0 > clrf PORTC ;portc set output > movlw b'00000001' > movwf PORTA > movlw B'00000110';.6--magic number > movwf ADCON1 ;??? ;TURN OFF ADC > bcf STATUS,RP0 > CLRF PORTA > movlw b'00001000' > movwf porta ;no beep here > Since I think I know where you got this code (or at least portions of it ;) let me go on the defensive and say that it is okay. Well, maybe it is. Recall that the f877 has four register banks. PORTA and TRISA share the same lower seven bits. Since only the lower 7 bits are decoded (or assembled) then specifying TRISA or PORTA as the source or destination for a file register related instruction will produce the same result. So the only thing that could cause the above code to fail is if RP1 is set. So you may wish to try: bcf STATUS,RP1 before the other stuff. You can make the changes to TRISA and TRISC registers if you want and just either ignore the warnings produced or mask them out like Paul recommends in every 10th post he makes. Incidently, the TRIS instruction AFAIK is available on the f877 (at least it is in gpsim). A quick glance at the data sheet shows that it isn't. Does anyone know for sure if the TRIS instruction is available for the f877? Scott