Microcontroller › PIC › Interfacing pic 16f688 with TELIT gprs modem
- This topic has 1 reply, 1 voice, and was last updated 11 years, 4 months ago by
kha.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
November 10, 2011 at 4:20 am #1389
kha
ParticipantHi,I am interfacing pic 16f688 with TELIT gprs modem.When i send AT command to GPRS modem, i was able to receive “OK” in hyper terminal.similarly if i send AT command to GPRS modem from pic, it is responding with “OK”. I was not able to store this OK in micro controller.This OK is coming till receiver pin of micro controller but not able to store in a buffer.Here i am attaching the code, Please do the needfull.#include “htc.h”#include “Pic.h”#include “pic16f688.h”__CONFIG(FCMDIS & IESODIS & CPD & MCLREN & WDTDIS & INTIO & PWRTEN & INTCLK & BOREN);unsigned char receive_byte; //variable to store byte from RCREGunsigned char receive_array[10]; //Array to store the responseunsigned int long d;void OscillatorConfiguration(void) //Oscillator initialise{OSCCON = 0x71;}void UartInit(void) //uart initialise{//BRG16 = 0; // tO DOSPBRG = 12;BRGH = 0; //data rate for sendingSYNC = 0; //asynchronousSPEN = 1; //enable serial port pinsCREN = 1; //enable receptionSREN = 0; //no effectTXIE = 0; //disable tx interruptsRCIE = 0; //disable rx interruptsTX9 = 0; //8-bit transmissionRX9 = 0; //8-bit receptionTXEN = 0; //reset transmitterTXEN = 1; //enable the transmitter}void UartTxChar(unsigned char ch) //function to transmit character{//CLRWDT();while(!TXIF);TXREG = ch;}void UartTxString(unsigned char *str) //function to transmit string{while(*str != ‘