Shop OBEX P1 Docs P2 Docs Learn Events
Best way to move 460,800 bytes per second? (Prop-to-Prop) — Parallax Forums

Best way to move 460,800 bytes per second? (Prop-to-Prop)

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2011-02-15 07:14 in Propeller 1
For the first time, I'm looking to push my Propeller at a rate faster than ever before....

Unknown territory for me... :)

What is the best way to push 460,800 bytes from one Propeller to another?

Serial? (Not sure?) Heck, I'm not sure if Kye's SD driver can read data this.
(Time to check the specs)

A while back Beau was doing some high-speed prop-to-prop communication.
(Can't lay my hands on the thread)

Suggestions?

Thanks
OBC

Comments

  • KyeKye Posts: 2,200
    edited 2011-02-14 07:54
    Serial can push that. Can't be asychronous however. Use a SPI bus setup.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-14 08:04
    @Kye:
    Can your SD driver read that that quickly? Perhaps even a little faster?

    I was thinking that I might go 8 bit connection with a toggle bit.

    I could actually get this project down to 307,200 bytes per second, but would prefer the later.

    OBC
  • jazzedjazzed Posts: 11,803
    edited 2011-02-14 08:07
    I was thinking that I might go 8 bit connection with a toggle bit.
    That's how I do it. You can get 5,000,000 bytes per second half duplex with data on P0-7 and transfer enable/disable on P8.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-14 08:09
    @jazzed,

    Am I recreating the wheel here? Do you have a working model of this in spin already that I could follow?

    OBC
  • Jack BuffingtonJack Buffington Posts: 115
    edited 2011-02-14 08:14
    I have to disagree. You can do it asynchronously, or at least you can if you are going in just one direction only. I has been a while since I was in really deep into the timing of how the Prop works but I believe that I was achieving just shy of 12.5 megabits per second ( 1.56MB/s) using a prop running at 100 MHz and the following code, which I believe Beau originally wrote. Interestingly, I was able to send this data to 40 propeller chips with no special wiring and even more to the point, lots of connectors and connections that I thought would surely corrupt the signal so I would have to drop to a slower data rate.
                 ' Sending data
                  rol       outData,#1   wc    
                  or        outa,TXmask 'Make Pin HIGH 
                  andn      outa,TXmask 'Make Pin LOW  
                  muxc      outa,TXmask 'Make Pin HIGH or LOW   DATA
                  rol       outData,#1   wc   
                  muxc      outa,TXmask
                  rol       outData,#1   wc    
                  muxc      outa,TXmask 
                  ...
    
    RX_Start      waitpeq   RX_PinMask,             RX_PinMask 'Wait for - HIGH
                  waitpne   RX_PinMask,             RX_PinMask 'Wait for - LOW
                  'or        outa,LEDmask
                  test      RX_PinMask,             ina wc     'Read RX pin into "C"
                  rcl       temp,#1                            'Rotate temp left and place "C" in Bit0
                  test      RX_PinMask,             ina wc     'Read RX pin into "C"
                  rcl       temp,#1                            'Rotate temp left and place "C" in Bit0
                 ...
    
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2011-02-14 08:29
    This object http://obex.parallax.com/objects/546/ can do 1MB/sec (with overhead). The object itself has some problem if you don't time the cogs correctly, but the speed is definitely possible with asynchronous communication.

    I will be working on rewriting the object to remove these issues, but it will take a while, I have other things on my plate at the moment.
  • jazzedjazzed Posts: 11,803
    edited 2011-02-14 08:32
    Am I recreating the wheel here? Do you have a working model of this in spin already that I could follow?
    "There is nothing new under the sun." Ecclesiastes 1:9

    There are many variations.

    I'll be using the method with MicroPropPC for sending audio/video to the second Propeller.
    It's done in Spin/PASM and requires a shared clock between Propellers. For a functional example look here. The code may be overwhelming at first. It has many comments, but the packages are pretty big. You don't need the the "SeparateIntLine" package with only two Propellers.
    ' fragments only, setups must be done.
    
    :read
      movs         t1,      ina wz          ' looking for 0 on all bits and P[0:8]
      wrbyte       t1,      tp              ' write to ptr = address + length
      if_nz djnz   tp,      #:read          ' if t0 <> 0, continue with ptr-1; else stop 
    
    :write         ' write reverse buffer decrementing with P8 controlling read
      rdbyte       outa,    tp              ' get byte from djnz controlled pointer
      cmp          bufp,    tp wz           ' test for end condition
      if_ne djnz   tp,      #:write         ' if ptr > addr, decrement pointer and repeat
    
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-14 08:36
    @jazzed,

    It's starting to look like I'm heading toward your direction.. I see the need for an SDRAM module on my horizon. :)

    OBC
  • pjvpjv Posts: 1,903
    edited 2011-02-14 08:46
    Hello OBC;

    I wrote two very short serial routines some while ago that lets you pump out a continuous (non-bursting) 5 Megabits/second in standard ASCII format. In addition, it pulls data from a Hub buffer into the Cog, There is also a receiver at the same speed that reverses the process. Each routine take one cog, but if you are running half duplex, then both can be in one Cog.

    http://forums.parallax.com/showthread.php?120125-5Mbit-sec-ASCII-streaming-from-to-Hub-RAM&p=882980#post882980

    Cheers,

    Peter (pjv)
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-14 08:49
    @peter,

    That sounds interesting, but your link is broken..

    It's not COGs that I'm short on, it's memory, so your routines might be a good answer.

    OBC
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-02-14 09:05
    As long as your app can pull the data out of the buffers fast enough, it's very easy to write half-duplex TX and RX routines that can handle that baud rate and higher -- if I can do it then I submit anyone can!
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2011-02-14 09:08
    re:A while back Beau was doing some high-speed prop-to-prop communication. (Can't lay my hands on the thread)

    Propeller DEMO : (14.5 Meg Baud) High Speed Prop-to-Prop Serial Communication


    http://forums.parallax.com/showthread.php?99222-Propeller-DEMO-%2814.5-Meg-Baud%29-High-Speed-Prop-to-Prop-Serial-Communication&highlight=Prop+Prop
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-14 09:09
    @Bob

    Thanks! that's the thread I was talking about.

    OBC
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2011-02-14 09:29
    I know there is a 1 cog/1 wire 20Mbaud program around here somewhere, I can't find the thread, but I was going to integrate it into my 10Mbaud program (above).
  • pjvpjv Posts: 1,903
    edited 2011-02-14 10:02
  • kuronekokuroneko Posts: 3,623
    edited 2011-02-14 16:22
    Bobb Fwed wrote: »
    I know there is a 1 cog/1 wire 20Mbaud program around here somewhere, I can't find the thread, but I was going to integrate it into my 10Mbaud program (above).
    [thread=110325][POC] single wire high speed serial link (updated 20110209)[/thread]
  • ke4pjwke4pjw Posts: 1,173
    edited 2011-02-14 19:30
    If you would like to give it a try, I bet you could use my FullDuplexParallel object to get some fast throughput from prop to prop with a little modification of the handshaking lines. It is designed to work with the FT245, but the handshaking is the only thing that should need to be modified. (If that)
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-15 07:14
    Thanks guys.. This thread has given me many options to test for this project.

    OBC
Sign In or Register to comment.