Microcontroller › PIC › GSM SIM 300 with PIC 16F877A GSM response data display on LCD problem
- This topic has 2 replies, 3 voices, and was last updated 11 years, 1 month ago by
manimaran.
-
AuthorPosts
-
February 26, 2014 at 1:05 pm #2904
Dhananjaya
ParticipantSir
I have tested for the following code but it will display only for Carrage return(CR) and Line feed (LF)values i have checked the ASCII table. GSM SIM response data add with 0x30 so it will display like =: so it will in the ASCII table check thisless than this values – 0x30 it will for CR and LF but not display like OK
please help me… what are the instructions to do this getting like OK . I think it will not given OK from GSM SIM response please check my code and correct it …
#ifndef _SERIAL_H_
#define _SERIAL_H_
#define _XTAL_FREQ 4000000L
//#ifndef _SERIAL_H_
#define _SERIAL_H_
#define BAUD 9600
#define FOSC 4000000L
#define NINE 0 /* Use 9bit communication? FALSE=8bit */
#define DIVIDER ((int)(FOSC/(16UL * BAUD) -1))
#define HIGH_SPEED 1
#if NINE == 1
#define NINE_BITS 0x40
#else
#define NINE_BITS 0
#endif
#if HIGH_SPEED == 1
#define SPEED 0x4
#else
#define SPEED 0
#endif
#define RX_PIN TRISC7
#define TX_PIN TRISC6
/* Serial initialization */
#define init_comms()
RX_PIN = 1;
TX_PIN = 1;
SPBRG = DIVIDER;
RCSTA = (NINE_BITS|0x90);
TXSTA = (SPEED|NINE_BITS|0x20)
#endif
__CONFIG(XT & WDTDIS & PWRTEN & BORDIS & LVPDIS &
main()
{
INTCON = 0;
init_comms();
wait(10);
lcd_init();
wait(10);
clearBuffer();
lcd_clear();
i=0;
Tx_string(“ATr”);
while(RCIF){
buffer=RCREG;
i++;
}
buffer= ‘