Picaxe-20X2 syntax error testing a bit's value

wyzard28

New Member
My first post and already I'm in need of a dose of the Forum's help.

My problem: I see in the latest manual that with my picaxe-20X2 I should be able to use the following if statement:

IF variable BIT value SET THEN
{code}
ELSEIF variable BIT value CLEAR THEN
{code}
ENDIF

I've defined a symbol SCPRegVal = b0 and written the above like:

IF SCPRegVal BIT 5 SET THEN
goto data_ready
ELSEIF SCPRegVal BIT 5 CLEAR THEN
goto data_not_ready
ENDIF

The two labels "data_ready:" and "data_not_ready:" have been defined elsewhere in the program. A syntax check gives me an error on the first line (IF variable BIT value SET THEN).

I'm nuts, right?
 

MartinM57

Moderator
This compiles perfectly for me - PE version 5.2.6 (yeah, I know, one version too old)

Code:
#picaxe 20x2

symbol SCPRegVal = b0

IF SCPRegVal BIT 5 SET THEN
    goto data_ready
ELSEIF SCPRegVal BIT 5 CLEAR THEN
    goto data_not_ready
ENDIF

data_ready:
data_not_ready:
EDIT:...and PE 5.2.7
 
Last edited:

wyzard28

New Member
The plot thickens...

This could be part of the problem. I'm using MacAXEpad - Version 1.0.0.
I have set the options mode for picaxe-20X2.

I went out today and picked up a copy of VMware Fusion for my iMac. I've now loaded Windows and the picaxe P.E. Guess what? I've just tried the code on the P.E. and it compiles correctly, so I'm pretty sure the problem lies with the MacAXEpad. Is there someplace I should file a bug report?

MartinM57 and kewakl -- thanks very much for your interest and help. I'm new here, but plan on being an active participant if y'all will put up with me. I have a number of sensors and LCD output devices I plan on interfacing to. I'll be happy to share my code as soon as I feel a bit more confident with my new Picaxe-20x2s.

Just remember: you can lead a horse to water, but a pencil must be lead.

_richard
 

hippy

Ex-Staff (retired)
I've just tried the code on the P.E. and it compiles correctly, so I'm pretty sure the problem lies with the MacAXEpad. Is there someplace I should file a bug report?
The AXEpad and Compiler Support forum would be the best place, but the issue has been noted and will be passed on.
 

wyzard28

New Member
The AXEpad and Compiler Support forum would be the best place, but the issue has been noted and will be passed on.
Thanks, Hippy. If I run into any other problems, I'll post them there. I'm going to continue developing on MacAXEpad for as long as possible. It's so refreshing being able to develop on my Mac for a change! And I'm rather tickled by the speed and capabilities of the X2 series Picaxe chips. I was expecting a struggle to bit-bang a communications link to the SCP-1000 D01 pressure sensor but the 20X2 blew me away because it made SPI so easy.
Couple that with on-line tech support that is rapid and extremely helpful, a vigorous user base and forum, I can see myself using Picaxe much more often.

You guys are as awesome as is your product!

_richard
 
Top