One more on 28X2 serrxd / digital input please

whiteoaks7

New Member
Hippy - thanks for replying to my last query about the 28X2 pin 6 as digital input. Can I achieve the same thing then by this spoof?


SerRxd [1,lowbit],#b0
if b0 > 0 then goto highbit

lowbit: ...


the pin will have either 5 volts (the normal case unfortunately) or 0 volts. If it has zero the timeout should operate after 1mS; if it has 5 volts then b0 will be repeatedly poked with eight "1" bits. The potential problem though is whether program flow will stop while the pin is repeatedly read (forever) or does flow continue once 8 bits have been received? Will it work? Have I simulated a digital input?

Cheers - good forum by the way :)
 

westaust55

Moderator
With the # in front of the variable, the command is waiting for an ASCII encoded digit 0 to 9.
Eight "1" will give a non humerus character and terminate the SERRXD leaving b0 at an likely a value of zero which will therefore not achieve your desired aim. Thus I believe will not distinguish from a low state on the input where no data received results in a timeout.
 

hippy

Ex-Staff (retired)
It doesn't work; a continuous high level is not taken as a valid character so a timeout occurs on both high and low.

Peeking the raw port bit works though ...

Disconnect
PeekSfr $80, b0
If bit4 = 1 then ...
 
Top