PIC12F675 trouble


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Hi Russ,

    EDIT - on this line of code...
    BTFSS _leftCount ;23,us <- this line causes a problem it seems too.

    You did not specify which BIT to test - it's also a WORD variable - maybe someone here can answer if BTFSS will work on a WORD??

    OOpps - I thought the 12F's WERE 12-bit core - sorry!
    EndEDIT

    ====

    I have not looked over the rest - but here's a list of unsupported commands fort the 12bit cores:
    from PBP 2.44 'new.txt' file

    Commands that are not supported for the 12-bit core PICmicro MCUs:

    Command Reason
    Adcin No internal ADCs
    Data No on-chip EEPROM
    Dtmfout Not enough RAM or stack
    Eeprom No on-chip EEPROM
    Erasecode No flash devices
    Freqout Not enough RAM or stack
    Hpwm No hardware PWM
    Hserin No hardware serial port
    Hserin2 No hardware serial port
    Hserout No hardware serial port
    Hserout2 No hardware serial port
    On Interrupt No Interrupts
    Read No on-chip EEPROM
    Readcode No flash devices
    Resume No Interrupts
    Serin2 Not enough RAM or stack
    Serout2 Not enough RAM or stack
    USBIn No USB devices
    USBInit No USB devices
    USBOut No USB devices
    Write No on-chip EEPROM
    Writecode No flash devices
    Xin Not enough RAM or stack
    Xout Not enough RAM or stack
    Last edited by Archilochus; - 27th February 2006 at 17:09.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Russ,

    In the MainLoop, the IF (leftcount = duration) will never evaluate true.

    duration is a constant(100), and leftcount never gets assigned anything but 0. Maybe you were thinking that BTFSS would do something, but that means "Bit Test File Skip if Set, so it's looking for a bit number that wasn't specified. Are you trying to test leftcount for a specific value, or trying to set the value?

    Archilochus,

    The 12F675's are actually 14-bit core's. I have no idea why they called them 12's. 12C508's are 12-bit, and the 12F508's are 12-bit, so you would think 12F629/675/683's are too. but, Not!
    <br>
    DT

  3. #3
    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

  4. #4
    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

  5. #5
    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