Implicit Definition Of A Pin
Moderators: David Barker, Jerry Messina
Implicit Definition Of A Pin
Hi All,
I know it is probably a silly question, but I need to know how to Implicitally define a I/O pin as a Input on a PIC part to make sure it comes up correctly. I could not find any example. Any help would be greatly appreciated.
Thanks
I know it is probably a silly question, but I need to know how to Implicitally define a I/O pin as a Input on a PIC part to make sure it comes up correctly. I could not find any example. Any help would be greatly appreciated.
Thanks
Hi,
as Tim stated you can use
or you can simply use the Input()/Output() predefined subs
From Swordfish Help in Topic
Language Reference>>Predefined Subroutines and Functions
Regards
octal
as Tim stated you can use
Code: Select all
//Pins numbering is zero based
TrisA.3 = 1 '<<< makes Pin3 on PortA as Input
TrisB.5 = 0 '<<< makes Pin5 on PortB as Output
' For all Port you may set all TRISx in one shot "1" or Input "0" for Output
TrisB = %01001110
or you can simply use the Input()/Output() predefined subs
From Swordfish Help in Topic
Language Reference>>Predefined Subroutines and Functions
Input
sub input(byref portpin as bit)
The input subroutine makes the specified port pin an input. For example,
input(PORTD.7)
Output
sub output(byref portpin as bit)
The output subroutine makes the specified port pin an output. For example,
output(PORTD.7)
Regards
octal
Implicit Definition
Thanks a bunch guys !!!!!
Hi,
I tried what you suggested and got a compile error. I was wondering if there is a #option command to set say PORTA.3 as Input
I tried dim PORTA.3 as Input and got a compile error on the next line complaining about no end statement
Any ideas ?
I would like to define certain pins in my code to be specific
Thanks
I tried what you suggested and got a compile error. I was wondering if there is a #option command to set say PORTA.3 as Input
I tried dim PORTA.3 as Input and got a compile error on the next line complaining about no end statement
Any ideas ?
I would like to define certain pins in my code to be specific
Thanks