Shop OBEX P1 Docs P2 Docs Learn Events
Reassembling Bytes — Parallax Forums

Reassembling Bytes

kingnebkingneb Posts: 65
edited 2005-10-15 13:16 in General Discussion
I am sending data two bits at a time over a PC parallal port.· The sx has to reassemble them as a byte.· I know how to assemble a byte from two nibbles, you swap the bits in the first nibble and perform a bitwise·OR·with the first nibble and the second one.· How do you get the SX to·assemble a byte this way?

Thank You

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
All my exes live in Texas


Oh yeah, all my exes are six feet under the ground!!!

One was a lineman who violated the one hand rule.

The·second put his tongue on 10 car batteries wired in series.

The third was involved in a tesla coil experiment gone bad.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-15 12:37
    Are you programming both sides? If yes, why not create a syncrhonous serial connection? So, instead of two data bits and a handshake line you could program the PC side to respond to the signalling for SX/B's SHIFTIN instruction.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-15 13:16
    Of course, you could save youself a gigantic bunch of trouble and use the USB2SER to send serial data to your SX -- if you have a spare USB port on the PC in question. That will be a whole lote easier than attempting to program the parallel port.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.