2

I'm trying to build tikz-timing example as code below but I have an error:

Package pgfkeys Error: I do not know the key '/tikz/timing/counter/new'

Help me to fix this. Thank you!

    \begin{tikztimingtable}[timing/d/background/.style={fill=white},
 timing/lslope=0.2, 
 timing/counter/new={char=Q,reset char=R},
 ]
    CPOL =0 & LL 15{ T} LL \\
    CPOL =1 & HH 15{ T} HH \\
            & H 17L H \\
    \\
    Cycle \# & U R 8{2 Q} 2U \\
    MISO & D{z} R 8{2 Q} 2D{z} \\
    MOSI & D{z} R 8{2 Q} 2D{z} \\
    \\
    Cycle \# & UU R 8{2 Q} U \\
    MISO & D{z}U R 8{2 Q} D{z} \\
    MOSI & D{z}U R 8{2 Q} D{z} \\
\extracode
 % Add vertical lines in two colors
 \begin{pgfonlayer}{background}
    \begin{scope}[semitransparent,semithick]
        \vertlines[red]{2.1 ,4.1 ,... ,17.1}
        \vertlines[blue]{3.1 ,5.1 ,... ,17.1}
    \end{scope}
 \end{pgfonlayer}
 % Add big group labels
 \begin{scope}[font =\sffamily \Large ,shift={(-6em,-0.5)},anchor=east]
    \node at (0,0){SCK};
    \node at (0,-3){SS};
    \node at (1ex,-9){CPHA=0}; 
    \node at (1ex,-17){CPHA =1};
 \end{scope}
\end{tikztimingtable}%
2
  • Can you please include the preamble? At least only the necessary packages to run your code. :) Thanks.
    – Alenanno
    Jan 29, 2016 at 9:16
  • Please supply us with a minimal working example, so that we don't have to spend time making a full document but can spend the time on debugging...
    – Habi
    Jan 29, 2016 at 9:17

1 Answer 1

3

With a bit of procrastination time and a search engine, I was able to find the tikz-timing examples, which helped me to solve your problem.

\documentclass[convert]{standalone}

\usepackage{tikz-timing}
\usetikztiminglibrary[new={char=Q,reset char=R}]{counters}

\begin{document}

\begin{tikztimingtable}
    CPOL =0 & LL 15{ T} LL \\
    CPOL =1 & HH 15{ T} HH \\
            & H 17L H \\
    \\
    Cycle \# & U R 8{2 Q} 2U \\
    MISO & D{z} R 8{2 Q} 2D{z} \\
    MOSI & D{z} R 8{2 Q} 2D{z} \\
    \\
    Cycle \# & UU R 8{2 Q} U \\
    MISO & D{z}U R 8{2 Q} D{z} \\
    MOSI & D{z}U R 8{2 Q} D{z} \\
\end{tikztimingtable}

\end{document}

screenshot

Actually, it looks to me like you just didn't copy paste the example from the link above correctly. Your example above has \vertlines[red]{2.1 ,4.1 ,... ,17.1}, while the line copied from the above link is \vertlines[red]{2.1,4.1,...,17.1} (notice your added spaces).

If I correct for the erroneous spaces, your code works fine, as seen below.

\documentclass[convert]{standalone}

\usepackage{tikz-timing}
\usetikztiminglibrary[new={char=Q,reset char=R}]{counters}

\begin{document}

\begin{tikztimingtable}
    CPOL =0 & LL 15{ T} LL \\
    CPOL =1 & HH 15{ T} HH \\
            & H 17L H \\
    \\
    Cycle \# & U R 8{2 Q} 2U \\
    MISO & D{z} R 8{2 Q} 2D{z} \\
    MOSI & D{z} R 8{2 Q} 2D{z} \\
    \\
    Cycle \# & UU R 8{2 Q} U \\
    MISO & D{z}U R 8{2 Q} D{z} \\
    MOSI & D{z}U R 8{2 Q} D{z} \\
    \extracode
    % Add vertical lines in two colors
    \begin{pgfonlayer}{background}
        \begin{scope}[semitransparent,semithick]
            \vertlines[red]{2.1,4.1,...,17.1}
            \vertlines[blue]{3.1,5.1,...,17.1}
        \end{scope}
    \end{pgfonlayer}
    % Add big group labels
    \begin{scope}[font =\sffamily \Large ,shift={(-6em,-0.5)},anchor=east]
        \node at (0,0){SCK};
        \node at (0,-3){SS};
        \node at (1ex,-9){CPHA=0}; 
        \node at (1ex,-17){CPHA =1};
        \end{scope}
\end{tikztimingtable}

\end{document}

second screenshot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .