Gast
#179652
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