12f675 probably a silly question


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52

    Default 12f675 probably a silly question

    Hi folks,

    I've been using 16f819s for a while now and needed a smaller package for a space restricted installation, so I got a handfull of 12f675s.

    I'm using PBP and the 4.x melabs programmer and putting a 4k7 to vdd for MCLR. Nothing else is being set specifically, except of course intosc, watchdog enabled, brownout enabled and powerup enabled.

    The chip will not start. All I did to test it was put a 220 to a led from GP5, pretty standard test.

    Checked voltages and led wiring and everything is as it should be.

    Is there startup files that need to be included with this chip?

    help?

    Gary

  2. #2
    Kees Reedijk's Avatar
    Kees Reedijk Guest


    Did you find this post helpful? Yes | No

    Default

    I tried this code and that should work:

    'flash that led!
    @ device pic12F675, intrc_osc, wdt_on, pwrt_on, mclr_off, protect_off

    ANSEL = 0
    CMCON = 7
    TRISIO = 0
    GPIO = 0

    LED VAR GPIO.5

    loop:
    Toggle led
    Pause 100
    goto loop

    End

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


    Did you find this post helpful? Yes | No

    Default

    Hi Gary,

    It's hard to tell without the code you're using, but here's something to look at.

    INTOSC, is the same as INTRC_OSC_CLKOUT. Which means that FOSC/4 (1mhz) will be put out on GP4. If you have an o-scope, you can look for this signal to see if the processor is running or not.

    If there is anything attached to GP4, it could also cause the chip to reset from over-current.

    >> I'm using PBP and the 4.x melabs programmer

    Is that 4.1? If so, look at the Code window in meProg.exe. (View | Memory)
    Open the HEX file and press the program button. Now look at location 0000 in the code window. Has it changed?

    There's a bug in that version that sometimes causes the first word to change to 0000h, which makes the program not run. If that's the case, you can download the 4.2 beta from the melabs website.

    Here's a simple blink program for the 12F675...
    Code:
    @  device  pic12F675, intrc_osc_noclkout, wdt_off, mclr_off, protect_off
    
    CMCON = 7
    ANSEL = 0
    
    Main:
        TOGGLE GPIO.5
        pause 500
    goto Main
    <br>

    ADDED: Kees, intrc_osc isn't valid for a 12F675
    DT

  4. #4
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default 12f675

    Thanks guys. It's always something stuipd, and this time is no exception. If you want a GPIO port to be a port, you have to define it as a GPIO.x not portb.x as I am obviously far too accustomed to. Ports were not defined as evidenced by the floating voltage.

    She's avery pretty blinking led!

    Thanks again.
    Gary

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PORTB is already define but leads you to Register addr 6... wich is unimplemented on this PIC

    PORTA is assign to register addr 5, wich is GPIO

    in the above, if you replace GPIO by PORTA, it will work.

    Not a good practice but...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Hmm, never realized PORTA and B were in there.
    That's odd about PORTB pointing to an unimplemented register. It keeps the compiler from finding problems like what Gary had.

    12F675 How do I address thee, let me count the ways.<pre>PORT TRIS<br>-------------<br>GPIO TRISIO<br>PORTA TRISA<br>PORTL TRISL<br>PORTH TRISH</pre>or you can use PIN numbers...<pre>HIGH 5 ; will set GPIO.5 to OUTPUT HIGH<br>or <br>TOGGLE 5</pre>Although a bit strange...

    <pre>TOGGLE 13 ; will also toggle GPIO.5</pre>
    OK, so that's only 6, who's got number 7 ??
    DT

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PORT TRIS
    -------------
    GPIO TRISIO
    PORTA TRISA ' errr... PORTB?
    PORTL TRISL
    PORTH TRISH
    But... for #7, if there's .... euhhh
    Last edited by mister_e; - 20th November 2006 at 02:43.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Extreme Noobie question 12F675
    By Jeff in forum mel PIC BASIC
    Replies: 11
    Last Post: - 22nd September 2009, 01:13
  2. Still 12F675 question
    By F1CHF in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th August 2009, 21:09
  3. 12F675, MPLAB programming question
    By EASY in forum General
    Replies: 0
    Last Post: - 2nd April 2006, 19:28
  4. 12f675 programming question
    By puggy in forum General
    Replies: 3
    Last Post: - 30th November 2004, 23:34
  5. 12f675 internal osc question.....
    By Gabe@SPdFtsh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th January 2004, 06:33

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