16f628 for all outputs


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2007
    Location
    Florida, USA
    Posts
    5

    Default 16f628 for all outputs

    I have tried about everything i know to get a 16f628 to blink my led. But to no avail. Is there some special config i need to set to have this action take place? I am just applying power, using the internal osc. set my comparator mode to 7. is there something else i should be doing?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Max_Gauss View Post
    I have tried about everything i know to get a 16f628 to blink my led. But to no avail. Is there some special config i need to set to have this action take place? I am just applying power, using the internal osc. set my comparator mode to 7. is there something else i should be doing?
    Are you using the PIC16F628 or the PIC16F628A?
    There's enough of a difference between the two to keep things from working.
    And post some code, a schematic, something, anything.
    For all I know you've got 3 buckets of grass clippings, 2 rocks, and a jar of mustard.

  3. #3
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Exclamation Does this help?

    Quote Originally Posted by skimask View Post
    Are you using the PIC16F628 or the PIC16F628A?
    There's enough of a difference between the two to keep things from working.
    And post some code, a schematic, something, anything.
    For all I know you've got 3 buckets of grass clippings, 2 rocks, and a jar of mustard.
    Hi skimask,
    Here is a circuit attachment I found online you might find helpful.


    hth
    -Adam-
    Attached Images Attached Images  
    Ohm it's not just a good idea... it's the LAW !

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


    Did you find this post helpful? Yes | No

    Default

    <table><td><img SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1629&stc=1&d=117919107 7"></td>
    <td>
    • Jar of mustard = +5V
    • RCK 1, RCK 2 = Gnd
    • GCB1, GCB2, GCB3 = LED + 330 OHM Resistor
    • PIC16F84 = something that should be removed from the market since 10 years, can happilly be replace by a 16F628. If you do it, remove the crystal + both 22pF capacitor and try the code bellow
    </td></table>
    Code:
    <font color="#000000">        <font color="#008000">'
            '       Pic Configuration
            '       =================
                    '
                    '       Here we will set the PIC configuration fuses
                    '       to use the internal PIC oscillator and disable the MCLR
                    '       pin.
            </font>@ __CONFIG  _INTRC_OSC_NOCLKOUT &amp; _MCLRE_OFF  &amp;  _LVP_OFF &amp; _WDT_OFF &amp; _PWRTE_ON  &amp; _BODEN_ON  
                    <font color="#008000">'
                    '       This assume you're using MPASM to compile your code
                    '       For detailed information about Configuration fuse setting, 
                    '       have a look to &quot;Presetting Configuration Fuses (PIC Defines)&quot; thread
                    '       in the forum FAQ section.
                    '           http://www.picbasic.co.uk/forum/showthread.php?t=543
    
            '                      
            '       Hardware assignment
            '       ===================
            </font>GCB_1   <font color="#000080">VAR </font>PORTB.0
            GCB_2   <font color="#000080">VAR </font>PORTB.1
            GCB_3   <font color="#000080">VAR </font>PORTB.2
                            
            <font color="#008000">'
            '       Hardware configuration
            '       ======================
            </font>TRISB = 0               <font color="#008000">' Configure all PORTB i/o to output
            
            '
            '       Software/Hardware initialisation
            '       ================================
            </font>PORTB = 0
                   
            <font color="#008000">'------------------------------&lt; Main program &gt;-----------------------------------
            '
    </font>Start:  <font color="#008000">'
            '       Here will do the 'buckets of grass clippings' light show
            '       using a simple method... not the best
            '
            </font>GCB_1 = 1
            <font color="#000080">PAUSE </font>500
            GCB_2 = 1
            <font color="#000080">PAUSE </font>500
            GCB_3 = 1
            <font color="#000080">PAUSE </font>500
            GCB_1 = 0
            <font color="#000080">PAUSE </font>500
            GCB_2 = 0
            <font color="#000080">PAUSE </font>500
            GCB_3 = 0
            <font color="#000080">PAUSE </font>500
            <font color="#000080">GOTO </font>Start
            <font color="#008000">'
            '---------------------------------------------------------------------------------
    </font>
    Steve

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

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic_User View Post
    Hi skimask,
    Here is a circuit attachment I found online you might find helpful.

    hth
    -Adam-
    Good answer!
    Oh Man! I near fell outta my chair!

  6. #6
    Join Date
    Apr 2007
    Location
    Florida, USA
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Thank You Gentlemen soo Much

    Thanks be to you all and my Lord Jesus..
    Each one of you have help me and i do so appreciate it. My 628 is now operable, and it is so wonderful.
    This was my problem.
    I was initially programming the 16f84 using MPLAB Assem. with PicStart Plus with upgrade. Then i bought PBP, which is so nice, and i changed to the 16f628. then using MIcroCode Studio i wrote a very simple piece to blink my LED. BUT .. NO blink.. I tried the 16f84.. NO blink.. WOW whats wrong. I tried 45 or 55 times .. NO. blink. I peruse to manuals. I went on internet. I called PBP, You've got to love them for they put up with such as i am. I joined this forum. I wrote the code in MicroCode Studio then selected "compile/Program". It would compile, then started up my MPLAB and leave me in the MPLAB screen. I would select my file. Set my config bits, and select my programmer, then program. There were NO errors, no issues. Also..NO blink. What it programmed into the chip, I have no idea. but it did programm and verify with no errors. What i did WRONG. When PBP brought up my MPLAB and I set my config bits, and selected my programmer.. I DID NOT compile my project in MPLAB.When PBP sends you to MPLAB, YOU have to compile the project. If you do not compile, it will programme something i know not what to the chip, but it will not work.. NOW my LED blinks.. Praise the Lord and thanks to you gentlemen soo much..
    jlittle

Similar Threads

  1. 16F628 does not run. I can't believe this
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd October 2009, 15:41
  2. SERIN2 not working with 16F628
    By d1camero in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 20:37
  3. 16F628 & In-Circuit Programming?
    By Len in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th March 2004, 13:02
  4. 16F628 on-chip eeprom problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 4th March 2004, 07:43
  5. need help configuring 16F628
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd March 2004, 18:59

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