Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:19 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Weird PICAXE Editor error....

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:16am 01 Jun 2021
Copy link to clipboard 
Print this post

Hi all.

Every now and again, I need to revisit a PICAXE project, and this one has me scratching my head.

I tried to tidy up some old code, by making sure there were ENDIF statements at the end of all the IF's:





PE6 is happy with this - note it highlighting the IF/ENDIF section of code.

However, when I click on 'Check Syntax', PE6 moans that there is an ENDIF without a matching IF:





This section of code is right at the top of the program, and it is the very first IF/ENDIF in the code, but there are many more.

I had to COMMENT OUT every single ENDIF, before the code would pass the syntax check.
This is odd.
I am very rusty on my PICAXE code now, as everything I do is Micromite now, but I still have a few older projects using PICAXE chips, but I figured the structured code would still be the same....

Anyone here who uses PICAXE regularly who can help me understand why the IDE likes the IF/ENDIF structure, but the syntax check does not?  One contradicts the other.  
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 07:31am 01 Jun 2021
Copy link to clipboard 
Print this post

line 62 looks like a single line IF

try
IF flag_bt = 1
start
ELSE
...
ENDIF


Jim
VK7JH
MMedit
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:45am 01 Jun 2021
Copy link to clipboard 
Print this post

AHHHHHHH!!!!!!!  

Too long away from PICAXE and too much time with MM now!!!!  

Going back to PICAXE just for a little while, is quite a change!
So used to the MM now.  

Thanks for the prod, that seems to be where the mistake is, cos it is now working as expected.  
Smoke makes things work. When the smoke gets out, it stops!
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 09:24am 01 Jun 2021
Copy link to clipboard 
Print this post

time for a brain transplant?... but for whom???    

I did a brain transplant on a big project based around PIC assembler. Made up a tiddly board to take a 44pin 170 and fit it in a 40pin DIL (where a PIC 16F877 had been). Few wrinkles with some of the circuitry going from 5V to 3V3 but overall a success.

I have tons of PICs that I use for projects that I think I will probably die with now - from the tiny 8pin up to the 40pin bruisers. A mite is my first choice now, especially if the Pico becomes as viable as it looks atm. GBP3.60 - I can't buy 170s for that let alone the PCB and a sprinkling of SMDs. May be a bit premature but I already started on an Eagle footprint for adding it to boards. The castleations are a nice plus

Mites of all flavours have slashed my dev cycle time. It used to take days sometimes, to track a bug in ASM but now I can get the core of a new project chucked out in a day with tweaks and frills from there on in.
Edited 2021-06-01 20:25 by CaptainBoing
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 12:08am 02 Jun 2021
Copy link to clipboard 
Print this post

Re: Brain transplant - perhaps both!  

Yes, the MM is also my go-to MCU now, and has been for quite a few years, but this old project based on PICAXE I just wanted to add a couple of extra routines, but have been away from PICAXE for so long, that I got myself a little muddled up with the syntax.

Yes, I am also watching the PICO development with much interest also.  I agree that the price of the PICO makes it hard to overlook as a candidate, especially if Peter can get MMBASIC to run on it reliably.  As you mention, you can't buy the 170 chip alone for the price of the entire PICO module, so the price of the PICO is very attractive and very hard(if not impossible) to beat, so that port is one I am definitely watching!  

  Quote  Mites of all flavours have slashed my dev cycle time. It used to take days sometimes, to track a bug....


TOTALLY agree.  Even in the PICAXE, it took about five or six separate uploads to get it running how I wanted, once Jim pointed out where my syntax error was - and I used the DEBUG window with the code running where I found I was 'Borrowing' one of the bytes that make up one of the words - a word I was already using, which was also mucking things up.
Don't get me wrong - the PICAXE is a stellar device for learning how to work with MCU's and for simple stuff, but they just don't have the feature-set that the MM chips do for more advanced work.

With the MM, I can CTRL-C break the running code on the console, and DIRECTLY examine pin values and variables when debugging, which you can't do on the PICAXE - you have to run the code, and use the debug window, then change the code, and recompile/download to test if it works.  If not, you have to try something else and go through that process again.

I suppose it is half-a-dozen of one and six of the other really, but I certainly much prefer the MM with its built-in editor, cos you can debug right there directly on the chip rather then having to go through multiple compile/download cycles to see if you have fixed a bug.  Again, not speaking ill of PICAXE - I still use a few of them as you can see from this thread, but I like the MM much better, that's all.  

Anyhoo......
Smoke makes things work. When the smoke gets out, it stops!
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 01:16am 02 Jun 2021
Copy link to clipboard 
Print this post

Could one use a PicAxe with
just the FTDI cable and a Raspberry Pi  
my site
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025