Searching \ for '[PIC]: Data Bus Issue' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/memory.htm?key=data
Search entire site for: 'Data Bus Issue'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Data Bus Issue'
2003\09\12@180917 by Josh Koffman

flavicon
face
Ok, this is half EE, half PIC. I'm designing a circuit that uses a 4 bit
data bus (plus a few flow control lines) to transfer some values between
a 16f877 and a Scenix SX28 chip. I'd like to put these chips close
together to avoid long PCB traces. I don't have to use specific pics to
transfer the data, but ideally it I could get 4 pins to line up between
the two chips ie, RA0-RA0, RA1-RA1, RA2-RA2, RA3-RA3. That way all the
data I transfer is correct LSB-MSB without having to do some sort of
software translation on it.

However, all is not going quite so easily. Both chips use a similar
numbering convention, so pins on the left of the chip increase in value
as they go down, and pins on the right increase as they go up. For
example:
RA0 |\/| RB7            RA0 |\/| RB7
RA1 |  | RB6            RA1 |  | RB6            (these are just for
RA2 |  | RB5            RA2 |  | RB5             illustration only)
RA3 |  | RB4            RA3 |  | RB4
etc

So things don't line up nice. I'd like to avoid a huge copper trace
spider's web trying to fix that. I'd even thought about rotating one
chip 180degrees, but the problem remains.

So my questions. Short of putting one chip on top of the board and one
on the bottom, can anyone think of an easy solution? Secondly, does
anyone have a routine for reversing the order of bits in a byte? If I
transfer data and it ends up MSB-LSB order swapped, what is a good way
to swap it back? I could just use a bunch of btfsc's I suppose.

Thanks,

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\09\12@183859 by Olin Lathrop

face picon face
> RA0 |\/| RB7            RA0 |\/| RB7
> RA1 |  | RB6            RA1 |  | RB6            (these are just for
> RA2 |  | RB5            RA2 |  | RB5             illustration only)
> RA3 |  | RB4            RA3 |  | RB4
> etc
>
> So things don't line up nice. I'd like to avoid a huge copper trace
> spider's web trying to fix that.

That will hardly be a "huge copper spider web".  This sort of thing goes
on all the time during routing.  Unless they are partcularly sensitive
signals (and it doesn't seem that way from your description), don't worry
about it.  Just let the auto router do whatever it does.  Most likely the
signals will get routed via even more convoluted paths than what you
envision.  Big deal.  It's all handled by computer.  It might make a
ratsnest, but it won't mess up the connections.  Spend the extra time
worrying about good grounds instead.

Note that there are cases where this relaxed attitude is inappropriate,
but it doesn't seem like this is one of them from your description.

> I'd even thought about rotating one chip 180degrees,

I'd only consider that if the reduction in complexity made the difference
between a routable and unroutable board, or the signals were very
sensitive.  Otherwise, someone isn't going to notice one IC is reversed
from the other and one of them is going to get installed backwards.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2003\09\12@190350 by Josh Koffman

flavicon
face
You're right. In fact, I just figured out a decent routing in my head.
Not as pretty as 4 straight lines, but then again, pretty is subjective
right? :)

Thanks,

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Olin Lathrop wrote:
> That will hardly be a "huge copper spider web".  This sort of thing goes
> on all the time during routing.  Unless they are partcularly sensitive
> signals (and it doesn't seem that way from your description), don't worry
> about it.  Just let the auto router do whatever it does.  Most likely the
> signals will get routed via even more convoluted paths than what you
> envision.  Big deal.  It's all handled by computer.  It might make a
> ratsnest, but it won't mess up the connections.  Spend the extra time
> worrying about good grounds instead.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2003\09\14@161143 by John N. Power

flavicon
face
----------
From:   Josh Koffman[SMTP:.....listsjoshKILLspamspam.....3MTMP.COM]
Sent:   Friday, September 12, 2003 6:53 PM
To:     EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU
Subject:        [PIC]: Data Bus Issue

{Quote hidden}

To reverse the bits in a byte, shift the byte to the right and shift a second byte
to the left. After 1 right shift, CY has the LSB of the first byte. Shift the second
byte left and CY ends up as the LSB of byte #2. After 8 shifts, byte 2 has
byte #1 in bit reverse order. If you only want the lower 4 bits of #1, shift 4
times. Use swapf to exchange nybbles if needed.

John Power

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\09\14@175556 by David P Harris
picon face
Hi-
Am I obtuse?  Surely you can run traces between the pins, so that the
like-pins can be joined.
David

John N. Power wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\09\15@000801 by Josh Koffman

flavicon
face
You aren't obtuse. That is what I ended up doing. My question mainly
revolved around not having a bunch of mixed up tracks. Nice straight
ones seemed to me to be less prone to future problems.

In the end, I managed to route it so it worked fine.

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

David P Harris wrote:
> Am I obtuse?  Surely you can run traces between the pins, so that the
> like-pins can be joined.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\09\15@000806 by Josh Koffman

flavicon
face
Brilliant! That's exactly what the kick in the right direction I needed.
Thanks!

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

"John N. Power" wrote:
> To reverse the bits in a byte, shift the byte to the right and shift a second byte
> to the left. After 1 right shift, CY has the LSB of the first byte. Shift the second
> byte left and CY ends up as the LSB of byte #2. After 8 shifts, byte 2 has
> byte #1 in bit reverse order. If you only want the lower 4 bits of #1, shift 4
> times. Use swapf to exchange nybbles if needed.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\09\15@034050 by Jinx

face picon face
> anyone have a routine for reversing the order of bits in a byte?

Josh, dug these out of a far corner of the HDD. I tried them at
the time to get around the same problem as you've got

============================================

From: Dwayne Reid
To: <KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU>
Subject:      Re: Efficient way to reverse a byte?
Date: Saturday, 30 October 1999 06:51

   clrf    dest
   btfsc   source,0
     bsf   dest,7
   btfsc   source,1
     bsf   dest,6
   btfsc   source,2
     bsf   dest,5
   btfsc   source,3
     bsf   dest,4
   btfsc   source,4
     bsf   dest,3
   btfsc   source,5
     bsf   dest,2
   btfsc   source,6
     bsf   dest,1
   btfsc   source,7
     bsf   dest,0

17 instructions, 17 cycles

=========================================

From: Terry A. Steen
Date: Saturday, 30 October 1999 07:22

How about:

    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in
    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in
    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in
    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in
    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in
    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in
    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in
    rlf arg1,1  ;shift out a bit
    rrf arg2,1    ;shift it in

Kind of long, but this should reverge arg1 and store it in arg2. At the
same time, it will also reverse arg2 and store it in arg1

=============================================

From: Russell McMahon
Date: Saturday, 30 October 1999 11:53

The piece of code that Tracy posted (from John Payson) does what it was
originally meant to do BUT is NOT correct for the present problem.

Here we require
76543210 --> 01234567

John's solution is for a 7 bit swap ignoring B7.
ie x6543210 --> x0123456

As a consequence B7 & B3 is untouched and there are only 3 swaps needed
making the code shorter.
Rewriting it for an 8 bit swap as required here, produces -

       movwf   source

       btfsc   source,0
        xorlw  h'81'
       btfsc   source,7
        xorlw  h'81'
       btfsc   source,1
        xorlw  h'42'
       btfsc   source,6
        xorlw  h'42'
       btfsc   source,2
        xorlw  h'24'
       btfsc   source,5
        xorlw  h'24'
       btfsc   source,3
        xorlw  h'18'
       btfsc   source,4
        xorlw  h'18'

17 instructions, time varies depending on data but fairly quick

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...