Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

data transfer with sim908c

Status
Not open for further replies.

vagan

Newbie level 5
Joined
Jan 28, 2014
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
62
hi all,
I am doing a project with sim908c and pic16f877a..but

i dono how to interface sim with pic..

1.what are all the at commands required to inialize the gsm module..?
2.how can i transfer the datas through gprs..?
3.how can i tranfer the gps values using this module?
software requirements related to this proj...?
 

thank you sir,
i am new to this subject..is there any schematic diagram to interface sim and pic ? please send me...
 

See this link=>> **broken link removed**
will help you get a good start. Teaches how to make the connections
for each module kit with pic18f26j50 which is similar to that pic you're using,
but it is necessary to make some changes.
 

thank you sir,now i am somewhat familiar with interfacing sim908c and pic..
i hava a doubt regarding to code..
i found out all the AT commands for this project...but i dono how to use these commands in program..
i am going to write a code using embeeded c...pls help me...
 

the first thing you need to do is configure the working mode of your pic
called "configurations bits." After that, you need to inform the clock and
baudrate you will work to enable communication USART available
the pic you are using.
Read this datasheet your questions will be answered == >> https://ww1.microchip.com/downloads/en/DeviceDoc/39582C.pdf
* You can search for USART communication in C this forum, you will find much information.
Search in my threads may help you.:)
if you have additional questions, feel free to ask.:)
 

https://ww1.microchip.com/downloads/en/DeviceDoc/39582C.pdf


thank you sir,
i already knew about this pic controller...

in my project i have to get the gps values,from that i have to find the exact location..

i collected all the AT commands,PIC details and everything related to this project.
but i dono how to use this and all in code..
If i see some sample codes means i ll be very confident to write the code alone..
 

thank you sir,
I am very cleared about USART COMMUNICATION.I dono how to write the program using this and all..
if i see some sample code means i ll be very confident to write the code..
 

Take a look may this help

Code:
#include <p18f26j50.h>
#include <stdio.h>
#include <stdlib.h>
#include <delays.h>
#include <string.h>
#include <usart.h>


#pragma config XINST = OFF // Extended Instruction Set (Enabled)
#pragma config WDTEN = OFF // Watchdog Timer (Disabled - Controlled by SWDTEN bit)
#pragma config OSC = HS
#pragma config STVREN = OFF
#pragma config DEBUG = OFF
#pragma config CP0 = OFF
#pragma config IESO = OFF

#define _XTAL_FREQ 12000000
/*
 *FOSC= 12MHZ
 * Tciclo=4/FOSC = 0,333 us
 */

    void inicia(void){

        LATCbits.LATC2 = 1;
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);
        LATCbits.LATC2 = 0;
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);
        LATCbits.LATC2 = 1;
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);

        TRISCbits.TRISC6 = 0;//saida = 0
	TRISCbits.TRISC7 = 1;//entrada = 1

	/***TX Configuration************/
	TXSTA1bits.CSRC  = 0;      //
	TXSTA1bits.TX9   = 0;      //Selects 8-bit transmission
	TXSTA1bits.TXEN  = 1;      //Transmit is enabled
	TXSTA1bits.SYNC  = 0;      //Asynchronous mode
	TXSTA1bits.SENDB = 0;      //dont Send Sync Break on next transmission (cleared by hardware upon completion)
	TXSTA1bits.BRGH  = 1;      //High speed
	/***RX Configuration************/
	RCSTA1bits.SPEN  = 1;      //Serial port is enabled
	RCSTA1bits.RX9   = 0;      //Selects 8-bit reception
	RCSTA1bits.CREN  = 1;      //Enables the receiver
	RCSTA1bits.ADDEN = 0;      //Disables address detection, all bytes are received and ninth bit can be used as parity bit
	/***BAUDRATE Configuration************/
	BAUDCON1bits.ABDOVF = 0;   //No BRG rollover has occurred
	BAUDCON1bits.RXDTP  = 0;   //Receive data (RXx) is not inverted (active-high)
	BAUDCON1bits.TXCKP  = 0;   //Idle state for transmit (TXx) is a high level
	BAUDCON1bits.BRG16  = 0;   //8-bit Baud Rate Generator ? SPBRGHx and SPBRGx
	BAUDCON1bits.WUE    = 0;   //RXx pin is not monitored or the rising edge detected
	BAUDCON1bits.ABDEN  = 0;   //Baufrate Measurement is Disable

	SPBRGH1 =  0;    //EUSART1 Baud Rate Generator Register High Byte
	SPBRG1	= 77;    //EUSART1 Baud Rate Generator Register Low Byte

                         //

        Open1USART(USART_TX_INT_OFF &
                   USART_RX_INT_OFF &
                   USART_ASYNCH_MODE &
                   USART_EIGHT_BIT &
                   USART_CONT_RX &
                   USART_BRGH_HIGH,77);   

