SetINT - Pin restrictions ?

zorgloub

Member
Hello all,

Today, I am looking into the possibilities of INTerruption of the Picaxe.
The instruction book indicates some pin restrictions depending on the type of Picaxe.
So I translated into a Excel file attached, which I understood ...
(remove .txt extension)
Does this recap seem correct to you?

Thanks for your help.
-------------------------------------------------View attachment Pins iNTerrupt.xlsx.txt
 

techElder

Well-known member
zorgloub, I'm not running an Excel file on my computer that I got off of the Internet.

Can you post some simple text or print your output to a PDF file and post that for all to see?
 

zorgloub

Member
So, after having re-read the SetINT Instructions Set, I tested with the following program:
(I change each time the value of the inputs to monitor (second term of the command) and the port for larger Picaxe 28X2 and 40X2)

Code:
#picaxe 28X2 'Tried with each Picaxe
SetINT % 00000000,% 11000000, A   'Expected state on each entry of the Port, Entrance(s) to be watched, Port
Do: Loop
; -------------------------------
Interrupt:
 Return
; =================
I then see inconsistencies with the set instructions:
(All results are in the attached pdf)

-18M2: C.3 does not allow Interruptions
-28X2: the editor does not give an error if we configure an interruption on A.5, A.6 and A.7 ... which do not exist !!
-40X2: No error if we configure an interrupt on A.4 to A.7. What does not comply with the instructions set!

So where is the bug and what are the correct answers for each Picaxe?
View attachment Pins iNTerrupt_2.pdf
 

hippy

Technical Support
Staff member
Only pins which can be input and actually exist on a chip can be used. And there are also some exclusions which limit which pins can be used.

For example, on the 18M2 C.3 is the Serial Out pin. It cannot be used as an input so cannot be an interrupt pin.

What can be used may differ from what PE6 allows to be specified. Even though it may be possible to specify a pin that does not mean it can be used.

For example, on the 28X2 there is currently no warning given if a non-existent A pin is specified, or any pin on the entirely non-existent D port.

Then, on top of that, I would guess there is what the PE6 simulator behaviour is against actual hardware behaviour which may have to be checked.

I have updated the on-line reference to make things clearer as to which pins can be used -

http://www.picaxe.com/BASIC-Commands/Interrupts-and-Multi-Tasking/setint

As far as I can determine from looking at the pinouts, the following pins can be used as SETINT pins -

08M2 : C.1-C.4
14M2 : C.0-C.2
18M2 : C.0-C.2, C.4-C.7
20M2 : C.1-C.5

20X2 : C.1-C.5
28X2 : C.0-C.7, B.0-B.7, A.0-A.3
40X2 : C.0-C.7, B.0-B.7, A.0-A.3, D.0-D.7

It seems to me that the only uncertainty which exists is over A.4 on the 28X2 and A.4-A.7 on the 40X2. I would have to do further investigation to say what the situation is for those.
 
Last edited:

zorgloub

Member
Thank you very much for looking at these findings of use.

OK. It is normal that an output can not be configured as an INTerrupt input.
I took the DIR (i / o) of each pin on my attached summary file.

It is very confusing that the Picaxe Editor does not react according to the Instructions Set that you have just updated.
Bug in this Editor ?

So, on the 28X2, A.4 being an output, the Editor should give an error.
It does not give an error either for entries that do not exist (A.5 to A.7)

Similarly, for the 40X2, A.4 is also an output and should therefore give an error.
It would indeed remain to check what is then A.5 to A.7 which are i / o.

Finally, if one uses C.5 on the 08M2, the error given by the editor does not make it possible to compile the program.

I went to see the link (Instructions Set) that you just updated. (http://www.picaxe.com/BASIC-Commands...Tasking/setint)

I made my remarks in the attached file.

It may be appropriate to consider this for the next release of picaxe Editor ?

Thanks

Summary file: View attachment Pins iNTerrupt_3.pdf
 

hippy

Technical Support
Staff member
The error of stating C.5 was available for the 08M2 was my mistake. I should have confirmed that in PE6 but have corrected it above and on the SETINT page.

Issuing a warning about use of A.4 and A.5-A.7 when those pins cannot be used will have to be discussed with the PE6 team. Most PICAXE users will understand that they cannot use pins which are output only or don't exist for interrupts so I imagine it is not really an issue for most people.
 

zorgloub

Member
Hi Hippy,

OK no problem.
I really think that these constructive exchanges allow the improvement of the material, the programs and the documentation made available to the users.
We can thank you for the speed with which you update the information on the Picaxe website.

Finally, is there still any doubt about the possibility of configuring an INTerruption, or not, on inputs A.5, A.6 and A.7 of the 40X2?
The documentation would then be complete.

Cordially
----------------------------------------
 
Top