Shop OBEX P1 Docs P2 Docs Learn Events
Question about the FullDuplexSerial Driver — Parallax Forums

Question about the FullDuplexSerial Driver

jmbertoncelli@USAjmbertoncelli@USA Posts: 48
edited 2008-07-09 22:31 in Propeller 1
Hello I would like to know if it is possible to increase the size of the circular buffers used to store inbound and outbound bytes from 16 that is their current value to something larger 1K or more?

thanks!

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2008-07-09 22:15
    hello jmbertoncelli,

    Yes it is possible. But in FullDuplexSerial you have to change the SPIN-code and the PASM-code.
    In the original file the buffersize is the hardcoded number "16" and some 16 - 1 = 15

    If you go over 511-bytes you have to change some more of the PASM-code
    (some calculations with the buffersizes must be changed from using a constant expression to a RAM-adress)

    There is another serial object in the obex where it is easier to change

    SerialMirror

    obex.parallax.com/objects/189/

    there it is enough to change some SPIN-constants
    and the size of the DAT-section

    Read the documentaion inside the file CAREFULLY

    especially
    4) This object is NOT suitable for driving multiple serial ports.
    If you want multiple serial ports each with single object access, then
    use FullDuplexSerial.
    If you want serial comms through the same port from multiple objects,
    then use THIS object.
    If you want multiple serial ports each with multi-object usage, then copy
    and rename this files for the number of unique serial ports.


    best regards

    Stefan
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-09 22:17
    You can easily modify FullDuplexSerial for any buffer size that's a power of 2. Attached is a version used in DongleBasic from the Parallax Object Exchange. There are a few definitions in BB_definitions.spin that are used. If you move them from BB_definitions.spin to BB_FullDuplexSerial.spin, then you won't need BB_definitions.spin.
  • jmbertoncelli@USAjmbertoncelli@USA Posts: 48
    edited 2008-07-09 22:31
    Thanks for your quick answers! I was able to figure it out and I have updated both the spin and in-line asm code. I shall check your solutions as well.

    thx!
Sign In or Register to comment.