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.

Interfacing GPS module with RS232 with PIC 16F877A and transmit the received data

Status
Not open for further replies.

sanoopgr8

Newbie level 4
Joined
Feb 15, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
Hello,

How to interface GPS module with PIC 16F877A (MPLab IDE and HiTech C v9.8)
my game plan is this

* Receive the NMEA data from the GPS module baud rate 4800
*Store it in a buffer in PIC 16F877A xtal 10MHz
*Transmit the received dat via Bluetooth baud rate 4800

here is the source code

Code:
#include <htc.h> 

__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);

unsigned char DATA;    //serial data buffer

void interrupt isr(void)
{
  if(RCIF && RCIE)
  {
    DATA = RCREG;
    if(TXIF)
    {
      TXREG = DATA;
    }
  }
}

void main(void)
{
  ADCON1 = 0x06;    //all port pins digital I/O mode
  TRISB = 0xff ;     // set PORTB as INPUT
  PORTD = 0 ;    //clear PORTD output latch
  TRISD = 0 ;     // set PORTD as OUTPUT
  
  TRISC = 0b11000000;  //PORTC output, RC6 UART TX, RC7 UART RX
  SPBRG = 0x81;    //baud rate 4800bps w/10MHz xtal
  TXSTA = 0x24;    //asynchronous serial mode, enable transmit, high speed BRG mode
  RCSTA = 0x90;    //enable serial port, enable continuous receive
  PIE1 = 0x20;    //enable serial receive interrupt
  INTCON = 0xC0;    //enable peripheral interrupts, enable global interrupts

  //main code begins here


}

what i want to know is how to set up the hardware for this purpose dose my code work out or i need to change anything ?
 

I dont follow Malay anyway google translator is there :)
btw is my code not useful at all ?
What you mean your code not usefull? That is only a piece of code, just receive UART. You still need to processing that.
 

What you mean your code not usefull? That is only a piece of code, just receive UART. You still need to processing that.

i just want to receive it and re-transmit it via bluetooth of same baud rate
 

you can do it.... just use RX pin to receive then TX to transmit through bluetooth. Do not forget to connect Ground for both.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top