/**************************Config pin I/O USART2*****************************/
        ANCON0bits.PCFG0 = 1; //Setando pino AN0 (analogico) para Digital
        ANCON0bits.PCFG1 = 1; //Setando pino AN1 (analogico) para Digital
        
        TRISAbits.TRISA0 = 1;//entrada = 1
        TRISAbits.TRISA1 = 0;//saida = 0
        /***TX 2 Configuration************/
	TXSTA2bits.CSRC  = 0;      //
	TXSTA2bits.TX9   = 0;      //Selects 8-bit transmission
	TXSTA2bits.TXEN  = 1;      //Transmit is enabled
	TXSTA2bits.SYNC  = 0;      //Asynchronous mode
	TXSTA2bits.SENDB = 0;      //dont Send Sync Break on next transmission (cleared by hardware upon completion)
	TXSTA2bits.BRGH  = 1;      //High speed
	/***RX 2 Configuration************/
	RCSTA2bits.SPEN  = 1;      //Serial port is enabled
	RCSTA2bits.RX9   = 0;      //Selects 8-bit reception
	RCSTA2bits.CREN  = 1;      //Enables the receiver
	RCSTA2bits.ADDEN = 0;      //Disables address detection, all bytes are received and ninth bit can be used as parity bit
	/***BAUDRATE 2 Configuration************/
	BAUDCON2bits.ABDOVF = 0;   //No BRG rollover has occurred
	BAUDCON2bits.RXDTP  = 0;   //Receive data (RXx) is not inverted (active-high)
	BAUDCON2bits.TXCKP  = 0;   //Idle state for transmit (TXx) is a high level
	BAUDCON2bits.BRG16  = 0;   //8-bit Baud Rate Generator ? SPBRGHx and SPBRGx
	BAUDCON2bits.WUE    = 0;   //RXx pin is not monitored or the rising edge detected
	BAUDCON2bits.ABDEN  = 0;   //Baufrate Measurement is Disable

	SPBRGH2 =  0;    //EUSART2 Baud Rate Generator Register High Byte
	SPBRG2	= 155;    //EUSART2 Baud Rate Generator Register Low Byte
                         //

        Open2USART(USART_TX_INT_OFF &
                   USART_RX_INT_OFF &
                   USART_ASYNCH_MODE &
                   USART_EIGHT_BIT &
                   USART_CONT_RX &
                   USART_BRGH_HIGH,155);
        
        while(1){
        char dado[]="";
        char data[]="ATD";
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);
        puts1USART(data);
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);
        puts1USART(data);
        Delay10KTCYx(200);
        Delay10KTCYx(100);
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);
        gets2USART(dado,5);
        Delay10KTCYx(200);         // Delay de estabilização do circuito, tensões, etc....
        Delay10KTCYx(100);
        puts1USART(dado);
        }
}
    
    
    void main(void){
    inicia();
    
}
 

thank you once again sir,
but sorry i couldn't able to understand the code becoz i am not well with programming..
send me a simple code for the gps transmission
 

sir,
i decided to use MPLAB..

i have one doubt...

i have to transfer the data using gsm, for that AT commands available
but my doubt is y we go for USART SERIAL COMMUNICATION,for that i have to write a c program???

TCP/IP protocol used to transfer the data for that also AT commands available...

I dono where it is used?
 
Last edited:

Using the USART communication pic, you can an autonomy the kit.
For example, you can create a routine in C for the pic collect the
coordinates provided by the GPS and sends them along to your smartphone
with a link that directs you to the googlemaps site.
You can even send using TCP / IP (Datasheet AT commands teaches how to set up internet access). But for this
* you must create a server ready to receive the information
GPRS module. If you search right here on this forum you will find
lot of good things that will help you and will answer many questions.

example of code that read and write characters via USART:
Code:
char data;

  while(1)
  {
    while(!DataRdyUSART());  //wait for data
    data = ReadUSART();      //read data
    Write1USART(data);     //write to LCD
    if(data=='Q')
      break;
  }

}
hope it is useful:wink:
 

ok sir now i got the ans,

USART COMMUNICATION is used to transfer the data from pic to server....
for that i have to write a code correct?????

to transfer the GPS values we have to use the TCP/IP protocpol correct?
GPS values are transfered to PIC after that USART COMMUNICATION ll be used to connect with server?
 

The communication UART is used for communication of GPS and GPRS modules.
The PIC is a device control modules. Through it is possible to send commands and
receive responses modules that can be manipulated by the PIC. For example by
a UART of the PIC you get GPS coordinates module. Upon receiving these coordinates
you can store them in a variable and sends them by sms or a properly configured server
to receive this message. So it is necessary the construction of a code that makes
possible the pic working automatically with two modules and their functions.
 
  • Like
Reactions: vagan

    vagan

    Points: 2
    Helpful Answer Positive Rating
thank you sir,

how to transfer the speed of a vehicle trough GPS....is there any procedure to find out the speed of a vehicle using gps coordinates?????
 

Normally the GPS NMEA provides between its plot well as your position, your speed and time. See the example:

$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A

Where:
RMC Recommended Minimum sentence C
123519 Fix taken at 12:35:19 UTC
A Status A=active or V=Void.
4807.038,N Latitude 48 deg 07.038' N
01131.000,E Longitude 11 deg 31.000' E
022.4 Speed over the ground in knots
084.4 Track angle in degrees True
230394 Date - 23rd of March 1994
003.1,W Magnetic Variation
*6A The checksum data, always begins with *

You only need to convert as you want:smile:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top