12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Couldn't get it to compile, I had:

    Symbol not previously defined Ansel (I had five of these).

    And one: Overwriting previous address contents.

    ANSEL is analogue select right? It's my understanding that your:

    ANSEL = %00000000 code line makes all the pins read in digital, or turn any analogue input off (I think) so can't understand a problem here.

    Also: CMCON = %00000111 puts out decimal 7 which turns the comparitor off? Is that right? This instruction didn't seem to cause a problem.

    Could all this be because the 16F676 PIC wasn't listed when I compiled it? It wasn't in the demo version drop down list.

    Plenty of head scratching going on here, great fun all though, I'll be glad to figure the basics out.

    Dave
    Last edited by LEDave; - 18th February 2010 at 22:41.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What PIC did you pick from th drop down?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    12F683 The nearest one to the 12F675 (probably doesn't work like that does it?).

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This compiles for the 12F683. May not be the correct pins to do the expected, I did not check that.
    Code:
        ANSEL = %00000000
        CMCON0 = %00000111
        
        START: 
        'D0 HIGH
        GPIO = %11001111
        GPIO = %00010000
        PAUSE 500
        'D1 HIGH
        GPIO = %11001111
        GPIO = %00100000
        PAUSE 500
        'D2 HIGH
        GPIO = %11101011
        GPIO = %00010000
        PAUSE 500
        GOTO START
    ANSEL is for turning the ADC on or off. Not clear why it gave an error.
    The CMCON should have though.
    "Overwriting previous address contents" is because I had the fuses set in code and the fuses commented out in the *.inc.
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    Now for some data sheet reading
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Is there a set of code instructions for THE PBP demo version?

    I'm trying to get an understanding of GPIO and the register TRISIO. If you set a TRISIO bit low you make the corresponding GPIO pin an output (I think) Except GP3 which is always an INPUT.

    I've got a very blurred picture of how this all fits together, one day the fog will lift.... I hope.

    Dave

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    http://www.melabs.com/resources/index.htm#Manuals
    http://melabs.com/products/pbpis.htm
    I'm trying to get an understanding of GPIO and the register TRISIO. If you set a TRISIO bit low you make the corresponding GPIO pin an output (I think) Except GP3 which is always an INPUT.
    Now I see a mess up in my last code
    Code:
        GPIO = %11001111
        GPIO = %00010000
    should be
    Code:
        TRISIO = %11001111
        GPIO = %00010000
    I think.....
    Sorry about that.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit

    Yes I ran that code and it compiled with no errors.

    I loaded the HEX code (confirmed write successful) but the LED's didn't light?

    I reloaded you earlier HEX file and all three LED's jogging along nicely.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Yup, different code for different PICs.
    When do your 12F683s arrive?
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    I changed the code from GPIO to TRISIO

    RE-compiled, re-loaded the HEX code file and away she ran.....!

    Time for me to pause here mackrackit. I need to break your program down and figure out exactly what's going on. That way I can move on.

    I'll try and figure it out and if you'd be so kind you can tell me how I got on.

    It's the only way for me to learn.

    As ever thanks for your help.

    Dave

  10. #10
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I'll try and figure it out and if you'd be so kind you can tell me how I got on.

    I like it when someone wants to learn.
    I will be here....
    Dave
    Always wear safety glasses while programming.

  11. #11
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    The 12F683's arrived today! I didn't order them until late last night, talk about service, I love the internet....:-)

    I changed the 12F675 PIC over to a 12F683 and it ran your program a treat.

    I've got a lot to learn still, a huge amount but really enjoying it.

    My first project (I'm getting ahead of myself here I know) but my first project will be to make a 12F683 OUTPUT binary coded decimal four bit words and drive a seven segment display. I figure with the 12F683 having six outputs this is a viable project.

    Dave

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