murad772
Joined: 30 Oct 2010 Posts: 5
|
ex17.c error (PPP) |
Posted: Mon Nov 01, 2010 10:54 am |
|
|
Hello,
I have internet development kit that have pic18f6722.
I want to use ppp to make a simple server.
The code compiles with no errors. But when run it on the kit nothing appear on LCD.
I have put printf functions in the main function to determine where is the error. I found that when it call "StackInit();" it does not exit the function so it does not execute the printf functions after the calling.
How can I fix it so I can connect using the dial up modem ?
Below in the main function of ex17.c , the problem is inside comments:
Code: | void main(void) {
MODEM_RESP resp;
char x;
MACAddrInit();
IPAddrInit();
ISPInit();
setup_adc_ports(ANALOG_AN0_TO_AN1);
set_tris_a(3); //set A0 and A1 to input for ADC
set_tris_b(0);
setup_adc(ADC_CLOCK_INTERNAL);
lcd_init();
///////////////////////////////////////////////////////////////////////////////////
//here the problem happens
StackInit();
// it does not exit from this function call
//////////////////////////////////////////////////////////////////////////////////
while(TRUE) {
if (!ppp_is_connected() && !ppp_is_connecting()) {
printf(lcd_putc,"\fDialing");
resp=ppp_connect(ppp_username, ppp_password, ppp_phonenumber);
if (resp==MODEM_BUSY) {
printf(lcd_putc,"\fBusy Signal");
delay_ms(2000);
}
else if (resp==MODEM_NO_DIALTONE) {
printf(lcd_putc,"\fNo Dialtone");
delay_ms(2000);
}
else if (resp!=MODEM_CONNECTED) {
printf(lcd_putc,"\fDial Error");
delay_ms(2000);
}
else {
printf(lcd_putc,"\f%LUbps", connected_baudrate);
printf(lcd_putc,"\nNegotiating PPP");
}
}
StackTask();
HTTPTask();
LCDTask();
}
} |
|
|