Index a bit through a portion of a port


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Location
    Waco, Texas
    Posts
    151


    Did you find this post helpful? Yes | No

    Default Re: Index a bit through a portion of a port

    Wow, so simple. This is MUCH better than what I started with. However, the LEDs do come on one at a time until they are all on. Then they go off one at a time untill all are off.I understand what you said and are doing by using the logical NOT.Is there a way to turn on only onle LED at a time? eg, 1st packet = LED1 on and all others are off, 2nd packet in=LED2 on and all others off, 3rd packet=LED3 on all others off, 4th packet =LED4 on and all others off, 5th packet=LED1 on all others off, etc??BTW, solved my CRC16 issue - it now works!Thanks again Darrel.
    "If we knew what we were doing, it wouldn't be called research"
    - Albert Einstein

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Index a bit through a portion of a port

    Code:
    LED1 = !!(packetRcvd=1)
    LED2 = !!(packetRcvd=2)
    LED3 = !!(packetRcvd=3)
    LED4 = !!(packetRcvd=4)
    DT

  3. #3
    Join Date
    Sep 2007
    Location
    Waco, Texas
    Posts
    151


    Did you find this post helpful? Yes | No

    Default Re: Index a bit through a portion of a port

    It added it but ALL the LEDs came on. What I added was (can't seem to master the code posting.....) I added LED1=!!(pkt_cntr=1) and so on.
    "If we knew what we were doing, it wouldn't be called research"
    - Albert Einstein

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Index a bit through a portion of a port

    Quote Originally Posted by ecoli-557 View Post
    It added it but ALL the LEDs came on.
    Do your LED's go to ground or VDD?

    If they go to VDD, only use 1 "!"
    Code:
    LED1 = !(pkt_cntr=1)
    LED2 = !(pkt_cntr=2)
    LED3 = !(pkt_cntr=3)
    LED4 = !(pkt_cntr=4)
    DT

  5. #5
    Join Date
    Sep 2007
    Location
    Waco, Texas
    Posts
    151


    Did you find this post helpful? Yes | No

    Default Re: Index a bit through a portion of a port

    Thanks, They are pulled up to +5v via 1K. I just tried the single '!' and none light.The base address and offset I understood, the suggestion LED1 = !(pkt_cntr=1) and so on I do not understand. Care to enlighten?
    "If we knew what we were doing, it wouldn't be called research"
    - Albert Einstein

  6. #6
    Join Date
    Sep 2007
    Location
    Waco, Texas
    Posts
    151


    Did you find this post helpful? Yes | No

    Default Re: Index a bit through a portion of a port

    Darrel-Your add DOES work. SOmehow my variable 'pkt_cntr' is getting weird values like $94, $46, $19, $C0. Strange for such a simple counter.I will continue to look into it.I would like to fully understand the command 'LED1 = !(pkt_cntr=1) so I can learn.....Thanks and Regards,Ecoli-557
    "If we knew what we were doing, it wouldn't be called research"
    - Albert Einstein

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Index a bit through a portion of a port

    Yes, it does work.
    But you seem to come to those conclusions while I'm working on something to prove it.
    That's twice now today.

    >> .I would like to fully understand the command 'LED1 = !(pkt_cntr=1) so I can learn
    Think about it. Then tell me how it works.


    DT

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