Problem with code from 2013 (UV exposure box for PCB's)

clockwork

Member
I have now reached a point where I would like to make my own PCB's and now want to make a UV exposure box. I found an excellent design that uses a 08m2 picaxe with an ic2 driven display that uses a rotary encoder. This design is by Jari Majaniemi which can be found at :-

justaddelectroniss.com/blogi/pcb-exposure-timer-with-picaxe-microcontroller-and-lcd-display/

After downloading the basic file I carried out a syntax check. The result being an error
#ifdef 08m2
Syntax error on line 122 at position 1
Error : Symbol expected (try adding _prefix before the 0)

This worked for the 08m2 and 28x2 lines but raised another error

bintoascii bTemp, bTemp2, PTRINCVAL, PRINCVAL ^
Syntax Error on line 492 at/before position 48
Error: @bptrinc cannot be used as for variable. (Jari expects a similar error will occur at line 502)

I have contacted Jari the codes author and he suspects there has been some sort of update to the basic since 2013 as his software worked correctly then. Jari is no longer in a position to try and correct the problem. Whilst I am capable of building the project I am out of my depth when it comes to being able to get the software working correctly.

Barry G8RIW ( clockwork )
 

Attachments

AllyCat

Senior Member
Hi,

Are you sure that web link is complete, and is it really electroniSS... ?

Neither of those lines are "complete" so it's difficult to predict the exact error. But first it's best if you tell us which Program Editor and version number you're using, PE5 or PE6, version ??

Cheers, Alan.
 

clockwork

Member
Thanks for the reply.
it is "justaddelectrons.com/................................................. (my fingers can't spell)

I am using Picaxe Editor 6 v 6.1.0.0

Hope that helps. Barry
 

AllyCat

Senior Member
Hi,

OK, I've modified the code to eliminate the syntax errors, but can't guarantee it will run correctly. I needed three more variables, b26 and b27 seemed free, but I used s_w1 for the third. That should be fine for the 08M2, but for the 28X2 you can use a variable above b27.

Basically, add the "_" as suggested by the error message, i.e. change to #ifdef _08m2 and #ifdef _28x2
There might be another method, but the following substitutions seem to work:
Code:
    bintoascii bTemp, bTemp2,b26,b27
    PTRINCVAL = b26
    PTRINCVAL = b27
;  and
    bintoascii wTemp, bTemp, bTemp2,s_w1,b26,b27 
    PTRINCVAL = s_w1
    PTRINCVAL = b26
    PTRINCVAL = b27
I think they're required because of "improvements" or bugfixes in PE6.

Cheers, Alan.
 

Attachments

lbenson

Senior Member
(Alan beat me to it. And I should have looked more carefully--b15,b16,b17 are used elsewhere, so Alan's code will be better.)

Re "#ifdef 08m2", this now requires an underscore for a predefined constant, e.g., "#ifdef _08M2", etc.

Re "bintoascii bTemp, bTemp2, PTRINCVAL, PTRINCVAL", PTRINCVAL is defined "SYMBOL PTRINCVAL = @ptrinc". bptrinc was found to be unreliable in some instructions like bintoascii, so became disallowed. You'll have to find some other variables to receive the conversion from bintoascii.

I haven't looked carefully over the program, but b15, b16, and b17 seem to be available. If so, you could replace the statement with
bintoascii bTemp, bTemp2, b15,b16

Also here:
' bintoascii wTemp, bTemp, bTemp2, PTRINCVAL, PTRINCVAL, PTRINCVAL
bintoascii wTemp, bTemp, bTemp2, b15,b16,b17
PTRINCVAL=b15: PTRINCVAL=b16: PTRINCVAL=b17


With these changes, the program passes syntax, I can't say if it will run correctly.
 

clockwork

Member
Thank you both for a very quick reply. I will be putting the circuit on a breadboard tomorrow so I will be able to test it. I will be making some small changes to the given circuit by using a relay initially instead of a MOSFET as I do not have any of the specified type. Assuming that works O.K. I can try out my limited supply of MOSFETS and see how well thay work. Also I will be using a piggy back board with the LCD rather than the separate ic. None of these changes should affect the way the circuit behaves.
Once again many thanks. Barry
 

Electlen

New Member
I make my own printed circuit boards using a UV Light Box, the exposure is always 4 minutes which I time using my mobile phone. Job done!
 
Top