illegal opcode mul for mcu attiny2313

Gast #179652
Lesenswert?

Hallo ich habe den neuen ATtiny 2313 und wollte ein Nibbel
auslesen und in eine Variable speichern.
Die Variable soll mal 9 genommen werden und in OCR0a geschrieben
werden.
Ich bekomme folgende fehlermeldung (illegal opcode mul for mcu
attiny2313).
Wenn ich die Variable 9 mal Plus nehme habe ich das Problem nicht.
Hier ist der Code
if bit_is_set (PINB,0)
    PINB_V += 1;
    if bit_is_set (PINB,1)
    PINB_V += 2;
    if bit_is_set (PINB,2)
    PINB_V += 4;
    if bit_is_set (PINB,3)
    PINB_V += 8;
    PINB_V *= 9;
    OCR0A = PINB_V;
dieser Code produziert den fehler.
if bit_is_set (PIND,0)
    PIND_V += 1;
    if bit_is_set (PIND,1)
    PIND_V += 2;
    if bit_is_set (PIND,2)
    PIND_V += 4;
    if bit_is_set (PIND,3)
    PIND_V += 8;
    OCR0B = (PIND_V + PIND_V + PIND_V + PIND_V + PIND_V + PIND_V + 
PIND_V
+ PIND_V  + PIND_V);
dieser Code geht aber warum?
Mfg. Torben
Gast #179655
Lesenswert?

Ja Danke es geh ja auch so wie in meinem Code aber ich benutze Winavr
und es gibt noch keine neue Version mit der Libc 1.2.1
Bitte noch eine kurze Mail wie ich den Winavr updaten kann.
Mfg. Torben
Gast #179658
Lesenswert?

Errm, ja, du brauchst natürlich nicht nur die Bibliothek, sondern du
musst auch den Compiler und Binutils patchen. :-/

Abhilfe für jetzt erstmal: deklarier' den Chip als AT90S2313
gegenüber
dem Compiler.

Die nächste WinAVR-Version wird sich wohl auch nicht mehr so lange
hinziehen.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren