PIC12F675 trouble


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    btfss is for testing individual "bits" in a file register.

    You would use btfss _leftCount,1 to test bit position 1 in leftCount. This
    seems like an unnecessary test at any rate since you're clearing leftCount
    at the entry point to your asm routine, and leftCount will always be zero.

    Also be aware that you're only accessing the low bytes in your leftCount
    and dur word variables the way you're when doing it.

    To access the high byte in dur you would use decfsz _dur+1,f. Dur is a pointer
    to the low byte. Adding _dur+1 moves the pointer to the next byte location
    in ram.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    russman613's Avatar
    russman613 Guest


    Did you find this post helpful? Yes | No

    Default

    awesome information - i love it when there is a simple answer.

    thx for the tips and for pointing out my issue. i will try to fix up what you guys have pointed out this evening and retry. also looks like new.txt is worth a closer look.

    any idea why the PIC seems to just hang? I would expect that it would at least toggle the statusLED for me that i've set up before it gets to a piece of bad code. or, am i to expect "unexpected" behavior anytime i muck up the logic anywhere in the program?

    russ

  3. #3
    russman613's Avatar
    russman613 Guest


    Did you find this post helpful? Yes | No

    Default

    awesome information - i love it when there is a simple answer. i had actually meant that line to read:

    btfss gpio, 3;
    incfsz _leftCount, 1 ;23,us - this line causes a problem it seems too.


    thx for the tips and for pointing out my issue. i will try to fix up what you guys have pointed out this evening and retry. also looks like new.txt is worth a closer look.

    any idea why the PIC seems to just hang? I would expect that it would at least toggle the statusLED for me that i've set up before it gets to a piece of bad code. or, am i to expect "unexpected" behavior anytime i muck up the logic anywhere in the program?

    russ
    Last edited by russman613; - 27th February 2006 at 18:49.

Similar Threads

  1. Pic12F675 serial voltmeter
    By GioppY in forum Code Examples
    Replies: 22
    Last Post: - 20th November 2010, 13:20
  2. PIC12F675 problem with port 5
    By NL2TTL in forum mel PIC BASIC
    Replies: 2
    Last Post: - 5th June 2009, 01:23
  3. MCLR causing trouble . .
    By shahidali55 in forum General
    Replies: 10
    Last Post: - 21st December 2007, 12:20
  4. SERIN with a PIC12F675
    By ewandeur in forum Serial
    Replies: 4
    Last Post: - 30th July 2007, 15:04
  5. Erratic PIC12F675 behavior
    By russman613 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th February 2006, 14:46

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