EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Interfacing pic 16f688 with TELIT gprs modem

Interfacing pic 16f688 with TELIT gprs modem

|

Microcontroller › PIC › Interfacing pic 16f688 with TELIT gprs modem

  • This topic has 1 reply, 1 voice, and was last updated 14 years, 3 months ago by kha.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 10, 2011 at 4:20 am #1389
    kha
    Participant

     

    Hi,
     
    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 RCREG
    unsigned char receive_array[10]; //Array to store the response
    unsigned int long d;
     
    void OscillatorConfiguration(void) //Oscillator initialise
    {
    OSCCON = 0x71;
    }
     
    void UartInit(void) //uart initialise
    {
     
    //BRG16 = 0; // tO DO
    SPBRG = 12;
    BRGH = 0; //data rate for sending
    SYNC = 0; //asynchronous
    SPEN = 1; //enable serial port pins
    CREN = 1; //enable reception
    SREN = 0; //no effect
    TXIE = 0; //disable tx interrupts
    RCIE = 0; //disable rx interrupts
    TX9 = 0; //8-bit transmission
    RX9 = 0; //8-bit reception
    TXEN = 0; //reset transmitter
    TXEN = 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 != ‘’)
    UartTxChar(*str++);
    UartTxChar(13);
     
    }
     
    void serial_receive() //function to take the value from RCREG
    {
    while((RCIF == 0) && (d != 50000))
    {
    d++;
    }
     
    if(RCIF)
    {
    receive_byte = RCREG;
    RCIF = 0;
    }
    else
    {
    receive_byte = ‘A’;
    }
     
     
    }
     
    void receive() //function to store the received vale in array
    {
    unsigned char i;
     
    d = 0;
    for( i = 0; i < 9; i++)
    {
    serial_receive();
     
    receive_array = receive_byte;
    }
     
    }
     
    void main(void)
    {
    OscillatorConfiguration();
    UartInit();
    UartTxString((unsigned char*)”AT”);
     
    receive();
     
    UartTxString(receive_array); 
    while(1);
    }
    November 10, 2011 at 11:34 am #6831
    kha
    Participant

     

         Please help me out…

     

         Thanks in advance

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • ANOTHER OLD PROJECT REDO February 9, 2026
  • Buffer design? February 9, 2026
  • BPF February 9, 2026
  • To couple or decouple February 9, 2026
  • Op amp shock February 9, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise