Timer 1 kills PIC


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    10

    Default Timer 1 kills PIC

    Hi All,

    I am using a PIC 16F628A, PicBasicPro and an MELABS serial programmer. When I start playing with timer 1, I killl the PIC. I can erase and read, but not reprogram. I know it is in the T1CON register, and I see poast relating to this issue, but I cn't seem to find out specifically what I am doing wrong. Here is what I think is relavent in the code:

    @ DEVICE HS_OSC,MCLR_ON,LVP_OFF,WDT_OFF,PROTECT_OFF
    T1CON = %00001010

    T1CON.0 = 1
    pause 100
    T1CON.0 = 0

    I see something about giving he timer time to start up, so a pause at the very begining of the program? I also see something about OSC settings, should I be using the internal OSC @ 4mHz, even though am clocking the chip @ 20mHz?


    Is there anyway to salavge the chips?

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


    Did you find this post helpful? Yes | No

    Default

    I doubt that it's related to Timer1.
    I use Timer1 all the time and have never had a similar problem.

    I would suspect LVP (Low Voltage Programming) RB4.

    What do you have attached to RB4?
    It should be connected to something that provides a LOW voltage on power-up.

    When the chip is erased, LVP is automatically enabled.
    If the pin is left floating or has a HIGH level on the pin, the chip will not program anymore.

    Placing a resistor from RB4 to ground will solve the problem...
    If that is the problem.
    Added: Are you using an external crystal for Timer1?
    T1CON = %00001010 enables Timer1's External oscillator, and those pins are also the clk and data pins for ICSP.
    The programmer may have problems if there's a crystal attached.
    <br>
    Last edited by Darrel Taylor; - 11th January 2009 at 23:25. Reason: Added:
    DT

  3. #3
    Join Date
    Jan 2009
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Nothing is attached to RB4, other than the programmer. I'll add a 10k pulldown. I do have a resonator attached to the clock pins. The funny thing is it happened to two chips, add the T1CON line and boom, it refuses to program. I'll go try your suggestions.

    Thanks!

    EDIT: Just recovered both of the chips. I plugged them directly into the programmer. Thanks, now at least I can figger out what is going on without destroying chips.

    Thanks again!
    Last edited by jpeakall; - 12th January 2009 at 04:13.

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  2. 32 bit square root
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 6th May 2009, 03:37
  3. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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