hint on other pins

johnlong

Senior Member
Hi
Is it possible via the special functions registers to alter the A.0 or A.1 or A.2 or A.3 (pref A.0 and or A.3) to operate
as a HINT such as B.0,B.1 and B.2 (hint0, hint1, hint2) on the 28x2. To detect a serial in recieved.
It is not possible to use the pinsB as these are tided up as a bank of outputs for a
more stream lined layout on the board design. Or is it possible that when dorji DRF1276DM RX recieves a call
the picaxe pin recogises this as such an jumps to serial in.
On the slave I have this function on the 20x2 as using B.0 connected to AUX pin on the dorji
which recieves a call 2ms before RX via the hintsetup command hintsetup %00100010 to detect the rising edge
regards
john
 

hippy

Technical Support
Staff member
I suspect it's not possible to trick the firmware into using other pins but, given the 'hint' pins only latch the signal, the interrupt is still polled and actioned between commands, you are probably getting no reduced latency from using HINTSETUP than you would from SETINT.
 

johnlong

Senior Member
Hi Hippy
If you are using a T9600 baud rate which I belive holds the pin high
how would you detect serial in and an interrupt on that pin
I have tried %00000010,%00000000,A to look at pinA.1 (RX from dorji) which does not produce an interrupt
also %00000010,%00000010 and %00000010,%00000000 in the simulator with no effect
regards
 

johnlong

Senior Member
Hi
Just noticed setint in the doccument A to Z of basic commands says
#
SETINT input,mask,port(port selection on X2 only)
SETINT NOT input,mask,port(port selection on X2 only)

Input - is a variable/constant (0-255) which specifies input condition.

Mask - is variable/constant (0-255) which specifies the mask.

Port - is the X2 port (A,B,C,D).
#
and in the manual2 pdf
#
Restrictions.Due to internal port configuration on some of the chips there is a limitation on which pins can be used.
The default input port is portC.
14M/14M2only inputs 0,1,2 may be used
20M only inputs 1-5 may be used
20M2/20X2 only portC may be used, and only C.1 to C.5 on portC
40X2when using portA, only A.0 to A.3 may be used
#

can it be assumed that the 28x2 is as the 40x2
regards
 

hippy

Technical Support
Staff member
If you are using a T9600 baud rate which I belive holds the pin high
how would you detect serial in and an interrupt on that pin
I would have expected, for pin A.1 -

SETINT %000000010, %00000010, A ; Interrupt when idle (high)
SETINT %000000000, %00000010, A ; Interrupt on start bit (low)

The 'mask' ( which pins to use ) is on the right, the result to match with is on the left.

Seems to work for me when simulating -
Code:
#Picaxe 28X2

Gosub Interrupt
Do
  Pause 500
Loop

Interrupt:
  If pinA.1 = 0 Then
    SerTxd("Low", CR, LF )
    SetInt %00000010, %00000010, A
  Else
    SerTxd("High", CR, LF )
    SetInt %00000000, %00000010, A
  End If
  Return
But interrupting on start bit is hit and miss, and you can't guarantee commencing SERIN after such an interrupt without corrupting or losing data.

can it be assumed that the 28x2 is as the 40x2
I believe so, the 28X2 can interrupt only on A.0 through A.3.
 

johnlong

Senior Member
Hi
will try sending a preamble from the slave to call the interrupt sub in the master with a start transmission
for the slave'
would I need to add any other command to serial in pin to recognise the high state from the dorjia
 
Top