It is currently 20 Jan 2019 09:47

All times are UTC + 1 hour

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 27 Aug 2017 19:50 

Joined: 27 Aug 2017 19:28
Posts: 21
hi all,
i am new one with UART. i have interface gsm with pic controller and my objective is to read the specific number from sim card and display on it lcd .
for that i used command =>AT+CPBF="NAME"
and UART libray in MIkroc pro, but am not getting output. i do nt understand where i am wrong, i am posting my code below
#define TRUE 1

#define bool_val_1 flags. f0
#define LCD_DIR   TRISD
#define CTRL_DIR   TRISB
#define LCD       PORTD
#define RS        PORTB.F0
#define E         PORTB.F1

int flag=0,gps_flag=1;
 int i=0;
 int k;
  char send_data();
  char response[70]="";

void main()
 {    CTRL_DIR=0X00;
     UART1_Init(9600);              // Initialize UART module at 9600 bps
     /*Soft_UART_Init(&PORTD, 0, 1, 9600, 0);
     init_lcd() ;

     string_lcd("AT+CGNSPWR=1")  ;
     string_lcd("AT+CGPSOUT=32")  ;

 char send_data()
      char flags;
       char byte;
       int k;
       char num[10];
       bool_val_1 = TRUE;

       //string_lcd("AT+CGPSOUT=32")  ;

          UART1_Write_Text(response)  ;
         // Soft_UART_Write(response);
           num[k-4]=response[k] ;
        return ;
 } please look over the code and help me

PostPosted: 12 Sep 2017 18:15 
User avatar

Joined: 21 Mar 2017 16:57
Posts: 527

First of all, sorry for the late reply
Second, the best way to troubleshoot your issue is to print things onto UART terminal and write back the responses with the keyboard and send back - terminals integrated in our compilers do a good job for that purpose.This way you'd mimic the behavior of the hardware. Make sure that you can parse commands correctly. Then if this is good, check that you are using the correct baud rate to communicate with the module...

I hope this helps
Best regards

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: