- This topic has 1 reply, 2 voices, and was last updated 9 years, 1 month ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › interfacing pic18f4550 with gps
// Program to Interface GPS with PIC18F4550 Microcontroller
#define FREQ 12000000
#define baud 4800
#define spbrg_value (((FREQ/64)/baud)-1)
#define rs LATA.F0
#define rw LATA.F1
#define en LATA.F2
#define lcdport LATB
TRISB=0; // Set Port B as output port
LATB=0;
TRISA=0;
LATA=0;
SPBRG=spbrg_value; // Fill SPBRG register to set the baud rate
sir ,i need some information about the usage of these steps.please give some explaination in detail
TRISX(X= any port like A,B etc) is used for define output or input port.0 is define for output and 1 for define input.In your code LCD is connected with portB and you want to send some data to LCD for display purpose so it is define as output port.LATX(X = any port like A,B etc.) is output latch onto which value are written.SPBRG is used for set the baud rate for serial communication.It is all configuration register which is need to be configure as per your application.