How to send a binary string on an output?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by keithdoxey View Post
    How do you arrive at the values you want to send ?
    I have scanned the signal with a digital scope.

    The output is LOW active. I have split the array to different blocks. Each button if pressed begins with the first string. Look below

    1000000000111110 ' Init sequence (every button)

    110110110110101010110 ' sequence 01

    101011010101010110 ' Instruction for Vol+

    11111111111111111110 ' preparing for 2nd block

    110110110110101010110 ' sequence 01

    101011010101010110 ' Instruction for Vol+

    11111111111111111110 ' preparing for 3rd block

    110110110110101010110 ' sequence 01

    101011010101010110 ' Instruction for Vol+

    and now the signal stay at HIGH till another button is pressed.
    Many blocks like Init sequence, sequence 01, preparing for next block are in all instruction of each button. Only a few bits are different in the instruction line.
    But this String must be sent as one data without interrupts or delays. Exactly from every bit 1ms.
    Every instruction will be sent 3 times.
    When you will paint same blocks in different colours you will better see, how it works. But itīs not possible to mark with colours
    Last edited by Robson; - 25th July 2007 at 23:30.

  2. #2
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Robson View Post
    I have scanned the signal with a digital scope.

    Many blocks like Init sequence, sequence 01, preparing for next block are in all instruction of each button.
    In that case create separate arrays for

    InitSeq
    Seq01
    NextBlock

    Only a few bits are different in the instruction line.
    Create separate arrays for each command or one large array with all commands and just point to a segment of it eg bits 34-57 (havent worked out the numbers!)

    But this String must be sent as one data without interrupts or delays. Exactly from every bit 1ms.
    When you need to send a command just call the component parts as required eg

    SendInitSeq
    SendSeq01
    SendCommand
    SendNextBlock
    SendSeq01
    SendCommand
    SendNextBlock
    SendSeq01
    SendCommand

    The PIC should be able to read and process the values quickly enough not to cause problems, if you see that your output pulses are taking slightly too long then change the pause to pauseus and shorten slightly

    Every instruction will be sent 3 times.
    Just add a loop and go round it 3 times. Presumabley there must be some idle time between the 3 instructions so dont forget to add that as a pause

    When you will paint same blocks in different colours you will better see, how it works. But itīs not possible to mark with colours
    I pasted it into a text editor and broke it into 4 bit chunks and you can see the patterns you refer to.

    I have built a universal remote control that reads different values from different variables on the fly and that works just fine so I doubt you will have too many problems.

    I seem to remember seeing something by either Darryl or Melanie that showed how you can access individual bits of a byte or word array as well but cant remember where it was eg byte0 was bits 0-7 byte1 was bits 8-15 but I could be wrong.
    Keith

    www.diyha.co.uk
    www.kat5.tv

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 21:31
  2. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 15:46
  3. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  4. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 04:46
  5. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 05:39

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts