Hallo,
das Thema ist sicher off-topic, aber vielleicht kann mir jemand von Euch helfen:
Ich werkele seit dem letzten Jessener Bastelwochenende an einem Programm, um SMS'en über eine RS-232- Schnittstelle in einen Atmega- Prozessor einzulesen.
Dazu verwende ich das myAVR-Board MK1 LPT, ein Datenkabel und ein Nokia- Handy,
das die SMSen intern im Textformat (nicht PDU) speichert. Programmiersprache ist BASCOM-AVR
Im folgenden Programm funktioniert das Senden von Befehlen vom Atmega über die RS232 an das Handy: Ich kann eine Nummer wählen und eine SMS versenden.
Es gelingt mir aber nicht, Daten über die RS232 zu empfangen, z.B. um sie dann auf dem Display darzustellen.
Kann mir evtl jemand einen Tip geben?
Danke & vy 73''- Frank, DL9VF
Hier der BASCOM- Code:
$regfile = "m8def.dat"
$crystal = 3686400
$baud = 9600
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2
Config Lcdbus = 4
Dim S As String * 10, i as Byte
On URXC OnRxD:
Enable URXC
Enable Interrupts
' ---------------------------------------------------------------
' ---------------- 1. Teil: Rufaufbau. funktioniert -------------
' ---------------------------------------------------------------
'Locate 1 , 1
'Lcd "Sende ATZ"
'Print "atz"
'Waitms 200
'Locate 1 , 1
'Lcd "Sende ATDT 0172xxxxxxx"
'Print "atdt 0172xxxxxxx"
'Waitms 200
' ---------------------------------------------------------------
' ---------------- 2. Teil: SMS senden. funktioniert ------------
' ---------------------------------------------------------------
'Locate 1 , 1
'Lcd "SMS senden... "
'Waitms 2000
'Locate 1 , 1
'Lcd "Textmodus... "
'Print "at+cmgf=1" ; Chr(13)
'Waitms 200
'Locate 1 , 1
'Lcd "Rufnummer... "
'Print "at+cmgs=" ; Chr(34) ; "0172xxxxxxx" ; Chr(34) ; Chr(13)
'Waitms 200
'Locate 1 , 1
'Lcd "SMS-Text... "
'Print "Hier steht der Text der SMS" ; Chr(13)
'Waitms 200
'Print Chr(26) ; Chr(13)
'Wait 10
' ---------------------------------------------------------------
' ---------------- 3. Teil: SMS empfangen: klappt nicht ---------
' ---------------------------------------------------------------
Cls
Locate 1 , 1
Lcd "SMS-Empfang: "
Waitms 1000
Locate 1 , 1
Lcd "Echo ein "
Print "ate1"
Waitms 1000
Locate 1 , 1
Lcd "Textmodus ein "
Print "at+cmgf=1"
Waitms 1000
Do
Locate 1 , 1
Lcd "Handy abfragen:"
Print "at+cmgl"
Waitms 5000 'nur alle 5s das Handy abfragen
Loop
Onrxd:
i= udr
S=S+chr(i)
Locate 2 , 1
Lcd S
Return
End