Delay Problem,Byte,Word


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Yes I understand what you mean,but my problem ist that i want to have sometimes values that < as 255 is,for Example 1 Millisecond for My Stepping Motor.

    The Visual Basic Software Work very good,all what I send I receive with my Pic,My only Problem ist that wehn I send this Chr(1) to my Word variable Delay ,dont' Work,wehn I send Chr(1) And I use the Pic Code: Delay1 = (DataIn[3] * 256) + DataIn[4] this work but I need 1 Millisecond for my Stepping Motor.

    Thanks.
    Last edited by Pesticida; - 31st December 2006 at 12:39.

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


    Did you find this post helpful? Yes | No

    Default

    OK, so do a simple test, skip the HSERIN stuff and load the value in the array manually at the top of your code, then redo your tests.

    Also... there's a little mistake here
    Code:
    hserin 10000,MainStart,[WAIT("!"),STR Datain\13]
    Should be
    Code:
    hserin 10000,MainStart,[WAIT("!"),STR Datain\12]
    I think it's on the VB side... just drop the Mscomm1.Output line
    Steve

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

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi,

    This is my Visual Basic Communication Code:

    MSComm1.Output = "!" & Chr(Val(CmbAdresse.Text)) & Chr(0) & Chr(Val(TxtLoop.Text)) & Chr(Val(TxtDelayOn1.Text)) _
    & Chr(Val(TxtDelayOn2.Text)) & Chr(Val(TxtKanal1.Text)) & Chr(Val(TxtKanal2.Text)) & Chr(Val(TxtKanal3.Text)) _
    & Chr(Val(TxtKanal4.Text)) & Chr(Val(TxtKanal5.Text)) & Chr(Val(TxtKanal6.Text)) & Chr(13) & Chr(10)
    Sleep 30

    I need for the moment just Byte CmbAdresse.Text,Byte TxtLoop.Text,Byte TxtDelayOn1.Text,Byte TxtDelayOn2.Text.
    I have 13 Bytes !
    Last edited by Pesticida; - 31st December 2006 at 13:01.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Ok I did what You told me,now I wrote direct too Delay1 = 1.

    But dont work,maybe I can not use a Word variable with Pause when this Values less then 256 is.

    I can not find the Answer.

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


    Did you find this post helpful? Yes | No

    Default

    EDIT: forgive me i was wrong... i'll be back!!!
    Last edited by mister_e; - 31st December 2006 at 13:29.
    Steve

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

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Ok,
    but what I dont understand is why when I write Direct in Picbasic Pro:
    Delay1 = 1

    .......

    High PortC.0
    High PortC.1
    low PortC.2
    low PortC.3

    Pause Delay1

    this dont work,but when i write Pause 1 or when :
    Delay1 var byte
    Delay1 = 1

    .......

    High PortC.0
    High PortC.1
    low PortC.2
    low PortC.3

    Pause Delay1
    This work.
    Last edited by Pesticida; - 31st December 2006 at 13:31.

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


    Did you find this post helpful? Yes | No

    Default

    It's certainely strange dude...
    Wich PIC #
    Wich PBP version?
    Steve

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

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Pic 16F870 and PBP 2.46.

    Maybe is this a Compiler Bug for the Pause Command.
    Last edited by Pesticida; - 31st December 2006 at 13:50.

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