Picbasic Pro Demo assembly errors


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default TRIS 1 = input, 0 = output

    There is an error in the code that is masked by your HIGH & LOW commands later on.

    TRISB = %11110000 sets port bits 7-4 as INPUTS and port bits 3-0 as OUTPUTS. This is opposite to what you are trying to do.

    The HIGH xxxx and LOW xxxx over ride the TRIS statement and force the selected pin to an output. If you later need more code space and use Portb.7 = 1 instead of HIGH PortB.7 to save a few bytes it will all crash.

    In the current implementation you do not need the TRISB statement so either fix it or scrap it.
    You can reduce code size by using the TRISB statement followed by
    PortB.n = 1 or PortB.n = 0

    HTH
    BrianT

  2. #2
    Join Date
    Dec 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Wink

    Hi BrianT,

    I guess you didn't read the post by Acetronics who told me (essentially) the same thing -problem corrected, thank you very much. In addition, I had replied back to my own post and said "Works like a charm now". Given that, why did you think I hadn't gotten it fixed - that is, unless you hadn't realy read the entire thread!

    Don't get me wrong, I appreciate the help, but I usually need to be told only once (unless it's by my wife - she says it takes her telling me three times before it really sinks in!)

    Anyway, thanks!

    Mike

Similar Threads

  1. PicBasic Pro Demo
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th August 2009, 19:10
  2. Replies: 3
    Last Post: - 1st July 2008, 21:07
  3. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 18:31
  4. Question for all that use MELABS PICBASIC PRO
    By oskuro in forum Off Topic
    Replies: 2
    Last Post: - 24th March 2005, 17:15
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

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