Alarma sms en pdu Siemens C55

Hola,

Estoy tratando de hacer una alarma gsm con pic16f877a, Osc20, Siemens C55 y programación en Pbp250.
El móvil responde bien a los comandos at a traves de hyperterminal.
Mi problema y que el móvil solo eceita pdu sms. Mi trama esta bien "079153912601000011000C915391663921010000AA02EF35" pero el problema es enviar el comando Ctrl+z en pbp al movil.

Código:
@ Device HS_OSC         ' High Speed Crystal
define OSC 20     ' Check the spelling of OSC, must be in capital letter
        
Include "modedefs.bas" ' Include serial modes

' Define LCD registers and bits
Define	LCD_DREG	PORTB           'Lcd D 4-bit parallel register starts at PortB.4 to PortB.7
Define	LCD_DBIT	4              
Define	LCD_RSREG	PORTB
Define	LCD_RSBIT	2
Define	LCD_EREG	PORTB
Define	LCD_EBIT	3
Define  LCD_COMMANDUS   2000	      ' Command Delay (uS)
Define  LCD_DATAUS      50 	     ' Data Delay (uS)
DEFINE  OSC         20                'Define oscilator frequency
DEFINE LCD_LINES 4 'Number lines on LCD 

DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
        
TrisC.5=0
TrisC.6=0
TrisC.7=1
B0 var byte

HSEROUT ["AT+CMGS=16",13,10] 
PAUSE 500 
HSEROUT ["079153912601000011000C915391663921010000AA02EF35",13,10] 
HSEROUT [26]
End

Algo no ba bien pero en el hyper si envia, si cambio los comandos a
HSEROUT ["ATD+351966931210;", 13,10]

lama bien sin problemas..

Ayuda por favor estoy loco mas 2 meses...

Gracias
 
Si fonciona

linea de codigo:

HSEROUT ["AT+CMGS=16",13,10]
PAUSE 500
HSEROUT ["079153912601000011000C915391663921010000AA02EF35",26,10]
HSEROUT [13]


Gracias a todos.
 
Estoy trabajando con un Siemens C55, pero le mando esos codigos para mandar un mensaje en PDU, y no responde nada.

lo que hago es lo siguiente:
at+cmgs=32 (o con 16 tambien probe)
> 079153912601000011000C915391663921010000AA02EF35
(que es el codigo que vos usaste y funciono) pero responde ERROR

Alguien sabria orientarme?
 
Hola,

Aqui fica el codigo completo espiero que te sirva.


Código:
 @ Device HS_OSC       
define OSC 20    
        
Include "modedefs.bas" ' Include serial modes

' Define LCD registers and bits
Define	LCD_DREG	PORTB           'Lcd D 4-bit parallel register starts at PortB.4 to PortB.7
Define	LCD_DBIT	4              
Define	LCD_RSREG	PORTB
Define	LCD_RSBIT	2
Define	LCD_EREG	PORTB
Define	LCD_EBIT	3
Define  LCD_COMMANDUS   2000	      ' Command Delay (uS)
Define  LCD_DATAUS      50 	     ' Data Delay (uS)
DEFINE  OSC         20                'Define oscilator frequency
DEFINE LCD_LINES 4 'Number lines on LCD 

DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
        
myarray var byte[62]
numero  var byte[16]
primeiro var byte[16]

TrisD.4=0 ' Led presenca
TrisC.5=0 ' liga gsm
TrisC.4=0 ' liga OK
TrisD.3=0 ' liga corte energia
TrisD.2=0 ' liga 4 piscas
TrisC.6=0 ' TX
TrisC.7=1 ' RX


Low PortD.4
Low PortD.3
Low PortD.2
Low PortC.5
Low PortC.4

Pause 500
High portD.4
Pause 500
Low portD.4
Pause 500
High portD.4
Pause 500
Low portD.4
Pause 500
High portD.4
Pause 500
Low portD.4
Pause 500

Inicio:
HSEROUT ["AT" ,13,10] 
HSERIN 5000,Liga,[WAIT("OK")]

LOOP:
HSEROUT["AT+CPMS=",34,"SM",34,13] 
HSERIN 5000,LOOP,[WAIT("OK")]

IP:
HSEROUT["AT+CMGR=1",13,10] 
HSERIN 5000,IP,[WAIT("+CMGR: 1,,"),skip 4, STR myarray\62] 

IF myarray[61]="E" Then 
goto success 
Endif

IF myarray[61]="D" Then
goto  Desliga
Endif
goto APAGA

IF myarray[28]="3" and myarray[31]="1" and if myarray[32]="0" and myarray[61]="E"then 

Liga:
High PortC.5
Pause 1000
Low PortC.5
Pause 6000
High PortC.4
Pause 2000
Low PortC.4
Pause 20000
Goto Inicio

Desliga:
Low PortD.4
Low PortD.3
Low PortD.2
Low PortC.5
Low PortC.4
Goto APAGA

success:
High PortD.2
High PortD.3
High portD.4


APAGA:
HSerout ["AT+CMGD=1;+CMGD=2",13,10]' apaga sms 1 e 2
Pause 5000
goto Inicio

End
 
Atrás
Arriba