This is the mail archive of the
crossgcc@sources.redhat.com
mailing list for the crossgcc project.
See the CrossGCC FAQ for lots
more infromation.
Part II : Need Help "PPP for 16 bit microcontroller"
- To: "'gnuh8 at pcserv dot demon dot co dot uk'" <gnuh8 at pcserv dot demon dot co dot uk>, <crossgcc at sources dot redhat dot com>
- Subject: Part II : Need Help "PPP for 16 bit microcontroller"
- From: Syed Raza <Syed dot Raza at vtt dot fi>
- Date: Fri, 22 Sep 2000 11:49:29 +0300
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
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