Shop OBEX P1 Docs P2 Docs Learn Events
Realtime control, interception of microsecund pulses is possible with BS or Prop ? — Parallax Forums

Realtime control, interception of microsecund pulses is possible with BS or Prop ?

CuriousOneCuriousOne Posts: 931
edited 2012-11-24 23:34 in General Discussion
Hello.

The question is as follows:

We have two data lines, clock and data. The clock pulses are sent each 10 microsecond, data pulse is sent on fall of clock pulse and may be up to 20 times longer than clock pulse. The task is as follows: capture both clock and data pulses and forward them to output, but analyze the data pulses and replace certain sequence of pulses with another sequence. The sequence length to be analyzed and modified is 11 data pulses, which can take up to 2.2 millisecond in total.

Is this doable with parallax products?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-11-23 12:20
    The Propeller can do this in assembly language, maybe in Spin depending on details of what has to occur. The Basic Stamps are just not fast enough.

    The Propeller's instruction time is 50ns (for most instructions). Spin operations take on the order of a few us. For an example of speed, there's an asynchronous serial I/O driver that handles over 750KB with the low level I/O written in assembly language. There's a similar serial I/O driver written all in Spin that can handle 19.2KB.
  • kwinnkwinn Posts: 8,697
    edited 2012-11-24 14:11
    If the width of the data pulse represents a zero or one this would be simple to do with the propeller. If the data pulse width represents multiple bits or an analog value it would be a bit more difficult but still doable. Take a look at the RC time and serial data objects for code examples.
  • CuriousOneCuriousOne Posts: 931
    edited 2012-11-24 22:49
    The clock pulses are of fixed width and spacing. The data pulses also are of fixed length, except several fixed values, which indicate begin/end of transmission, packet, etc.
  • kwinnkwinn Posts: 8,697
    edited 2012-11-24 23:34
    CuriousOne wrote: »
    The clock pulses are of fixed width and spacing. The data pulses also are of fixed length, except several fixed values, which indicate begin/end of transmission, packet, etc.

    Then it should be fairly straight forward to use the falling edge of the clock pulse to start one of the counters and the appropriate edge of the data pulse to stop it. The value in the counter would indicate the type of data pulse. One cog could decode the incoming pulses and store the result in hub memory, a second cog processes (converts/transfers as required) the data sequences, and a third cog outputs the processed data and clock pulses.
Sign In or Register to comment.