Serial problem between BasicStamp code and PBP code


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    If it is serial communication, I would start by sending a simple text to a PC in Stamp, then do the same in PBP.

    Don't use your entire logic, just "HELLO". It will be much easier to show code here and debug.

    (I can't see your files from my phone)

    Robert

  2. #2
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    Two questions.

    Is there a serial ground connection between communicating modules (Not mentioned in pin assignments notes)

    Is the Bluetooth module receiving commands and outputting serial. Scope checked etc.
    Rob.

    The moment after you press "Post" is the moment you actually see the typso

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    Hi
    Not sure about your code. But when using Basic Stamp syntax for serial. You should place at the top of your code.

    Code:
    Include "modedefs.bas"
    In the back of the Picbasic Pro manual there is a section on the differences between PBP and Basic Stamp.

    Hopefully you can make it work.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    I have tried it with Include "modedefs.bas" and without. The code is not very long. What I need is for someone to look at the 2 files and see if they can tell why it won't work on the PIC. I have both the PIC and the Stamp and FT639 and Bluetooth module on breadboard. When I hook the 2 serial lines to the Stamp I can control the servos. When I remove the two serial lins and connect them to the PIC. it won't work. All the pin configuration is documented in the 2 files. lt appears to be a serial problem. When I power up the circuit it should automatically center both servos. It does with the Stamp but not with the PIC. Hope this helps.

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    You might get more help if you post your code directly. Some may not be able to open those files on mobiles.

    Click GO ADVANCED at bottom right of a new post and use the code tags like this (CODE)...(/CODE) but using [ ].

    My money is on a config.

    What version of PIC BASIC PRO?

    Robert

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    I am new to this. Have never posted before. Am 67 and trying to learn. I am using PBP ver 2.50C. The code files can be opened with notepad they are not very complicated or big. I don't know how to add my code files to a post. When I tried it the first time, it put them at the bottom of the post. The commands go over the air via Bluetooth then serially to BasicStamp then serially to servo controller. Works great. When I try it with the PIC nothing happens. I assume it is a serial problem from PIC to servo controller because it does not need the bluetooth at the start . It first sends centering command serially to servo controller to center servos. That does not happen. I have tried changing serial config from true to inverted the manual also says bit 15 can be for open or driven. Whatever that means.

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    No "NIBs" in pbp only bits, bytes, words & longs. Are you using "Default" configs ? have you gotten an LED to blink? I see NO "DEFINE OSC 4" in your code to tell PBP the pic is operating at 4 mhz
    Are you using a crystal, a resonator or internal RC oscillator? Does you config statement reflect what you actually have ?
    I have tried changing serial config from true to inverted the manual also says bit 15 can be for open or driven. Whatever that means.
    open is an open collector where a pullup resistor pulls the output high whereas driven means an output transistor drives the output high or low.
    Last edited by Archangel; - 4th April 2014 at 07:49.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: Serial problem between BasicStamp code and PBP code

    Thank you for the reply. I had to rewrite the send routines because of the no "NIBS". Yes I am using default configs. I tried DEFINE OSC 4, INCLUDE "bs2defs.bas" and INCLUDE "modedefs.bas. I even tried their new program "meCONFIG" which gave me nothing but errors. I am using a 4 Mhz resonator on a PICBIT-18 board. I have used this board and PIC to blink an LED to make sure my PIC and board were working. The PIC I am using is a PIC16f84 /10 but I assume you can run a 10 Mhz at 4 Mhz with no problems. Thank you for the info on bit 15, good to no. I thought of disabling all interrupts, but don't know if the serial commands use interupts.

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