![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
mle Guest
|
dialing out with modem |
Posted: Fri Jun 27, 2003 9:01 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: dialing out with modem |
Posted: Fri Jun 27, 2003 12:22 pm |
|
|
:=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 |
|
![](templates/subSilver/images/spacer.gif) |
Doug Evans Guest
|
Re: dialing out with modem |
Posted: Sat Jun 28, 2003 8:45 pm |
|
|
:=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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|