16F877a to PC to Handphone

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Re: 16F877a to PC to Handphone

Postby E11022 » Sun Dec 11, 2011 2:06 pm

i do not have GSM module and the serial cable DRS-11 for Sony Ericson T630 . Hence i need to use PC for the serial port, then to Handphone. yup, can Hyperterminal handle 2 com ports? this is another doubt.
if i only wanna display output to PC?
E11022
Novice
 
Posts: 27
Joined: Tue Nov 15, 2011 10:13 pm

Re: 16F877a to PC to Handphone

Postby ABSF » Mon Dec 12, 2011 6:56 am

E11022 WROTE:My PC got COM port, so i connected it like this:
Pin 2 (RS232) - Pin 14 (MAx232)
Pin 3 (RS232) - Pin 13 (MAX232)
Pin 12 (MAX 232) - Pin 25 (PIC)
Pin 13 (Max232 - Pin 26(PIC)



I think there's something wrong with the connections to MAX232. Please check it carefully refering to the datasheets of max232.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: 16F877a to PC to Handphone

Postby E11022 » Mon Dec 12, 2011 9:05 am

ABSF WROTE:
E11022 WROTE:My PC got COM port, so i connected it like this:
Pin 2 (RS232) - Pin 14 (MAx232)
Pin 3 (RS232) - Pin 13 (MAX232)
Pin 12 (MAX 232) - Pin 25 (PIC)
Pin 13 (Max232 - Pin 26(PIC) PIN 11(max 232) - pin 26(PIC)



I think there's something wrong with the connections to MAX232. Please check it carefully refering to the datasheets of max232.

Allen


typo mistake.i manage to display data from PIC to hyperterminal,using putc('A'). but when the same command is add in my program code, the circuit is not working. I asked my friends about it. We debug the code together, cannot find any problem on the code.
#include "16f877a.h"
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)

#define sensor PIN_A0
#define sw PIN_A1
#define buzzer PIN_C5
#define led PIN_C4


void main (void)
{
set_TRIS_C(0x00);
set_TRIS_A(0xff);

while(1)
{
if((input(PIN_A0))&&(!input(PIN_A1)))
{
delay_ms(100);
if((input(PIN_A0))&&(!input(PIN_A1)))
{
puts("help!");
output_high(led);
output_high(buzzer);
}
else {}
}
else if ((!input(PIN_A0))&&(input(PIN_A1)))
{
output_low(led);
output_low(buzzer); }
else {
output_low(led);
output_low(buzzer); }
}
}
E11022
Novice
 
Posts: 27
Joined: Tue Nov 15, 2011 10:13 pm

Previous

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 9 guests