CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Conection pic-mobile phone

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SirDrake



Joined: 02 Jun 2004
Posts: 2

View user's profile Send private message

Conection pic-mobile phone
PostPosted: Wed Jun 02, 2004 4:36 am     Reply with quote

Hi, i´m newby here and in programing pics but finding some help i've come here. I hope u could help me.

I'm trying to send some at commands to a siemens mobile and recive the data with a 16f876. With the pc i can do the comunication but the phone seems not reciving anything.

I use a 9 pin conector where i conect the data cable. The pin 1,4 and 6 are joined, the same as the 7and 8. The pin 2 goes to tx of the max232, the 3 goes to the rx of the max and the 5 to Gnd. That's right? the max is joined to the rx and tx pins of the pic.

I paste a program that i've typed.

#include <16F876.h>
//#device adc=8
#use delay(clock=4000000)
#use rs232(baud=9600,xmit=PIN_C6,Rcv=PIN_C7)
#fuses XT,NOWDT,NOPROTECT,NOLVP


void main()
{
char string[30];
char cr;
int i=0;
port_b_pullups(TRUE);
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_counters(RTCC_INTERNAL,WDT_18MS);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);

SET_TRIS_C(0b10000000);//rc7 como entrada de datos del puerto serie

delay_ms(2000);
output_high(PIN_A0);
delay_ms(1000);
printf("at");
output_low(PIN_A0);
getc();
delay_ms(500);
output_high(PIN_A0);
delay_ms(1000);
}

if i conect the conector to the pc and open the hyperterminal y recive at and if i press a key the led lights. But if i conect the conector to the data cable and to the phone with the echo activated the led must light when recive the echo but it doesn't happens.

Have someone any idea?

Thanks
William H. Conley III



Joined: 27 May 2004
Posts: 17
Location: Tucson, AZ

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Jun 02, 2004 9:14 am     Reply with quote

I would use:
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,BRGH1oK,errors)

getc() will return one byte.

Are you sure you have the TX and RX connected correclty to you CELL MODEM?

Is there a way to disable FLOW control on you modem.

-bc
Lorenzo



Joined: 23 Apr 2004
Posts: 14
Location: Pescara (Italy)

View user's profile Send private message

PostPosted: Thu Jun 03, 2004 12:56 am     Reply with quote

You must send:
printf("at\r");

Lorenzo
SirDrake



Joined: 02 Jun 2004
Posts: 2

View user's profile Send private message

PostPosted: Thu Jun 03, 2004 2:49 am     Reply with quote

I conect the rx and tx of the max232 to the conector and it to the datacable. I'm sure that the link is right but i don't know if i must conect to the max or to the pic.

If i send at/r y must recive ok but if i send at i must recive at (the echo) and i recive nothing.

What is the flow control?

now i'm going to change the connection parameters and tell you if make something diferent.

Thanks
William H. Conley III



Joined: 27 May 2004
Posts: 17
Location: Tucson, AZ

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Jun 03, 2004 11:00 am     Reply with quote

Flow control is a way for your modem to tell another device to stop or start transmitting data. It can be hardware, (RTS/CTS) or software, (XON/XOFF).

If your modem requires flow control, or has flow control enabled, it may case serial data to be ignored.

The way you have your serial routines written will accept one byte.

I would wite a buffer routine that buffers data then you can parse through the array.

-bc
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group