Small problem with SYMBOL

Manel_s4

Member
Hello, probably it's a foolishness but I'm trying to program and I don't know if it's correct:

symbol Floor0 = C.0
symbol Floor1 = C.1
symbol Floor2 = C.2

I don't know if it is correct because the programme doesn't recognise, namely, the C.0, C.1, etc don't appear blue...
 

Jamster

Senior Member
My version of the PE seems to regognise it: symbol goes light blue, Floor0 etc goes dark blue when I run simulation, equals stays black, C goes light blue and .0 etc stays black.

Are you sure you are using the latest version and are you sure you are using a chip which has outputs named C?
Do any errors come up when you simulate?

Please tell us more...
Jamster
 

Manel_s4

Member
Okey, thank you, I see the same like you, I think that is completely correct. I wasn't sure if the .0 must goes with black.

Another question, I have been reading the manuals, and are these commands equals?

let pinsC = %00000000
let outpinsC = %00000000

Of course, previously I have established this pins as outputs.
 

nick12ab

Senior Member
You need to press the Syntax Check button to update the symbol definitions known by Programming Editor. Then, the symbols should be in the correct colour when used in the program.
 

Paix

Senior Member
Another question, I have been reading the manuals, and are these commands equals?

let pinsC = %00000000
let outpinsC = %00000000

Of course, previously I have established this pins as outputs.
G248.png


Manual 2 page 15

Not the same, one is input and the other output.
 

westaust55

Moderator
Looking on Manual 2 page 16 may help clarify the position albeit that page 16 is ostensibly for the M (not M2) parts.

pins = the input port when reading from the port
(out)pins = the output port when writing to the port


When used on the left of an assignment pins applies to the ‘output’ port
When used on the right of an assignment pins applies to the input port

Certainly the PE simulator still allows this concept with the M2 parts (tried with 20M2 selected).


@manel_S4,
with respect to the SYMBOL statement lines and your comment in post 3, for
symbol Floor0 = C.0

The X2 and M2 parts use the port.pin nomenclature to define the pins in an easy to follow scheme, however in reality,
the "C.0" is already a SYMBOL/alias for a constant = 8
thus, B.0 = 0, B.1 = 1, ... B.7 = 7, C.0 = 8, ... C.7 = 15



NOTE for hippy/technical:
PICAXE Manual 2 page 16:
The heading is:
PICAXE-14M/20M Special Function Registers (NOT 14M2 / 20M)
should read:
PICAXE-14M/20M Special Function Registers (NOT 14M2 / 20M2)
 

Manel_s4

Member
Okey, thanks Westaust55, I think that I have understood. So, i'ts the same to wirte C.0 or 8, am I right? And then, for my PIC18M2, to practical effects it's the same to wirte outpinsX, than pinsX, how I have said, first I have defined this PINS as outputs writing: let dirsX = %11111111

Note: X can be C or B

And, separately than this, where can I find the option to configure "single task mode" ?

Thanks a lot
 

westaust55

Moderator
So, it’s the same to write C.0 or 8, am I right? And then,
for my PICAXE 18M2, to practical effects it's the same to write outpinsX, than pinsX.

Note: X can be C or B
Yes - however while both will work some compatibility with older PICAXE parts, the recommendation is to use the Port.Pin nomenclature for the X2 and M2 parts - if nothing else it helps others here recognise which range of chips (older or newer) you are using though better to always state up front.

And, separately than this, where can I find the option to configure "single task mode" ?
Single tasking mode is automatically set if you have no (0) or one (1) "Start" label.
If you write a program without a Start label, Start0: is automatically presumed by the software at the first line
The first Start label must be Start0 followed by Start1, Start2, etc
When you use any other Start label than Start0: multitasking mode is automatically set.

Please note that it is far better to use the term "PICAXE" when referring to the Rev Ed PICAXE range and not PIC which can lead to confusion whether you have a raw/"native" PIC chip or an actual PICAXE chip with the Rev Ed firmware installed.
 
Top