Delay Problem,Byte,Word


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Just to mix some brains

    Quote Originally Posted by HenrikOlsson View Post
    Say you want a 1000mS delay. Since 1000 wont fit in a byte you'll use two bytes. 1000 in binary is 00000011 11101000 so DataIn[3] = 3 and DataIn[4] = 232.
    Or the cryptic way...
    Code:
    @ MOVE?CW 1000, _DataIn+3
    But, in this case DataIn[3]=232 AND DataIn[4]=3, no big deal...

    Or the easier way:
    Delay1.HighByte = DataIn[3]
    Delay1.LowByte = DataIn[4]
    With my example, you'll use...
    Code:
    @ MOVE?WW _DataIn+3, _Delay1
    TADA!
    Last edited by mister_e; - 31st December 2006 at 14:37.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    This mean thet when I want to have One Millisecond i need to put in my DataIn[3] = 0 and DataIn[4] = 1 or I make again a Mistake ?! :-)

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thanks,
    Your Code work very well but just when my values > 255 is.

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. RF Transmitter
    By et_Fong in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2005, 16:34
  4. Memory Space of the PIC16F84...
    By Tear in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st July 2005, 19:55
  5. Problem with saving to EEPROM...
    By Tear in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st July 2005, 00:10

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