linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* rs232 endianness on PPC
@ 2006-06-30 19:10 tauanna
  2006-07-01  8:53 ` White
  0 siblings, 1 reply; 5+ messages in thread
From: tauanna @ 2006-06-30 19:10 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

when I write a byte on the SMC1 (MPC875) serial device (let us say 
0x11) what should I expect on the output pin? First a 0 then 0, 0, 1, 
0, 0, 0, 1 or the opposite. Is it different on a little endian CPU?

Bye,
Antonio.




		
Hai voglia di fare un viaggio, ma non sai dove andare?
Scegli una delle nostre offerte HOTEL IN ITALIA E IN EUROPA da 50 euro.
Prenota subito su Expedia.it e... buona vacanza!

http://expedia.viaggi.tiscali.it/default.aspx?eapid=330-8 
 
	

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: rs232 endianness on PPC
  2006-06-30 19:10 rs232 endianness on PPC tauanna
@ 2006-07-01  8:53 ` White
  2006-07-01 15:56   ` Dan Malek
  0 siblings, 1 reply; 5+ messages in thread
From: White @ 2006-07-01  8:53 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: tauanna@tiscali.it


PowerPC is only Byte swaped, not bit-swaped :)
(I thought there are only some old mainly unused Architecturs, who swap
the Bits :)

The second: I think the bitorder on the rs232 is standarized :) and
should be the same ... :)

Am Fri, 30 Jun 2006 21:10:31 +0200 (CEST) schrieb "tauanna@tiscali.it"
<tauanna@tiscali.it> :

> Hi,
> 
> when I write a byte on the SMC1 (MPC875) serial device (let us say 
> 0x11) what should I expect on the output pin? First a 0 then 0, 0, 1, 
> 0, 0, 0, 1 or the opposite. Is it different on a little endian CPU?
> 
> Bye,
> Antonio.
> 
> 
> 
> 
> 		
> Hai voglia di fare un viaggio, ma non sai dove andare?
> Scegli una delle nostre offerte HOTEL IN ITALIA E IN EUROPA da 50 euro.
> Prenota subito su Expedia.it e... buona vacanza!
> 
> http://expedia.viaggi.tiscali.it/default.aspx?eapid=330-8 
>  
> 	
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: rs232 endianness on PPC
  2006-07-01  8:53 ` White
@ 2006-07-01 15:56   ` Dan Malek
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Malek @ 2006-07-01 15:56 UTC (permalink / raw)
  To: White; +Cc: tauanna@tiscali.it, linuxppc-embedded


On Jul 1, 2006, at 4:53 AM, White wrote:

> PowerPC is only Byte swaped, not bit-swaped :)

PowerPC isn't byte swapped, the other world is :-)

> The second: I think the bitorder on the rs232 is standarized :) and
> should be the same ... :)

RS-232 is LS bit first.


	-- Dan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: rs232 endianness on PPC
@ 2006-07-02 10:10 Antonio Di Bacco
  2006-07-06 15:31 ` Walter L. Wimer III
  0 siblings, 1 reply; 5+ messages in thread
From: Antonio Di Bacco @ 2006-07-02 10:10 UTC (permalink / raw)
  To: linuxppc-embedded

PowerPC is neither byte swapped nor bit swapped.
When transmitting on a network card the most significant byte is transmitted 
first, and, inside the byte, the most significant bit is sent first.
RS232 is an exception: LSB is sent first.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: rs232 endianness on PPC
  2006-07-02 10:10 Antonio Di Bacco
@ 2006-07-06 15:31 ` Walter L. Wimer III
  0 siblings, 0 replies; 5+ messages in thread
From: Walter L. Wimer III @ 2006-07-06 15:31 UTC (permalink / raw)
  To: linuxppc-embedded

On Sun, 2006-07-02 at 12:10 +0200, Antonio Di Bacco wrote:
> PowerPC is neither byte swapped nor bit swapped.
> When transmitting on a network card the most significant byte is transmitted 
> first, and, inside the byte, the most significant bit is sent first.

FYI, the *bit*-order on a network actually depends on the layer 2
network standard that you happen to be communicating over.  Ethernet /
IEEE 802.3 is *least significant* bit first on the wire.  SLIP and
asynchronous PPP (since they go over RS232) are also least-significant
bit first.  IBM Token-Ring / IEEE 802.5 was most-significant bit first
on the wire.

IETF protocols such as IP, TCP, UDP, etc., etc., etc., only specify the
*byte* order, which is most-significant *byte* first.

Generally speaking, a network device driver programmer need only worry
about getting the *byte* order correct.  The network interface hardware
generally takes care of the *bit* order.  (An exception to this can be
drivers and interface hardware for some low-speed "networks" such as I2C
or Dallas 1-Wire.  These may be very primitive and require software
"bit-banging" where the driver software must explicitly shift bits out
of a byte and transmit them one bit at a time.  Clearly in these cases,
the driver must transmit the bits in the correct order based on the
appropriate standard (e.g. I2C, Dallas 1-Wire, etc.).)



Cheers,

Walt Wimer
TimeSys Corporation

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-07-06 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-30 19:10 rs232 endianness on PPC tauanna
2006-07-01  8:53 ` White
2006-07-01 15:56   ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2006-07-02 10:10 Antonio Di Bacco
2006-07-06 15:31 ` Walter L. Wimer III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).