I have written a small code to send AT commands to the Modem and then get an OK back. I have put my computer's RS232 connections in Parallel to keep an eye on the communication.
But My PIC is not Transmitting anything - I need help to make this work
My code is as follows:
The receiving end is working fine, as I can send the "OK" from my terminal window and my PIC is getting it. But nothing appears on my Terminal window from the PIC.Code:Include "modedefs.bas" DEFINE OSC 4 @ __Config _XT_OSC & _WRT_256 &_WDT_OFF &_PWRTE_ON &_BODEN_OFF & _LVP_OFF PAUSE 10 '----------------------------------------------------- DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0 DEFINE HSER_SPBRG 25 ' 2400 Baud @ 4MHz, 0.17% DEFINE HSER_CLROERR 1 ' Clear overflow automatically @ ERRORLEVEL -306 '------------------------------------------------------ ADCON1=7 CMCON=7 INTCON=128 OPTION_REG.7=0 TRISA=0 : PORTA=0 TRISB=0 : PORTB=0 TRISC=%10000000 : PORTC=0 TRISD=0 : PORTD=0 TRISE=0 : PORTE=0 CCP1CON=0 '----------------------------------------------------- main: TOGGLE PORTA.0 HSEROUT ["AT",10,13] HSERIN 1000,main,[WAIT("OK")] PAUSE 2000 goto main
I have checked that there is a constant voltage on the TX pin, 4.6V. Is something wrong with my code?



Didn't Work


Bookmarks