Shop OBEX P1 Docs P2 Docs Learn Events
I made a stupid — Parallax Forums

I made a stupid

M. K. BorriM. K. Borri Posts: 279
edited 2008-09-17 04:50 in Propeller 1
I made a major stupid, and misdesigned a pcb -- basically I have a OV6620 camera with the Y lines feeding into the propeller's first i/o pins.

Problem is, they're backwards!

So now I have Y7 going into pin 0, Y6 going into pin 1... Y0 going into pin 7.

In assembly, how would I swap the bits?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://forums.parallax.com/showthread.php?p=650217

meow, i have my own topic now? (sorta)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-17 03:20
    Use the REV instruction. It reverses the specified number of least significant bits in the destination register and zeros the rest.
  • M. K. BorriM. K. Borri Posts: 279
    edited 2008-09-17 04:05
    so I'd go

    rev IMadeAStupid, #24 wr


    and that's it? one asm instruction?


    wow.... lucky me @_@


    thankyou so very much.... will try it!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://forums.parallax.com/showthread.php?p=650217

    meow, i have my own topic now? (sorta)
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-17 04:50
    Yeah, one instruction ... only 50ns at 80MHz.

    The "wr" is on by default. Shift instructions always write the result unless "nr" is specified.
Sign In or Register to comment.