I'm having problems with 18f252 ports. I seem to be unable to control it as an input or an out but. Thus I am also unable to use the BTFSC or BTFSS controls. Is there a difference between the 16f and 18f series with regards to inputs and outputs?
EDIT
Sorry for the lack of info. I was in abit of a rush, I'm rushing now too :p
so the code i used is fairly simple :
The main part to control the 18f252 is ----> MOVLW B'00000000'
Please post code and Please post code and schematics. Also, please describe what you have done to try and solve this problem, so we don’t waste time suggesting things that you have already tried
The architecture is how the The architecture is how the ports are built, if they’re the same then the control methods are the same. Virtually all PIC micros speak the same language, word for word.
The code:MOVLW The code: MOVLW B’00000000’ MOVWF TRISC will make all port C pins output pins, but only if ‘TRISC’ is properly defined, which I can’t tell from your code. It won’t set the state of the pins, but it will set them to output mode.
I used the I used the include<18252.inc> not very sure of the command as im using a different computer. So if i put all 1’s it would be an input? How do i ‘test’ the data from the input?
Yes, a 1 in the TRIS sets Yes, a 1 in the TRIS sets the corresponding pin as an input. This info is in the datasheet. You can test the input data in many, many ways. You can use the in-circuit debugger, make the PIC light up some LEDs, send data to an LCD display, etc.