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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Need Help "PPP for 16 bit microcontroller"


Syed Raza wrote:
> 
> I am developing PPP for 16 bit micronotroller (EVB3067).Its a very minimal
> implementation of PPP.
> 
> I am trying to establish connection between linux and hitachi evaluation board.
> I am using 3 SCI port of Hitachi board. 1 for PPP connection 2nd for downloading
> the code and 3rd is to provide debugging information on hyperterminal (as i can
> not use printf() function )

 Does this mean that you have two ports connected to the NT-machine and one to
the Linux-machine (the PPP-link) ?

 Why you cannot use the 'iprintf()', 'puts()' etc. in your H8/300-program to
print to the serial line connected to the hyperterminal?

 Where is your write() outputting now? Why not just change the default
newlib one:
---------------------- 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 ------------------------------------------

to use something else than the routine in '@@0xc4' ?  Does the HDI-monitor
disable using the serial port for your own purposes?

> I am having the folowing problems:
> 
> - I am not able to convert the ASCI characters into Hexadecimal or Decimal format
> which i received in from Client. Is there a problem of Library, i mean i am using
> newlib-1.8.2

 What is 'Client', the Linux machine?  So the H8-machine cannot convert the received
stuff into Hex?  Why not?

> But now i am trying to do the real connection by using the PPP between linux and
> my hitachi board. But now the real problem started, i want to read the PPP frame
> which is in HDLC format and then reply to peer after doing the Frame cheack seq > ...etc (all what is required by reall/standard PPP implementation)and cheacking
> if all the field is valid.
> 
> - But what i am getting is garbage, and what Linux is receiving is also garbage.
> Somehow data is corrupted.and connection can not establish

 What kind of flow-control Linux uses?  What flow-control the H8-machine uses?
Doing it with hardware (RTS/CTS) or with software (XON/XOFF, can this be used...)?
They both should use the same protocol for flow-control...

 Remembering that the guys in the VTT-Telecommunications lab at 70's didn't see
the missing DTR/DSR/RTS/CTS-signals in my three-wire connection being the reason
for 'nothing happening', and later I found that the 'specialists' in the Finnish
Telecom Company (now Sonera) seemed never to have heard about the 'flow-control'-
lines and their use in a serial connection, etc. etc. I now know the once much-
advertised book "The RS232C Connection" and the prologue there about the customer
who shot the dealer who claimed that "It is easy to connect a printer with a
serial connection to your PC", having really a purpose....

 The Linux-machine with 16550-like chips should handle high speeds using its
RTS/CTS-based flow-control, aimed for a modem connection, but the responsibility
for the Hitachi-side belongs to you...

 The SCI-ports in 3067 don't seem to have anything for these 'modem lines'...
So how did you solve this problem? Were some parallel lines used to get the
RS232C modem lines?

 BTW, what is the used speed ?  9600 bit/s or much higher ?  When will Linux
start loosing chars?  The Hitachi-machine ?  Have you an interrupt-based
serial-routine with a receive-queue (buffer) or what on the Hitachi-side?

 BTW, any nice serial drivers for H8/300-series?  The "Hitachi Europe Ltd.
ISSUE : APPS/019/1.0 APPLICATION NOTE DATE : 20/9/94, H8-300 ‘C’ Code
Framework Example Program" has one simple one:

--------------------- clip ----------------------------------------
interrupt [SCI_RXI0] Receive_Port0(void)
/*
        Interrupt handler for receive interrupt generated by port 0 
*/
{
static unsigned char Index=0;

/* read character into circular buffer */

g_rxd_buffer0[Index++] = SCI0_RDR;

/* Reset RDRF flag - using sfr structure */
SCI0_SSR.6 = 0;

if (Index >= 32) Index = 0;

}
--------------------- clip ----------------------------------------

 But this doesn't seem to use any flow-control, ie. toggling the RTS/CTS
lines when the buffer is 2/3 full and when it is again 1/3 full, or
something... Or is this somehow 'automatic' in the SCI ? (It having
a smaller 16-byte buffer like a 16550-chip?)

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]