Pic18F4520/25 to GM862-GPS

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
Vernon A
Posts: 21
Joined: 26 Apr 2009 01:52

Pic18F4520/25 to GM862-GPS

#1 Post by Vernon A » 26 Apr 2009 02:12

Hi everybody,

I'm trying to program my pic 18F4520/25 to GM862-GPS module, so it can show me a position on google earth or argis.
So far I tried to send the command AT$GPSACP to from my pic to GM862-GPS, so I could view the position in the USART terminal in mickroC.
But I'm not getting anything back.
I'm using 2 rs-232 connection one from the easypic5 and and extra board rs232.

This is the command I've tried sending, but I guess my code is wrong,

void main() {
signed short a= 65;
signed short b= 84;
signed short c= 36;
signed short d= 71;
signed short e= 80;
signed short f= 83;
signed short g= 65;
signed short h= 67;
signed short i= 80;


USART_init(9600); // initialize USART module
// (8 bit, 2400 baud rate, no parity bit...
while (1) {
if (USART_Data_Ready()) { // if data is received
a = USART_Read();
b = USART_Read();
c = USART_Read();
d = USART_Read();
e= USART_Read();
f = USART_Read();
g = USART_Read();
h= USART_Read();
i = USART_Read();

// read the received data
USART_Write(a);
USART_Write(b);
USART_Write(c);
USART_Write(d);
USART_Write(e);
USART_Write(f);
USART_Write(g);
USART_Write(h);
USART_Write(i);
// send data via USART
}
USART_Write(a);
USART_Write(b);
USART_Write(c);
USART_Write(d);
USART_Write(e);
USART_Write(f);
USART_Write(g);
USART_Write(h);
USART_Write(i);

Delay_ms(5000);
}
}//~!

The modul takes ascii code.

So if anyone could help with this code in MikroC, that would be great.

Thank you in advance

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: Pic18F4520/25 to GM862-GPS

#2 Post by zristic » 27 Apr 2009 09:50

See here:

http://www.mikroe.com/en/article/09/04/

Please do not duplicate your posts.

Post Reply

Return to “mikroC PRO for PIC General”