Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - FAQ - Zum CC1-Forum - Zum CC-Pro-Forum

Geschwindigkeit von CC2... Kategorie: Progr. Assembler, TaskingTools, OS (von Dr. Ilgis Ibragimow - 26.02.2005 21:18)
Ich nutze:
C164CI-ControllerBoard, original OS
Guten Tag,

ich wollte folgende kleine Algorithmus implementiert ins meine CC2:

sei


int V1, V2, V3, V4; // sind Zeiten in ns (10^{-6} Sekunden).
int NP; // der Port Nummer 2...6


Meine Algorithmus muss folgenden machen:

wartet bis Port(0) ist High, dann

ins parallel:

1. wartet V1 ns und setzt Port(1) fuer V2 ns.

2. wartet V3 ns und setzt Port(NP) fuer V4 ns.

Der Signal in P0 kommt 20 - 300 mal pro Sekunde, und V1, V2, V3, V4 sind in Bereich
50...20000 ns. D.h. ich muss ab ca. 25-50ns unterscheiden werden.

Sagen Sie bitte ist dass prinzipiell moeglich? Ich habe der Geschwindigkeit von eine
einfache Operation (A=A+B) ins C2 getestet, und es war ca. 30000 Op. pro Sekunde,
aber in Manual fuer C164CI steht dass "int*int" ist 2 Takten, "int+int" ist 1 Takt. Dann
kann ich nicht verstehen warum A=A+B; in C2 Algorithmus ca. 600 Takten dauert.

Wenn dass ist prinzipiell moeglich, koennen Sie bitte mir Helfen und paar Hinweisen gegeben
und sagen wo kann ich dass implementiert werden?

Danke

Ilgis

PS: Tut mir Leid fuer meine Sprache, ich wiederhole meine Frage auf Englisch:

Hello,

I would like to implement the following algorithm:

suppose


int V1, V2, V3, V4; // are values in ns (10^{-6} seconds) and updated in the main thread;
int NP; // the port number in the range 2...6


My algorithm should wait until the value in Port(0) is high, then, independently make the following
two events:

1. wait V1 ns and set 1 in the Port(1) for V2 ns;

2. wait V3 ns and set 1 in the Port(NP) for V4 ns,

so two 0-1-0 signals should be issued in in Port(1) and one definite Port(NP). They can overlap,
but they are shorter than the time till the next signal arrive to the Port(1).

The event Port(0)=1 happen ca. 20-300 times in the second, and the ranges of V1,V2,V3,V4
stay in 50-20000 ns, so, I should measure the time in the output signals with about 25ns.
I consider that 20MHz processor can do this and get it... Now I recognise that the simple
instruction like A=A+B computes by CC2 no more then 30000 times in the second, so,
I worried that I can carefully measure times V1...V4. Moreover, the timer is only in ms,
so, it seems that I should use another timer, or, other tricks.

Would you please to help me an tell me is it possible to implement my algorithm with CC2,
and if yes, please suggest me some ideas, i.e. should I use an assembler, or other compiler,
or some additional tricks.

Thank you

Ilgis
Ph.D. in numerical mathematics, I am open to help you with your numerical problems :)


    Antwort schreiben


Antworten:

Re: Geschwindigkeit von CC2... (von Matthias Koch - 1.03.2005 21:48)
    Re: Geschwindigkeit von CC2... (von Matthias Koch - 1.03.2005 22:18)
        Re: Geschwindigkeit von CC2... (von Udo - 2.03.2005 12:17)
            vielen Dank! (von Dr. Ilgis Ibragimow - 15.03.2005 10:02)