Shop Learn P1 Docs P2 Docs Events
Require specific Guide/Manual for Propeller 2 GPIO coding in c/c++ - Page 8 — Parallax Forums

Require specific Guide/Manual for Propeller 2 GPIO coding in c/c++



  • @Wuerfel_21 said:

    @chintan_joshi said:
    Or can we add external clock in P2? RIght now i am using 256 MHZ clock frequency.

    You can just set the clock frequency higher, no external components needed. You should be able to go up to 320 MHz with no issues at all.

    @Wuerfel_21 yes with 320 MHZ its decreased 1 ms from total

    with 256 MHZ

    And with 320 MHZ

    still need to optimize it, because this filling of data slowing down my printing speed.

  • ersmithersmith Posts: 5,731

    @chintan_joshi : maybe it's time to rethink how the buffers are being filled? Some things to try:

    (1) Could the buffer be filled in the background by another cog while the main cog is doing other work? This may mean you'd have to double buffer, but would let you hide the time for the fill.

    (2) Could you pack multiple values into a long and write them all at once? It looks like the present solution writes 1 byte at a time, but writing a long word is just as fast as writing a byte, so there's a 4x speed improvement available by packing into longs first and then writing the data. You seem to have 3 sets of values, so doing this might require changing the memory layout, or else writing 12 values (3 long words) at a time.

    (3) Does the data have to be interleaved in the precise way you're doing? You may be able to improve performance with a different layout, particularly if it makes it easier to write multiple values at a time (see above).

Sign In or Register to comment.