Here is some of my code:
' Setup Crystal Frequency in mHz
DEFINE OSC 20 ' Set Xtal Frequency
' Setup Auto Epic Settings
@ DEVICE PIC16F876A
@ DEVICE HS_OSC ' System Clock Options
@ DEVICE WDT_OFF ' Watchdog Timer
@ DEVICE PWRT_OFF ' Power-On Timer
@ DEVICE BOD_OFF ' Brown-Out Detect
@ DEVICE LVP_OFF ' Low-Voltage Programming
@ DEVICE CPD_OFF ' Data Memory Code Protect
@ DEVICE PROTECT_OFF ' Program Code Protection
' Setup Hardware for uart
DEFINE HSER_BAUD 9600
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 129
DEFINE HSER_CLROERR 1 ' automatic clear the overflow
TRISC.6 = 0
TRISC.7 = 1
ipaddress var byte[15]
'Setup Modem for No Flow Control
hserout ["at+ifc=0,0", 13]
checkip:
hserout ["at*e2ipi=0", 13] ' Check the IP Session
hserin 20000, setup, [WAIT("*E2IPI: "),STR ipaddress]
main:
Hserout ["at+cgdcont=1,", 34, "IP", 34, ",", 34, "myserver.address", 34,13]
Hserin 20000, setup, [WAIT("OK")]
Hserout ["at*e2ipa=1,1", 13]
Hserin 20000, setup, [WAIT("OK")]
goto main
I have been able to connect my board to my pc and the hserout is working as it should. I am not able to get anything back from the pc or modem.
Is the hserin setup correctly?
Thanks again, Scott
Bookmarks