Shop OBEX P1 Docs P2 Docs Learn Events
Serial Comms Between Propeller and SX — Parallax Forums

Serial Comms Between Propeller and SX

SailerManSailerMan Posts: 337
edited 2009-01-06 04:10 in General Discussion
This has been hammer in these forums before but I need to understand why this doesn't work

Propeller Code
Con
        _clkmode        = xtal1 + pll16x
        _xinfreq        = 5_000_000

Var                        
                     
OBJ

  Serial :"FullDuplexSerial"

Pub Main | Index

    Serial.Start(0,1,%0100,2400)
   
    Repeat 
       Serial.STR(String("!"))
       WaitCnt (Cnt+10_000_000)



SX Code
DEVICE          SX28, OSCHS3
FREQ            50_000_000
ID        "Serial Input"


' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------

SerialIn    Pin    RA.1     Input ' LED pin
AlarmLED    Var     RA.0
ErrorLED    Var     RA.2
Temp         Var     Byte
Baud        Con    "T2400"
  
 

' =========================================================================
  PROGRAM Start
' =========================================================================
 
Start:
  DO
    
        Serin SerialIn,Baud,Temp,50,Flash
     
        If Temp="!" Then                    
            Toggle AlarmLed 
    Endif                           
  LOOP

Flash:
    Toggle ErrorLED
Goto Start



I can't seem to get this to work... Why doesn't the SX read the "!" Will the SX read serial data from the propeller seeing as the propeller's voltage is lower that the SX?

This is the full code.

Thanks,
Eric

Post Edited (SailerMan) : 1/6/2009 3:58:57 AM GMT

Comments

  • kwinnkwinn Posts: 8,697
    edited 2009-01-06 04:00
    What is the "T" for in "Baud Con "T2400"" of the SX code? (Not familiar with SX)
  • Harrison.Harrison. Posts: 484
    edited 2009-01-06 04:06
    Do you have a pullup on the serial i/o line?
  • SailerManSailerMan Posts: 337
    edited 2009-01-06 04:10
    There is a 4.7k pullup... and the T Stands for True (Non-Inverted)

    Here is a scope view of the Propeller Serial Out

    Post Edited (SailerMan) : 1/6/2009 4:19:33 AM GMT
Sign In or Register to comment.