16F628 acting funny...?


Closed Thread
Results 1 to 4 of 4
  1. #1
    achilles03's Avatar
    achilles03 Guest

    Default 16F628 acting funny...?

    I'm having some trouble programming a 16F628. I'm trying to get it to communicate with my computer via RS232 using the program shown below. I have LED (w/1k res) hooked up to portb.1 to indicate that it's operating. However, when I turn it on, it will sometimes operate for a few seconds and then stop. Then maybe turn back on, etc... ? I've tried it with a 20MHz ex. osc, and the internal osc. I'm powering it from 4 AA bats through a 5V regulator from Radioshack. I also tied portb.4 (low power programming pin) to ground via another 1k resistor, as I understand when portb.4 floats it can act erratically. Can anyone see what I might be doing wrong?

    Thanks,
    Dave

    ________________________________
    INCLUDE "modedefs.bas"
    PORTB=0

    CMCON = 7

    loop: Serout portb.0,T2400,["TACOS"]
    pause 100
    low portb.1
    pause 100
    high portb.1
    Goto loop
    ________________________________

  2. #2
    achilles03's Avatar
    achilles03 Guest


    Did you find this post helpful? Yes | No

    Default

    I think I figured out the problem... I had MCLR floating, and left the MCLR option in the configuration enabled.

    I assumed that if MCLR was enabled and floating, the PIC probably wouldn't work, period. Is that usually what happens with MCLR is left floating and enabled? (i.e. sporadic operation?)

    Thanks,
    Dave

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    If you have not assigned the MCLR pin to internal, example...

    @ DEVICE pic16F628, MCLR_OFF ' Master Clear Options (Internal)

    ...then it has to be tied to Vdd or reset circuitry of some sort. Failure to do so will result in unreliable operation at best, or complete failure at worst.

  4. #4
    Bob_W's Avatar
    Bob_W Guest


    Did you find this post helpful? Yes | No

    Default

    And..... You are going to have more problems shortly. 4 AA batteries = something less than 6 volts into the regulator, which means that the regulator is just barely working - unless you've got a LDO (low drop out) regulator. Either add another AA cell so the input to the regulator is ~7.5 volts, or replace the regulator with a diode - 1N4148, etc. - to drop the 6 volts from the 4 AA cells to about 5.3 volts.

Similar Threads

  1. Are 16f628 and 16f628A difference each other?
    By elektrodam in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th July 2006, 06:20
  2. SERIN2 not working with 16F628
    By d1camero in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 20:37
  3. DTMF Decode with Mitel 8870 & 16F628
    By m0cke in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd March 2004, 07:44
  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 : 1

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