Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

UART data in Array and Display on LCD

Status
Not open for further replies.

Fayyaz Hussain

Newbie level 1
Joined
Sep 13, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Rawalpindi, Pakistan, Pakistan
Activity points
16
Hellow to every one

help me plz
I am doing a final year project of MSc Electroncis
in which i am using PIC18f452, GSM SIM900d
and want to read sms from GSM module through UART and want to store in Array (And this i cant do)
then want to send to PC for Graph in MATLAB through serial port
and want to saparat my data from whole information given by GSM module means time stap, date stamp, message center Number, sender number etc......

can any one help plz...
my code is following whichs cant give me my desire results
my code compiler is MikroC
CODE:

#include <built_in.h>
unsigned char i;
unsigned char my_data[30];
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;

sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;

sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;

sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
void main()
{
TRISB=0X00;
PORTB=0X00;

UART1_init(9600);

Lcd_Init();
while(1)
{
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"PROJECT MSc ELT");

Delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"MTU");

Delay_ms(500);

UART1_write_Text("AT\r");
Delay_ms(200);
UART1_write_Text("AT+CMGF=1\r");
Delay_ms(200);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"RAEDING RTU DATA");
Lcd_Out(2,1,"WAITING....");
UART1_write_Text("AT+CMGR=1\r");

if (UART1_Data_Ready() == 1)
{
my_data = UART1_Read();
i++;
}
Delay_ms(500);
UART1_write_Text("AT+CMGD=1\r");

Delay_ms(500);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,2,"RTU DATA READ");
Delay_ms(10000);
}
}

Plz guide me...
 

Check with differnet baud rates ,Uart is a simple protocol , instead of using the mikroc inbuilt libraries (shortcut methods ) read the datasheet and then try to init the uart .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top