12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    COOL!!!!
    Progress...

    About future programmers.. I would recommend the PicKit2 over anything else. It is a bit more expensive but worth it.
    http://www.microchipdirect.com/produ...words=PG164120

    In my shop I have a PicKit1, PicStart+, and two PicKit2's. Guess the ones that get used the most..

    I will sometimes build a JDM type circuit into a project if it is something the customer may have to update and they work OK and I have a board I make for kids to learn the basics on so they do have their place but...

    Just my opinion... not trying to start a programmer war.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    I do like the PICKit with it's USB connection, early days but I think I'll stick with them for sure.

    I've a lot of basics to learn in the meantime, any thoughts on how I should structure my learning?

    I'd like to learn how to program the 12F683 to output a binary pattern (xxxx-bin) when a button gets pressed.

    Another thing I'm wondering, does the basic principles of one PIC transfer to others (I'm guessing yes, why re-invent the wheel every time) so learning the 683 chip would be a good place to start for a knowledge base.

    Question after question from me at the moment, I do apologize for that.

    Interesting stuff these PIC's, I can't wait to get a reasonable working knowledge.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Just a thought here.

    Is there a book on programming in PBP basic?

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by LEDave View Post
    Feeling rather pleased with myself this afternoon.
    As well you should be. This is a rewarding hobby. I think you will find much pleasure in it.


    Quote Originally Posted by LEDave View Post
    Just a thought here.

    Is there a book on programming in PBP basic?
    There are lot's of them, the thing is, before you buy, hang out here and learn what they do not tell you first, then get the books and you can make what they teach work. What they do not really tell you, is how to make configs work, this is only important if you want your code to work some books do not bother to explain Port and TrIS register settings, and spend 12 chapters explaining how to install MPASM. Others are so old, they are explaining how to use 16C series, most use 16F84. There is a reason for that. 16F84 has nearly no bells and whistles, and consequently no special function registers like ANSEL, CMCON, CMCON1,CMCON0 ADCON PCON . . . . Easier for the beginner, but at a cost, old chips cost more. John Iovine has a few PBP books and his are not too bad, above exclusions aside. Chuck Hellebuyck, I think has a couple, and you MAY be able to order with a PICKIT2 with demo board, though I am not positive about that. Correct me if wrong Chuck. There ARE others, but I would probably try those first. Still waiting for BRUCE's book, I betcha it will be great, and I am sure HE won't forget to explain the configs either.
    Last edited by Archangel; - 19th February 2010 at 23:47.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    COOL!!!!
    Progress...

    About future programmers.. I would recommend the PicKit2 over anything else. It is a bit more expensive but worth it.
    http://www.microchipdirect.com/produ...words=PG164120

    In my shop I have a PicKit1, PicStart+, and two PicKit2's. Guess the ones that get used the most..

    I will sometimes build a JDM type circuit into a project if it is something the customer may have to update and they work OK and I have a board I make for kids to learn the basics on so they do have their place but...

    Just my opinion... not trying to start a programmer war.
    Ha, no war, I paid 8 bucks for my first JDM, that's why I bought it. It works, but I prefer MY PICKit2 over it. I think as cheap as they are it is worthwhile to have as a backup.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    Another thing I'm wondering, does the basic principles of one PIC transfer to others (I'm guessing yes, why re-invent the wheel every time) so learning the 683 chip would be a good place to start for a knowledge base.
    Yes, pretty much all are the same. Some of the registers are different but once you learn one or two chips... The 683 is fine for learning. When you get a full copy of PBP give the 16F676 a try for the next one.
    Question after question from me at the moment, I do apologize for that.
    Ask all of the questions you want. That is what the forum is for. Several come here looking for a copy/paste solution. You are not so ask away.
    I've a lot of basics to learn in the meantime, any thoughts on how I should structure my learning?
    Do not buy any books!!!! Exception would be the one Bruce is working on.
    I will try to be nice, but the bozos currently with PBP books are just robbing newbees. They basically copy the PBP manual and some of the examples from Melabs web site. If one of the authors started posting here like Bruce does then I would have a different out look. For now I will say they are trying to make a fast buck.
    The only place to get real info on PBP is from this forum and the folks like Darrel, Bruce and Melanie.

    You are on the right track.
    Start with "blinky" then move on to push buttons. Basic I/Os.
    The PICkit1 is forcing you to learn about TRIS so that is covered. Try making the LEDs on that board do what you want with HIGH/LOW commands...

    Next would be LOOPS. FOR/NEXT WHILE/WEND, flow control.

    Then work on some simple serial stuff, have to have a way to "talk" to your chip.
    Start with SERIN2/SEROUT2. Send data to a PC to display on a terminal. The send data to the chip that would replace a button.

    Then start playing with on-board ADC and other hardware things.
    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

    Thanks for that you two, I really appreciated your help and offers of future help.

    I guess part of my problem is I'm not strong in any one area. The last time I did any programming in Basic was using my ZX Spectrum (that dates me lol) and my electronic knowledge is pretty basic and patchy. That said I'm very interested and willing to spend time trying to learn.

    It'll be interesting to see how I get on, hey in a few Months a Year or two people could be saying "If LEDave can do it there's hope for anyone".

    So: More studying of TRISIO / GPIO followed by HIGH / LOW then a LOOP then a push button..........!

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    This has taken me ages, it's a modification to Joe's program he posted earlier in the thread (with some of mackrackit's mixed in for good measure) plus some of mine.

    The thing is this: Is this a valid program in that GPIO.4 goes high & low and lights the LED due to the: THEN GPIO.4 = 1 / LET GPIO.4 = 0 program statements? I'm not sure if I've made another little bit of progress here, or just lucked in (the right LED does blink).

    When you guys have a minute could you check it out please.

    GPIO = %00000000 ' set all outputs low
    TRISIO = %11001111 'Set GPIO.4&5 to input
    CMCON0 = %00000111 'Disable analog comparators
    ANSEL = %00000000 'disable analog select so ports work as digital i/o

    main:
    PAUSE 3000
    IF GPIO.5 = 0 THEN GPIO.4 = 1 'turn it on by making pin 4 high +5V
    pause 500
    LET GPIO.4 = 0 'turn it off: Pin 4 goes low 0V
    goto main ' Loop

    end

    Cheersave
    Last edited by LEDave; - 21st February 2010 at 19:37.

  9. #9
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Good Morning Dave,
    I machine a LOT of magnesium, which is done dry. Here is the code for
    a little device to keep the chips away. It is presently ported to your
    PICKit1 (Thanks BRUCE !). This will flash D7 on your board according to how you adjust the little Pot .
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF 
    '   *   *   *   *   * PIC12F675 *   *   *   *   * PICKit 1 Demo board
        PCON = %00000011    ' BOD off, No POR flag set
    DEFINE  NO_CLRWDT 1
    DEFINE  ADC_CLOCK 1
    
        OSCCAL = %1111100   ' SET OSC TO MAXIMUM SET OSC TO 4 MHZ INTERNAL
        CMCON   = 7	        ' Disable Analog Comparators
        ANSEL   = 1         ' Disable A/D module, all digital except AN 0
        WPU.4 = 0           ' Disable weak pull up on GPIO.4
        
        B0    VAR word         ' Byte holds 0 - 255 Word 0 - 65535
        
        
        OPTION_REG = %11111111 ' Dis/Enable internal pull-ups Bit 7
                               ' Bits 0-2 prescaler 
                               ' Bit 3 prescaler assignment 1 = WDT 0 = TMR0
                               ' Bit 4 TMR0 source edge select bit
                               ' 1 trigger on High to Low 
                               ' 0 trigger on Low to High
                               ' Bit 5 TOCS TMR0 clock source select
                               ' 1 = transition on GP2
                               ' 0 = internal clock (CLKOUT)
                               ' Bit 6 INTEDG Interrupt Edge Select
                               ' 1 = Interrupt on rising edge GP2
                               ' 0 = Interrupt on falling edge GP2
                               ' Bit 7 Pullup resistor enable bit
                               ' 1 = disabled 0 = enabled by individual port 
                               ' latch values.
    
    
        
    
        
    Main:
    Adcin 0,B0
    b0 = (b0 * 10)
    gpio.2 = 0
    TRISIO = %11111001
    GPIO.1 = 1
    pause B0
    GPIO.1 = 0
    pause 500 
        
    GOTO Main
    
        END
    you should be able to compile with the demo version, you have. Configs set for MPASM Assembler.
    Last edited by Archangel; - 22nd February 2010 at 05:17.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  10. #10
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Here is some code to do most of what your pic was originally programmed to do.
    I think it will run on the demo, if it is too long then just comment out the last couple of statements in the main.
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
    'DEFINE OSC 4
    'DEFINE ADC_CLOCK 1
    'OSCCAL=%10000000
    'GPIO = 0 ' set all outputs low
    TRISIO = %00000001 'Set GPIO.0 to input
    cmcon = 7 'Disable analog comparators
    ANSEL = 1 
    'PCON =  %00000011    ' Bit 0 BOD 0=on 1=off bit 1 POR 0=on 1=off
    ADCON0 =%00000011   ' SET CHANNEL 0 RT JUSTIFIED VREF - VDD
                        ' BIT 7 1 LT JUSTIFY 0 RT JUSTIFY
                        ' BIT 6 1 = VREF 0 = VDD
                        ' BIT 5:4 UNIMPLEMENTED
                        ' BIT 3:2 00 CH 0
                        '         01 CH 1
                        '         10 CH 2
                        '         11 CH 3
    
    
    DELAY VAR WORD
    
    main:
    ADCIN 0,DELAY
    DELAY = (DELAY * 4)
    TRISIO = %11111001
    GPIO   = %00000010 'LED 7 ON
    PAUSE DELAY
    GPIO   = %00000100  'LED 6 ON
    PAUSE DELAY
    TRISIO = %11011011
    GPIO   = %00000100  'LED  5 ON
    PAUSE DELAY
    GPIO   = %00100000  'LED4 ON
    PAUSE DELAY
    ADCIN 0,DELAY       ' RECHECK A/D AND RECALIBRATE
    DELAY = (DELAY * 4)
    TRISIO = %11101011
    GPIO   = %00000100  ' led 3 ON
    PAUSE DELAY
    GPIO   = %00010000   'led 2 ON
    PAUSE DELAY
    TRISIO = %11001111
    GPIO   = %00100000
    PAUSE DELAY
    GPIO   = %00010000
    'PAUSE DELAY
    goto main
    After you play with these you may be ready to order PBP. Then you can UnComment the rest of this code.
    Last edited by Archangel; - 22nd February 2010 at 05:15.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  11. #11
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Good Morning Dave,
    I machine a LOT of magnesium, which is done dry. Here is the code for
    a little device to keep the chips away. It is presently ported to your
    PICKit1 (Thanks BRUCE !). This will flash D7 on your board according to how you adjust the little Pot .
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF 
    '   *   *   *   *   * PIC12F675 *   *   *   *   * PICKit 1 Demo board
        PCON = %00000011    ' BOD off, No POR flag set
    DEFINE  NO_CLRWDT 1
    DEFINE  ADC_CLOCK 1
    
        OSCCAL = %1111100   ' SET OSC TO MAXIMUM SET OSC TO 4 MHZ INTERNAL
        CMCON   = 7	        ' Disable Analog Comparators
        ANSEL   = 1         ' Disable A/D module, all digital except AN 0
        WPU.4 = 0           ' Disable weak pull up on GPIO.4
        
        B0    VAR word         ' Byte holds 0 - 255 Word 0 - 65535
        
        
        OPTION_REG = %11111111 ' Dis/Enable internal pull-ups Bit 7
                               ' Bits 0-2 prescaler 
                               ' Bit 3 prescaler assignment 1 = WDT 0 = TMR0
                               ' Bit 4 TMR0 source edge select bit
                               ' 1 trigger on High to Low 
                               ' 0 trigger on Low to High
                               ' Bit 5 TOCS TMR0 clock source select
                               ' 1 = transition on GP2
                               ' 0 = internal clock (CLKOUT)
                               ' Bit 6 INTEDG Interrupt Edge Select
                               ' 1 = Interrupt on rising edge GP2
                               ' 0 = Interrupt on falling edge GP2
                               ' Bit 7 Pullup resistor enable bit
                               ' 1 = disabled 0 = enabled by individual port 
                               ' latch values.
    
    
        
    
        
    Main:
    Adcin 0,B0
    b0 = (b0 * 10)
    gpio.2 = 0
    TRISIO = %11111001
    GPIO.1 = 1
    pause B0
    GPIO.1 = 0
    pause 500 
        
    GOTO Main
    
        END
    you should be able to compile with the demo version, you have. Configs set for MPASM Assembler.
    Here is the hex:
    Code:
    :020000040000FA
    :1000000052280F39A0000310A00DA00D1F08E039E1
    :10001000200401389F000030A100323023209F14BB
    :100020009F181028A1011E084D28A301A200FF302F
    :10003000A207031CA307031C4D280330A100DF30D7
    :1000400023201728A101E83EA000A109FC30031CD1
    :100050002C28A00703182928A0070000A10F292891
    :1000600020183228A01C362800003628080010303E
    :10007000A800A101A001A70CA60C031C452822087A
    :10008000A00723080318230FA107A10CA00CA50C9F
    :10009000A40CA80B3B2824084D28831303138312B8
    :1000A00000000800831603308E007C30900083121D
    :1000B00007309900831601309F001512FF30810030
    :1000C000831200300120B8002108B9003808A600CA
    :1000D0003908A7000A30A200A3013720B80025087C
    :1000E000B90005118316F93085008312851439088B
    :1000F000A3003808162085100130A300F430162024
    :0601000061286300812864
    :02400E00D43F9D
    :00000001FF
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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