Here is my code:
OSCTUNE=%01111 ' Oscillator 8MHz
intcon=0 ' Interrupts disabled
cm1con0=0 ' Comparator 1 disabled
cm2con0=0 ' Comparator 2 disabled
ansel=0 ' Pins to be Digital
anselh=0 ' Pins to be Digital
baud con 16468 ' baud rate = 9600 Inverted
trisc=%00000000 ' Port C I/O
trisb=%01111111 ' Port B I/O
trisa=%000000 ' Port A I/O
portc=0 ' Setting port c Low
portb=0 ' Setting port b Low
porta=0 ' Setting port a Low
i var byte ' Declaring variable
c var byte ' Declaring variable
tx var Portb.7 ' Declaring tx pin
rx var Portb.5 ' Declaring rx pin
Include "modedefs.bas"
main:
Serout2 tx,baud,["AT+CMGF=1",13]
gosub one
Serin2 rx,baud,5000,main,[wait("OK"),i]
gosub two
goto main
one:
for c=1 to 5
portc=255
pause 20
portc=0
pause 20
next c
return
two:
for c=1 to 5
portc=255
pause 400
portc=0
pause 400
next c
return
My Problems:
1) My led connected to portc only goes high ONCE in label one though it should enter label one every 5000mS.
2) It never enters label two as I assume there is somthign wrong in the communication part of PIC with the modem.
Please help me find out what am I doing wrong here?
Bookmarks