Serial problem between BasicStamp code and PBP code


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    Problem solved. Added PAUSE 5 after each command sent in intialize subs setup: setpulse: setheader: and setactive: and works like a charm. Going to have a glass of wine. My guess is that in the BasicStamp code the interpreter takes a while but the PIC code needs no interpretation and therefore executes faster which was to fast for the FT639. By giving the chip time before the next instruction works. Thanks to all who tried to help. Much appreciated.

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    glad you got it to work .
    the pan_and_tilt2 as posted still looks wrong to me the moves should look like this

    move1:
    Lbyte = (position1 & %00001111) 'servo 0 + lownib
    Hbyte = %10000000 |( (position1 & %11110000)>>4) 'servo 0 + highnib
    SEROUT2 serial_out,baud1,[Lbyte,Hbyte] 'send command to FT639
    PAUSE 100
    RETURN

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    You are correct. I modified the code to the following a few days ago.
    Move1:
    interim = position1 & %00001111
    Lbyte = interim | %00000000
    interim = position1 & %11110000
    Hbyte = (interim >> 4) | %10000000

    Your's look more compact I think I will change mine. Thanks. I'm learning.

Similar Threads

  1. Zero-error 1 second Timer code for PBP?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th June 2013, 14:31
  2. pbp code
    By samixta in forum PBP Wish List
    Replies: 2
    Last Post: - 2nd July 2011, 20:53
  3. pbp code for DS3234
    By itsssyam in forum General
    Replies: 2
    Last Post: - 23rd December 2009, 10:31
  4. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  5. Changing Swordfish code to PBP
    By Ron Marcus in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th April 2008, 01:28

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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