Shop OBEX P1 Docs P2 Docs Learn Events
Question about TAQOZ and smart pins — Parallax Forums

Question about TAQOZ and smart pins

Hi,

When I run commands such as "58 PIN 1 HZ", or "56 BLINK", does the Propeller use any processing, or do the smart pins all the work?

Also, is it possible to output analog signals (triangle waves, etc) via TAQOZ?

Kind regards, Samuel Lourenço

Comments

  • jmgjmg Posts: 15,173
    samuell wrote: »
    ...does the Propeller use any processing, or do the smart pins all the work?

    It's both :)
    The Smart Pin is what finally runs and controls the pin, but the P2 needs to first use processing to parse the command and load the pin config.

    I would like to see ALL smart pin modes made easily accessible from TAQOZ
  • samuellsamuell Posts: 554
    edited 2019-01-24 03:32
    Thanks jmg,

    So the smart pins change state on their own, and the cogs only "instructs" the smart pins, if I understood correctly. That is very neat and a quite powerful feature. That means I don't have to make a routine on my program and use a cog if I want a LED blinking.

    And what about analog functions? I know Chip tested this a while ago, but it would be cool to implement this just with a TAQOZ command, or some program.

    Kind regards, Samuel Lourenço
  • samuell wrote: »
    Thanks jmg,
    ...
    And what about analog functions? I know Chip tested this a while ago, but it would be cool to implement this just with a TAQOZ command, or some program.

    Kind regards, Samuel Lourenço
    I've written a couple of TAQOZ programs that use smart pins as ADCs reading the voltage from potentiometers.

    This post https://forums.parallax.com/discussion/comment/1462271/#Comment_1462271 has the program that uses pin 22 as a Smart Pin started in cog 1 and printing the results from cog 0. A couple of posts later I expanded it to read the voltages from 2 pots using Smart Pins 22 and 23, again in cog 1.

    In the case of these programs cog 1 is doing some processing using RDPIN to read the result of the ADC conversion.

    Tom
  • Thanks twm47099,

    I didn't specified what I meant by analog functions. Basically, outputting sine, triangle, sawtooth and other waveforms.

    Although, testing an ADC would be fun.

    Kind regards, Samuel Lourenço
  • jmgjmg Posts: 15,173
    samuell wrote: »
    I didn't specified what I meant by analog functions. Basically, outputting sine, triangle, sawtooth and other waveforms.

    The streamer can feed the DACs, and the DOCs suggest you can re-loop the streamer memory, and FBLOCK looks like it supports a seamless table switch.
    That means you could define wave tables, of one full cycle of N samples of sine, triangle, sawtooth and other waveforms and have the Smart Pin call + Steamer.
    Single tone is set and forget, and Frequency Modulation looks to need minimal software.

    Whilst you could have > 60 pins generating different digital smart pin modes, there is 1 streamer per cog, so only 8 wave-table -> DAC generators could be created.


  • samuellsamuell Posts: 554
    edited 2019-01-24 13:51
    jmg wrote: »
    samuell wrote: »
    I didn't specified what I meant by analog functions. Basically, outputting sine, triangle, sawtooth and other waveforms.

    The streamer can feed the DACs, and the DOCs suggest you can re-loop the streamer memory, and FBLOCK looks like it supports a seamless table switch.
    That means you could define wave tables, of one full cycle of N samples of sine, triangle, sawtooth and other waveforms and have the Smart Pin call + Steamer.
    Single tone is set and forget, and Frequency Modulation looks to need minimal software.

    Whilst you could have > 60 pins generating different digital smart pin modes, there is 1 streamer per cog, so only 8 wave-table -> DAC generators could be created.

    Nice, that means I can build an AWG with this. I'm looking for a good DAC able to perform AWG, like the AD9102, but unfornunately the AD9102 datasheet is terse. Everyone that has experimented with that chip complains about the datasheet. The P2 could be an alternative, although 180MSPS will probably not be achievable with this.

    Kind regards, Samuel Lourenço
  • The AD9102 is primarily a DDS chip, not a DAC, but it has a configurable wavetable RAM. As its 14 bit native
    its capable of direct RF or baseband signal generation. Not sure dithered 8-bit is enough for this.
  • Mark_T wrote: »
    The AD9102 is primarily a DDS chip, not a DAC, but it has a configurable wavetable RAM. As its 14 bit native
    its capable of direct RF or baseband signal generation. Not sure dithered 8-bit is enough for this.
    I know. But the P2 can be used as a DDS too, albeit a much slower one. In essence, a waveform generator DDS is a DAC controlled by a LUT, in turn controlled by some form of micro-controller.

    Kind regards, Samuel Lourenço
  • jmgjmg Posts: 15,173
    samuell wrote: »
    I know. But the P2 can be used as a DDS too, albeit a much slower one.
    It would be interesting to run the two on one PCB to compare.

    You can get close to DDS by using a larger table, which lowers the granularity.
    eg a Streamer table of ~64k Bytes would offer steps of 15ppm in frequency generation. For many apps, that would be good enough.
    Higher frequencies have multiple cycles in the table, but those cycles are not quite exact cut/paste copies, but are equation generated.
    Table size adjusts as required to always contain whole numbers of cycles.
  • samuellsamuell Posts: 554
    edited 2019-01-24 21:49
    jmg wrote: »
    samuell wrote: »
    I know. But the P2 can be used as a DDS too, albeit a much slower one.
    It would be interesting to run the two on one PCB to compare.

    You can get close to DDS by using a larger table, which lowers the granularity.
    eg a Streamer table of ~64k Bytes would offer steps of 15ppm in frequency generation. For many apps, that would be good enough.
    Higher frequencies have multiple cycles in the table, but those cycles are not quite exact cut/paste copies, but are equation generated.
    Table size adjusts as required to always contain whole numbers of cycles.
    Well, the AD9102 has a small lookup table. It is just for 4096 samples, and I don't know it is just for storing a quadrant, or the full wave. Conversely, it has a much higher resolution and it is faster. It doesn't require a micro-controller, as a simple CP2130 chip can control it, but it does require more software development on the host side.

    On the other hand, the P2 is good enough for audio signal generation and some more, and you can have more than one channel for the same cost. I'm just exploring the possibilities, if the AD9102 implementation fails. Also, it is easy to control via the serial port, and requires no additional software on the host side, except for programming.

    I'm comparing apples to oranges, but in the end, the P2 can act as a DDS with the right programming.

    Kind regards, Samuel Lourenço
  • DDS chips ROM sinetable is usually a quadrant - the user writable one will likely not be.

    You want about as many bits of sinetable address as DAC bits to balance out the magnitude of errors from
    each, the waveform step granularity is constrained by both limits and sets the noise floor.
  • Mark_T wrote: »
    DDS chips ROM sinetable is usually a quadrant - the user writable one will likely not be.

    You want about as many bits of sinetable address as DAC bits to balance out the magnitude of errors from
    each, the waveform step granularity is constrained by both limits and sets the noise floor.
    The AD9102 allows you to upload a waveform. The predefined waveforms are not writable, but there is an area of the chip that you can write to and then use as a LUT controlled by the NCO.

    The same could be done with the P2, by uploading your waveform to the streamer.

    Kind regards, Samuel Lourenço
Sign In or Register to comment.