PBP projects for R/C models


Results 1 to 40 of 772

Threaded View

  1. #11
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    Regarding the blocking commands. All I want to know is which ones block TMR1 and hence TMR1 based interrupts? Judging from my LOGIC TOOL images PULSIN blocks. True?
    I thought I read somewhere that most of the commands which involve time, like Pulsin, Pulsout, etc, use timer1. But I can't find anything documenting that. Maybe someone can correct this for me? I did a little testing, and if you put your 20 ms timer on Timer2, it will be unaffected by pulsout, and I expect pulsin as well. These blocking commands DO NOT block an interrupt. For instance, you can have a pause 10000 in your main, while an interrupt gives you a heartbeat LED indication every second. But they will interfere if they are trying to load the same timer with a value.

    EDIT: Turns out I was way off base here. Here Darrel corrects me:

    The only PicBasic command that uses a timer is HPWM, which uses Timer2.
    No PBP commands use Timer1 unless you tell it to.

    And all PBP commands are blocking (while they execute).
    They might interface with harware peripherals that are doing other things at the same time, but the statements themselves are blocking.

    As you pointed out though, they don't block interrupts.
    And it's the commands that do software based timing that get disturbed by the interrupts.
    PAUSE, PULSIN/OUT, RCTIME, SEROUT/IN(2) etc.
    They stop keeping time while the interrupt code executes, so all that time gets lost.

    When using interrupts, you should use Hardware Timers to do things like PAUSE or PULSIN, and the USART instead if SEROUT/IN(2).
    And when not using interrupts, use the easier versions (PBP), or still use the hardware which are the NON-BLOCKED functions.

    You can do PULSIN with the CCP module at the same time you're sending serial data to a PC without any interrupts.
    Last edited by ScaleRobotics; - 27th November 2010 at 06:48.
    http://www.scalerobotics.com

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 11:26
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 16:24

Members who have read this thread : 1

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