chalani0088
Junior Member level 3
- Joined
- Jun 19, 2012
- Messages
- 27
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,562
Thank you very much for the support
regards
chalani
- - - Updated - - -
void serial_setup()
{
SYNC=0; //Asynchronous mode
BRGH=1; //High Speed
SPBRG=25; //9600 bps
SPEN=1; //Enable serial port
CREN=1; //Enable reception
SREN=0; //No effect
TXIE=0; //Desable interrupts
RCIE=0; //disable rx interrupts
TX9=0; //8-bit transmission
RX9=0; //8-bit reception
TXEN=1; // Enable transmission
}
I could setup the serial port like this in my program, now can I connect directly the GPS module to PIC's RX and receive data?
no,microcontroller operates in 5v level and gps operates in 12v level....the devices which is operate in different voltage level,we didnt connect directly between these....one level converter is needed that level converter is max232
which is the GPS u are using.............
use this code it will display received data from GPS on LCD.................
GPS gives lots of data in lots of formats make sure u take those data which are required...........
Code C - [expand] 1 TRISC6 = 0; // TX Pin
i don't know what's the problem in this code. its compiling good in MPLAB +hitech c but not getting output in proteus please help me guys.
#include<htc.h>
#include<pic16f877a.h>
#include<string.h>
#include<stdio.h>
#define _XTAL_FREQ 20e6
__CONFIG( FOSC_HS & WDTE_OFF & PWRTE_ON & CP_OFF & BOREN_ON & LVP_OFF & CPD_OFF & WRT_OFF & DEBUG_OFF);
// Comm Setup
#define BAUDRATE 9600 //bps
// 8 bit data mode with one stop bit
// No flow control, no parity bit
//Function Prototypes
void InitUART(void);
void SendByteSerially(unsigned char);
void SendStringSerially(const unsigned char*);
void main(void)
{
InitUART(); // Intialize UART
SendStringSerially("Hello World!"); // Send string on UART
while(1)
{
// Do nothing, as Received character is echoed back in the ISR
// If you decide to disable interrupts, then you can
// echo back characters by uncommenting the line below
// SendByteSerially(ReceiveByteSerially()); //Echo Back
}
}
void InitUART(void)
{
TRISC6 = 1; // TX Pin
TRISC7 = 1; // RX Pin
SYNC=0; //Asynchronous mode
BRGH=1; //High Speed
SPBRG=25; //9600 bps
SPEN=1; //Enable serial port
CREN=1; //Enable reception
SREN=0; //No effect
TXIE=0; //Desable interrupts
RCIE=0; //disable rx interrupts
TX9=0; //8-bit transmission
RX9=0; //8-bit reception
TXEN=1; // Enable transmission
}
void SendStringSerially(const unsigned char* st)
{
while(*st)
SendByteSerially(*st++);
}
void SendByteSerially(unsigned char Byte) // Writes a character to the serial port
{
while(!TXIF); // wait for previous transmission to finish
TXREG = Byte;
}
these lines are not needed...
TRISC6 = 1; // TX Pin
TRISC7 = 1; // RX Pin
and, for 20MHZ Fosc, 9600 BR with high speed mode SPBRG = 0x129;
if i connect to this serial communication to the gsm receiver + at commands means it will send message to the mobile number?
i got the output in GSM modem.
- - - Updated - - -
thanks for your help.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?