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 support@ccsinfo.com

dialing out with modem

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







dialing out with modem
PostPosted: Fri Jun 27, 2003 9:01 am     Reply with quote

Hello,
I am in the process of converting a PicBasic Pro program to CCS C. The program dials out through an old 2400 bps modem. I can't seem to get the modem to do anything. This is the test program I'm using:

#include "mylcd.h"
#include <string.h>

#use rs232(baud=2400, xmit=PIN_C6, rcv=PIN_C7)

#byte ADCON1 = 0X9F //The adcon1 register

/*----------FUNCTIONS-----------*/

/***************Main Program Starts Here*************/
void main(){

//Variables

char phone[8],line1[25];

/*----------configure all the ports-------*/
Set_Tris_A(0x00); //set port A to outputs
Set_Tris_B(0x33); //make RB5, RB4(BUTTONS),
//RB1 (DQin) and RB0(pulse in) inputs
Set_Tris_C(0x97); //RC7, (Hserin), RC4(RTC),
//RC2, RC1, RC0 inputs
Set_Tris_D(0x00); //set port D to outputs
Set_Tris_E(0x00); //set port E to outputs

/*-----------set PIC registers------------*/
ADCON1=0b00001110;



delay_us(500);
lcd_init();
lcd_clear();

strcpy(line1, "RS232test"); // copy string
lcd_puts(line1);
delay_ms(1000);

printf("ATM1L1\r");
printf("ATDT4333870\r");


while(1);
}

I am getting no response from the modem, except the TX (transmitting) light flashes on and off. Can anyone help?

Thanks,
mle
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515601
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: dialing out with modem
PostPosted: Fri Jun 27, 2003 12:22 pm     Reply with quote

:=Hello,
:=I am in the process of converting a PicBasic Pro program to CCS C. The program dials out through an old 2400 bps modem. I can't seem to get the modem to do anything.
----------------------------------------------------

There was a recent thread on how to "wake up" the modem.
<a href="http://www.pic-c.com/forum/general/posts/144515141.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/144515141.html</a>
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515612
Doug Evans
Guest







Re: dialing out with modem
PostPosted: Sat Jun 28, 2003 8:45 pm     Reply with quote

:=Hello,
:=I am in the process of converting a PicBasic Pro program to CCS C. The program dials out through an old 2400 bps modem. I can't seem to get the modem to do anything. This is the test program I'm using:
:=
:=#include "mylcd.h"
:=#include <string.h>
:=
:=#use rs232(baud=2400, xmit=PIN_C6, rcv=PIN_C7)
:=
:=#byte ADCON1 = 0X9F //The adcon1 register
:=
:=/*----------FUNCTIONS-----------*/
:=
:=/***************Main Program Starts Here*************/
:=void main(){
:=
:=//Variables
:=
:=char phone[8],line1[25];
:=
:=/*----------configure all the ports-------*/
:=Set_Tris_A(0x00); //set port A to outputs
:=Set_Tris_B(0x33); //make RB5, RB4(BUTTONS),
:= //RB1 (DQin) and RB0(pulse in) inputs
:=Set_Tris_C(0x97); //RC7, (Hserin), RC4(RTC),
:= //RC2, RC1, RC0 inputs
:=Set_Tris_D(0x00); //set port D to outputs
:=Set_Tris_E(0x00); //set port E to outputs
:=
:=/*-----------set PIC registers------------*/
:=ADCON1=0b00001110;
:=
:=
:=
:=delay_us(500);
:=lcd_init();
:=lcd_clear();
:=
:=strcpy(line1, "RS232test"); // copy string
:=lcd_puts(line1);
:=delay_ms(1000);
:=
:=printf("ATM1L1\r");
:=printf("ATDT4333870\r");
:=
:=
:=while(1);
:=}
:=
:=I am getting no response from the modem, except the TX (transmitting) light flashes on and off. Can anyone help?
:=
:=Thanks,
:=mle

Try putting "\n" in your string. The typical modem requires 0x0d and 0x0a at the end of the string before it will recognize the line as a command. You might also try starting out your command sequence with a reset, then wait 500ms: this is typical "ATZ\n", check your modem docs.

-de
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515627
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