integra.man
Newbie level 1
Regards
i am using proteus to simulate my project that has a pic 16F877, I wish to communicate with gsm modem TC65 , I use the compim to attach the modem to the simulation
I can communicate between gsm modem and hyperterminal, and i I can simulate pic sending message to hyperterminal in proteus but can't check modem response.
i attach below the proteus schematic and the pic basic code i use.
please help
:-(
INCLUDE "modedefs.bas"
' Initialisation
TRISB=%00000000
PORTB=%00000000
start:
high PORTB.7
pause 1000
Low PORTB.7
high PORTB.6
pause 1000
Low PORTB.6
high PORTB.5
pause 1000
Low PORTB.5
high PORTB.4
pause 1000
Low PORTB.4
TEST:
SEROUT PORTC.6,t2400,["AT",13] 'Send the ASCII value of "AT" followed by a linefeed out Pin6 of Portc serially
SERIN PORTC.7,t2400,["OK"],PORTB.3 'Wait until the character “00001010” is received serially on Pin7
high PORTB.7 'OF PORT C and put next character into PORTB.0
pause 5000
SEROUT PORTC.6,t2400,["AT+GMM",13] 'requete pour obtenir le model du modem
SERIN 5000, GSM_CHECK, ["TC65"],PORTB.3 'attente de la reponse "TC65".
HIGH PORTB.6
PAUSE 5000
SEROUT PORTC.6,t2400,["AT+IPR=2400",13] 'Configuration de la vitesse de transmission.
SERIN PORTC.7,t2400,["OK"],PORTB.3 'attente de la reponse du modem "ok".
HIGH PORTB.5
PAUSE 5000
SEROUT PORTC.6,t2400,["AT+CMGF=1",13] 'Configuration en mode texte
SERIN PORTC.7,t2400,["OK"],PORTB.3'attente de la reponse du modem "ok".
HIGH PORTB.4
PAUSE 5000
Goto test
END
Code:
[url=https://obrazki.elektroda.pl/44_1301646725.jpg][img]https://obrazki.elektroda.pl/44_1301646725_thumb.jpg[/img][/url]
Last edited by a moderator: