Part II : Need Help "PPP for 16 bit microcontroller"
Syed Raza
Syed.Raza@vtt.fi
Fri Sep 22 01:52:00 GMT 2000
Hai
Thank you very much for reply, below u will find my receiving() &
transmiting() function which may the reason of not getting the whole PPP
packet correctely.
====================================================================
Does this mean that you have two ports connected to the NT-machine and
one to
the Linux-machine (the PPP-link) ?
- yes i am using 3rd SCI channel for debuging and to transmitting the
contents of my buffer, I configure it using a small external RS232/TTL
converter circuit
Where is your write() outputting now? Why not just change the
default
newlib one:
- my write and read functions(transmit() , receive() respectively) are as
under, i didnt use my receive( ) function as an interrupt
====
SCI 1 AND 2 INITILIZATION
====
void initio (void)
{
SCI_SMR1 = 0x00;
SCI_BRR1 = 0x0e;
SCI_SCR1 = 0x30;
SCI_SSR1 &= 0x84;
SCI_SMR2 = 0x00;
SCI_BRR2 = 0x0e; Baud rate 38400 bit/sec
SCI_SCR2 = 0x30;
SCI_SSR2 &= 0x84;
}
==================================
Function for receiving the date
===================================
unsigned char receive (void)
{
unsigned char c;
while ((SCI_SSR1 & 0x040) != 0x40)
{
if ((SCI_SSR1 & 0x38) != 0x00)
{
SCI_SSR1 &= 0xC7;
}
}
c = SCI_RDR1;
SCI_SSR1 &= 0xBF;
return(c);
}
void transmit (unsigned char t)
{
while ((SCI_SSR1 & 0x80) != 0x80);
SCI_TDR1 = t;
SCI_SSR1 &= 0x7F;
}
===================================================
Function for printing the debuggin info to Hyperterminal
====================================================
void printf(unsigned char *str)
{
while (*str != '\0')
transmitSCI2(*str++);
}
void transmitSCI2(unsigned char t)
{
while ((SCI_SSR2 & 0x80) != 0x80);
SCI_TDR2 = t;
SCI_SSR2 &= 0x7F;
}
-- my hitachi board and linux box is using the same baud rate which is
38400 bit/sec
???????????????????????????????
---------------------- clip
------------------------------------------
int _write(file, ptr, len)
int file;
char *ptr;
int len;
{
int todo;
for (todo = 0; todo < len; todo++)
{
asm("mov.b #0,r1l\n mov.b %0l,r2l\njsr @@0xc4" : :
"r" (*ptr++) : "r1", "r2");
}
return len;
}
---------------------- clip
------------------------------------------
The problem could not be because of folow control,as i was receiving the
and transmiting the the ASCII characters by using the windows to
Hitachi
looking forward your help
syed
-------------VTT - Technical Research Centre of
Finland-----------
Syed
Raza ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
ÃÂ
VTT-Electronics
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
P.O.Box
1100 ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
FIN-90571 Oulu,
FinlandÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Email: Syed.Raza@vtt.fiÃÂ ÃÂ ÃÂ
URL:
www.ele.vtt.fi
Tel: (Res)+358 8 880 4183
Tel: (off)ÃÂ +358 8ÃÂ 551 2439.
Fax: (off) +358 8 551 2320.
---------------------------------------------------------------------------------
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list