Passing values between pics

sbscott

Senior Member
Talk about a mind block! I have done this before, I think...
I am trying to transfer a value from an 20m2 to a 08m2 that will be used as a variable in a servo command (servo c.2, b1)
What commands do I use?
Thanks!
 

lbenson

Senior Member
serout and serin, possibly with a timeout on serin if hardwired. Depending on what you are doing, handshaking might be required. It is possible to handshake on the same line you are using for the serial connection.
 

hippy

Ex-Staff (retired)
When controlling servos, if using SERVO and SERVOPOS commands, you may want to use HSERIN rather than SERIN to prevent any blocking from disrupting the servo, and any timeouts of SERIN causing you to miss data.

That HSERIN would also be recommended if using a bit-banged servo timing loop. Untested ...

Code:
HSerSetup ...
Servo SERVO_PIN, 150
Do
  w0 = $FFFF
  HSerIn w0
  If b1 = 0 Then
    ServoPos SERVO_PIN, b0
  End If
  Pause 10
Loop
 
Top