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.

interfacing PIC 16F628A to a Mobile Phone

Status
Not open for further replies.

windowsxm

Newbie level 3
Joined
Jul 2, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
Hello everybody,i am new to this forum and i am hoping that somebody will help me out in solving my problem.

Recently,i have started doing a project where by i interface a microcontroller(PIC 16F628A) to a mobile phone (NOKIA 6500) to send a SMS.after a lot of googling,i have decided to use AT commands as it is very easy to understand and i used C laguage(software - MikroC pro) to program my PIC.

How did i connect my PIC to the phone?

16F628A --> MAX232 -->DB 9 Female --> USB to serial RS232 converter(RS232 side connected to DB 9)-->USB A to USB A Female Adaptor -->mobile phone's cable (USB) --> mobile phone(NOKIA 6500)

What is my problem?
i can't seem to have my code sent from the PIC to the phone.

What are the tests that i have carried out?

1- i checked the PIC functionality by writing a simple code to continuously blinking a LED.
2 - i checked whether the phone supports the AT commands by typing in the commands using Hyperterminal.
3 - i simulated the the PIC and the code using (Proteus 7 ) and it works.

Can any one point out to the thing that i am doing wrong.
Thanks in advance

The code

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
void main(){
UART1_init(9600);
UART1_Write_Text("AT+CMGF=1");
Delay_ms(2000);
UART1_Write(0x0D);
Delay_ms(2000);
UART1_Write_Text("AT+CMGS=");                //AT+CMGS=
Delay_ms(1000);
UART1_Write(0x22);                                        //write (")
Delay_ms(2000);
UART1_Write_Text("0123456789");        //number SMS send to
Delay_ms(2000);
UART1_Write(0x22);                                        // write (")
UART1_Write(0x0D);                                        // <CR> mean (ENTER)
Delay_ms(2000);
UART1_Write_Text("hi");                                //words to be sent
UART1_Write(0x0D);
Delay_ms(2000);
UART1_Write(26);                                        //ctrl+z
Delay_ms(2000);
UART1_Write(0x0D);                                        // <CR> mean (ENTER)
Delay_ms(2000);
}

 

Attachments

  • sms.jpg
    sms.jpg
    266.6 KB · Views: 110
Last edited:

At the first look, there is lot of timing between text and enter. Reduce the timing(no need for a delay there).
 

Still no results,i tried to reduce and remove the delays as well.
 

Does the same sequence working fine from hyperterminal??
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top