Shop OBEX P1 Docs P2 Docs Learn Events
BS2_Functions with PropTerminal — Parallax Forums

BS2_Functions with PropTerminal

stampedstamped Posts: 68
edited 2007-07-10 12:35 in Propeller 1
I have finally found the time to do some Propeller prototyping. I am having a bit of an issue with the BS2_Functions and specifically the debug methods such as DEBUG_STR. When I run the DEBUG_STR it does not come up on the PropTerminal. I have tried setting the baud in BS2_Functions CON declarations from 9600 to 115200 but no luck. I am running the output through the USB2SER (Parallax product) and the lights on it blink when I call the DEBUG_STR, so it appears it is transmitting from the Propeller but the PropTerminal is not outputting anything.

Note: I can get output on the PropTerminal with the exact same setup utilizing the PC_Interface object and calling the "str" method. I want to use the BS2_Functions for the other convenience methods within. I am trying to get to first base before trying out the other methods.. Any ideas what is going wrong?

Some code (note that the "term" code when uncommented works,·the BS2 code does not):

CON
··· _clkmode = xtal1 + pll16x
··· _xinfreq = 5_000_000


OBJ
··· BS2 : "BS2_Functions"
··· 'term : "PC_Interface"


PUB main
··· ' Time to open the PropTerminal
··· WaitCnt(320_000_000 + Cnt)
··· BS2.start(31, 30)
··· 'term.start(31, 30)

··· repeat
····· BS2.DEBUG_STR(string("Hello from Propeller!"))
····· 'term.str(string("Hello from Propeller!"))
····· WaitCnt(80_000_000 + Cnt)

Comments

  • AribaAriba Posts: 2,685
    edited 2007-07-09 22:32
    The BS2_Functions are coded in Spin. Spin is not very fast, the max. serial transmission speed with Spin is 19200 Baud (with SimpleSerial). The Serial Routines of PC_Interface.spin are made with Assembly, so 115200 Baud is no problem.

    Andy
  • stampedstamped Posts: 68
    edited 2007-07-10 10:50
    Thank you for the tip Andy. To get the increased Baud rate, I have ported the SEROUT_STR method in BS2_Functions. The issue that I now have is that the first serial communication i send utilizing the ported SEROUT_STR utilizing the FullDuplexSerial is that the first string that is output is concatenated. It only outputs the first few characters. All subsequent strings are output fully on the PropTerminal. Any ideas why there would be concatenation on the first serial tx?

    One additional issue is that I want to be able to perform Serial communication concurrently on two devices (USB2SER and RF Modules). Is this possible? The reason I ask, is that the start method in FullDuplexSerial takes pins, so how do I seperate instances of this FullDuplexSerial Object so I can perform concurrent serial communications on different pins?
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-07-10 11:38
    Speed has nothing to due with the issues you are seeing with BS2_Functions (though yes, limited to 9600).· I think it is more a matter that you have 2 different objects trying to control the same pins.· Since they idle high, and a high wins over a low, the data is never being sent from one.

    Use just BS2 or Term, but not both with the same pins.



    -Martin







    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • stampedstamped Posts: 68
    edited 2007-07-10 12:35
    Thanks for the input Martin. I have PropTerminal and the FullDuplexSerial running now. It appears speed was the issue, as I read that the PropTerminal needs 115200 baud. When I changed FullDuplexSerial to run at 115200 baud I now have output on the PropTerminal.

    The concatenation was because I was calling start more than once. I need to get some sleep!

    Note: I found the answer to the second question regarding the separation of objects so please disregard this. And note that at this moment, I am trying to get the FullDuplexSerial.str to be reliable for the PropTerminal.
Sign In or Register to comment.