Gast
#446484
Hallo zusammen,
ich habe folgende zwei Simulatorfunktionen für µVision 3 geschrieben:
signal void sendParam()
{
SIN = 0x22; //send header
twatch((CLOCK / 1000) * 100); //wait for 100 ms
SIN = 0x01;
twatch((CLOCK / 1000) * 100);
SIN = 0xff;
twatch((CLOCK / 1000) * 100);
SIN = 0xfa;
twatch((CLOCK / 1000) * 100);
SIN = 0xff;
twatch((CLOCK / 1000) * 100);
SIN = 0xff;
twatch((CLOCK / 1000) * 100);
SIN = 0x00;
twatch((CLOCK / 1000) * 100);
SIN = 0x59;
twatch((CLOCK / 1000) * 100);
SIN = 0xeb;
}
signal void sendIdent()
{
SIN = 0x00; //send header
twatch((CLOCK / 1000) * 100); //wait for 100 ms
SIN = 0x05;
twatch((CLOCK / 1000) * 100);
SIN = 0x0e;
twatch((CLOCK / 1000) * 100);
SIN = 0xff;
}
Das interessante ist jetzt, dass die untere Funktion (sendIdent()) ohne
Probleme funktioniert. Bei der oberen Funktion wird zwar der Interrupt
auf meinem µC (Atmel AT89C51ID2) ausgelöst, aber SBUF (der
Eingangspuffer des Controllers) enthält immer den Wert 0x00. Wieso?
Selbst wenn ich die zweite Funktion nicht compiliere funktioniert die
Erste nicht...
Kann mir da jemand weiterhelfen?
Vielen Dank im voraus und viele Grüße