two SerOut commands

hippy

Ex-Staff (retired)
I want to receive this serially transmitted signal in the 14M2 (last submitted code) and in turn use that serial data to turn outpins high as though the 20M2 was connected to the 6 switches.
So I would guess all bits that represent the BCD switch are sent together, and from that, all related outputs are set high or low. IN which case, all you should need in the receiver is something like ...

Code:
dirsB = %11111111
Do
  SerIn C.3, N2400, ( "XYZ" ), b0
  pinB.5 = bit5  
  pinB.4 = bit4  
  pinB.3 = bit3  
  pinB.2 = bit2  
  pinB.1 = bit1  
  pinB.0 = bit0  
Loop
 

westaust55

Moderator
Rather than having 6 inputs on the 20M2 to correspond to the remote switches, you could consider just three lines for 14M2 to 20M2.
That will give you %000 = 0 when no switch pressed, %001 = 1 when first switch pressed, %010 =2 when 2nd switch pressed through to %110 = 6 when 6th switch pressed and %111 = 7 is spare (for future).
If those three pins are consecutive on a port it is easy to "fetch" the number 0 to 6 or 7 for use in a SELECT...CASE program structure.
 

Jaden

Senior Member
Thanks wetsust55 and hippy. What I am first trying to do is Tx and Rx 6 buttons from the control panel and then use the 14M2 to send highs out to act as switches to the 20M2 (same board) which drives the big two segment display, send all eight bits in b20 (from control panel) and receive them at the 14M2 (in clock) which then are coded in the 14M2 to turn o/p's high to the 20M2, this has been my main problem. I was using binary at this stage and it was working! But not now, but now I am doing it the right way, I hope.

Now the stage you both mentioned is another stage. At the control box I have a BCD switch, this sets the match time (smaller segments) this I will also send via a register in binary and is only looked at once at the start of all games, unless a master reset is sent. At the Rx end (14M2) to save pins I am then going to resend this Serin, say b2 back out, serout, to the same onboard 20M2 and decipher it there. This is latter when I get the above working.



bcd.jpg

Attached is what I have constructed to help you see what I am trying to achieve. Please not that pin 21/D.2 from the 40x2 to pin 4/C.3 represents a wireless link, I cannot find one in the VSM software! This is pretty much how I have me circuit thus far, hard wired between the control panel and the clock.

View attachment Shot Clock flow path.pdf
 

Attachments

Top