Hallo, ich habe ein Problem mit meiner Seriellen Schnitstelle in Bascom. Zuerst der Code
1 | $regfile = "8052.dat" |
2 | $baud = 9600 |
3 | $crystal = 11059200 |
4 | $large |
5 | |
6 | |
7 | |
8 | Dim S As Byte |
9 | |
10 | Print "Das ist ein Test 1" |
11 | |
12 | |
13 | On Serial Serial_int '** Interrupt Service Routine = Serial_Int |
14 | |
15 | S = Inkey() |
16 | Enable Serial '** Enable Serial Interrupt |
17 | Enable Interrupts '** Enable All Interrupts |
18 | Priority Set Serial '** Set Priotity to Serial |
19 | mov scon,#80 |
20 | |
21 | |
22 | Print "Das ist ein Test 2" |
23 | |
24 | Mainloop: |
25 | |
26 | |
27 | |
28 | Goto Mainloop |
29 | |
30 | |
31 | Serial_int: |
32 | |
33 | Disable Interrupts '** Disable All Interrupts |
34 | |
35 | If Scon.0 = 1 Then '** Check if SCON RX IRQ is set |
36 | S = Sbuf '** If yes then Read Sbuf |
37 | Scon.0 = 0 |
38 | End If |
39 | |
40 | If Scon.1 = 1 Then |
41 | Scon.1 = 0 |
42 | End If |
43 | |
44 | Enable Interrupts '** Enable Interrupts |
45 | |
46 | Return |
Ich versuche mein Problem so einfach wie möglich zu schildern. Im Programmcode kann man zwei Print befehle sehen. Der erste bevor die deklaration von den interrupts kommt. Das Zweite danach. Der erste Print befehl funktioniert und der zweite funktioniert nicht. Das Programm bleibt dort stehen und wartet. D.h ich muss irgendwo einen Fehler haben und komme nicht mehr weiter verstehe es nicht :(. Kann mir bitte jemand helfen ? mfg Thor