40X2 doesn't like PORTC command

D n T

Senior Member
I need to configure the 40X2 leg 26 ( portC 7) to an output and turn it on and off.

high portc 7

Yet when I use the syntax test I get reminded:
Error: 'high portc' command not supported in this mode!
I tried to use an output command ( as per the let dirsC command information)

Can I seperate ( high and portC) the two commands or do I have to
let pinsc = %10000000
to set the pin as an output, but then how do I make it high/ low without interfering with other pins?

I had a look at appendix F manual 1, is there a page detailing what I need to do? I have not been there yet.
I need to configure some of portC pins 0,3,4,5,6 as inputs and some as outputs as well as PWM portC 1, 2, so I have a range of needs for my little 40X2 so changing to outputs or inputs is a problem.

It appears that the "let dirsC " command is the little beasty I need, but how do I speak to that output, I would have thought to use high portC 7 but as discussed early, nope.

This post took a while to write as I tried to solve it.
Can you direct me because perhaps there are many trees but I have yet to see the wood and a spoon full of hind sight might help.
Is there a 40X2 appendix?
 
Last edited:

hippy

Technical Support
Staff member
The X2's don't have explicit "HIGH PORTC" commands as the pin reference implies which port is used. You probably have something similar to this -

Symbol ENABLE = 7
High PortC ENABLE

What you need is -

Symbol ENABLE = C.7
High ENABLE

This effectively gives the "Symbol name = PortC number" functionality which is not available with non-X2 parts. A flexibility of using port.pin is that a symbol defined pin name can usually be changed to be any pin on any port without having to change the code which uses that pin, that is there is no need to choose between "HIGH" or "HIGH PORTC", nor have additional "HIGH PORTD" etc options for larger X2's.
 
Last edited:

D n T

Senior Member
Hippy, how do I get you a bottle of scotch

How do i get you a bottle of scotch, although then perhaps you answers might get a little fruity
 

hippy

Technical Support
Staff member
We'll have to implement some sort of 'chocolate bars for answers' economy :)
 

D n T

Senior Member
Any pin anything, except A4 serial out

On the 40X2 can I use any pin for an input or an output except the serial out(A4) pin?
At least as simple inputs and outputs.

Is that the case?


PS Hippy, credit 1 virtual mars bar
 
Top