Shop OBEX P1 Docs P2 Docs Learn Events
Serial Communication Question-Resolved-im not smart — Parallax Forums

Serial Communication Question-Resolved-im not smart

tom90tom90 Posts: 55
edited 2008-03-14 00:20 in Propeller 1
Hey All,

Is there anyway to perform serial communications faster than "PC_Debug", "FullDuplex", or "BS2_Functions"?
I have a loop with six operations in it that need to be output to a computer about every 2 ms.· The fastest I can get my loop to run now is ~4.5 ms.· How can I speed this up?

Thanks,
Tom

Post Edited (tom90) : 3/14/2008 5:51:29 PM GMT

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-03-13 23:41
    Hi Tom,
    I don't understand your question or your problem, what loop?

    You can speed up the question/answer loop by providing more detail and overview also.

    *Peter*
  • RinksCustomsRinksCustoms Posts: 531
    edited 2008-03-14 00:06
    ViewPort can spit data back to the PC @~80MHz (~12.5nS) apraently they charge for this program now, i have an older version, i can PM you the .spin file if you think you can decypher the code (most likely in ASM). http://mydancebot.com/viewport/

    Spin is alot slower than ASM, and emulating BS2 functions in spin would be slower yet. There may be an assembly "mini" driver floating about for high speed serial (USB speeds). But for speed, being 1:1 with the system clock is pretty good!

    Maybe there's a way to optimize your code, like if you have six separate transmissions & they are all BYTE sized, you can group them all together in two LONGs (2 LONGs = 8 BYTEs) using the BYTE command to acces the various BYTEs within a LONG or WORD.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.

    Post Edited (RinksCustoms) : 3/14/2008 12:21:10 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-03-14 00:20
    Peter is correct that it's difficult to ascertain your problem without seeing the code. What has to be at play is not the speed of the serial link but the time required for your computations between data. The reason I say this is that FullDuplexSerial is easilly capable of 115200 baud, this corresponds to a bit every 8.68 µs. Or 86.8 µs per byte (theres 2 framing bits per each byte so each byte takes 10 bits), so unless you are trying to transmit more than 23 bytes for each data packet sent to the PC, it's not your serial line which is cause problems, but your "six operations".

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.