Trouble starting PIC or internal clock on 12f683?


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Location
    Austin, TX
    Posts
    68

    Default Trouble starting PIC or internal clock on 12f683?

    I am using the program from Walter Dunckel (http://www.scalerobotics.com/stamps/...ssthrough.html). It is unchanged from what's on the web. The PIC doesn't start or the internal clock isn't running. I read the application note on troubleshooting power-up problems, but it still fails. Here is the situation and what I have tried.

    Chip is 12f682, tried two of them.
    Power is 5.19 VDC
    2200uf cap across +5 and GND where it enters the breadboard (tried it without that too)
    1uf cap across pins 1 & 8
    Power up is via switch so the rise time of +5 is fast and without much ring.
    Checked the wiring a half dozen times.
    Originally, the input across the 3 diodes was falling at a long slope so I added a pull-down resistor. Now the receiver pulses look like what Walter shows on his o'scope.
    Tried it with and without a pull-up resistor on pin 4, mclr
    With the given _INTRC_OSC_NOCLKOUT , it never starts, but if I change it to _INTOSCIO I can get it to start very very occasionally.

    By "not starting" I mean there are no output pulses to the servos. All output pins are just low.

    Any thoughts on what else I can check?
    Last edited by ScaleRobotics; - 11th October 2011 at 05:08. Reason: corrected link

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


    Did you find this post helpful? Yes | No

    Default

    Try changing
    Code:
    @ __config _INTRC_OSC_NOCLKOUT  & _WDT_OFF & _MCLRE_ON & _CP_OFF
    to
    Code:
    @ __config _INTRC_OSC_NOCLKOUT  & _WDT_OFF & _MCLRE_OFF & _CP_OFF
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Oops.

    Thanks Dave, and mgauthier711! I will correct that.

    Walter

  4. #4
    Join Date
    Mar 2010
    Location
    Austin, TX
    Posts
    68


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Try changing
    Code:
    @ __config _INTRC_OSC_NOCLKOUT  & _WDT_OFF & _MCLRE_ON & _CP_OFF
    to
    Code:
    @ __config _INTRC_OSC_NOCLKOUT  & _WDT_OFF & _MCLRE_OFF & _CP_OFF
    The only way I can get it to start is with this:

    @ __config _INTOSCIO & _WDT_ON & _MCLRE_OFF & _CP_OFF

    Now that it starts, there is still an issue with it. I get output pulses on servos 2-4, but not on servo1. The pulses that I do get do not vary with the input pulses, they are just 2ms on 3 & 4, and 1.6 ms on 2.

    I'll check to see if there is anything wrong with my setup and wiring again.
    Last edited by PickyBiker; - 24th March 2010 at 17:51.

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    The code does act funny if the input from the pulses exceeds the 1ms to 2ms range. Check your transmitter, and see if you have any channels above 100%. You might try changing them to 95% in both directions, just to make sure.

    Walter

    Edit:
    Do you have the diodes on the three incomming receiver signals?
    Last edited by ScaleRobotics; - 24th March 2010 at 18:07.

  6. #6
    Join Date
    Mar 2010
    Location
    Austin, TX
    Posts
    68


    Did you find this post helpful? Yes | No

    Default

    Yes, the diodes are there and I get good 5v pulses just like on your web page. Current status:

    all channels 85% with 0 offset and 0 subtrim.

    No changes detected in output pulses.

    Could the missing servo 1 pulse be because I have the WDT on? (Remember, it won't start if I set WDT off).

  7. #7
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Sorry to hear that.

    Let me double check what I have when I get home tonight. I will let you know what I have, and double check my wiring to see if I differ from my schematic.

    Thanks for the feedback.

    Walter

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mgauthier711 View Post
    The only way I can get it to start is with this:

    @ __config _INTOSCIO & _WDT_ON & _MCLRE_OFF & _CP_OFF

    Now that it starts, there is still an issue with it. I get output pulses on servos 2-4, but not on servo1. The pulses that I do get do not vary with the input pulses, they are just 2ms on 3 & 4, and 1.6 ms on 2.

    I'll check to see if there is anything wrong with my setup and wiring again.
    I have not had a chance to look at the data sheet but you OSC setting is bothersome.
    That outputs a clock signal I think???
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hello mgauthier711,
    Just saw your post, did you try this with PWRTE on and WDT off? Sometimes these PICs are a little fussy about the power rise curve and the power up timer helps.
    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
    Mar 2010
    Location
    Austin, TX
    Posts
    68


    Did you find this post helpful? Yes | No

    Default Starting reliably now

    Pulling pin 4 to +5v and removing the pull-down resistor from the input allows it to start reliably now with
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_ON & _CP_OFF

    It still only puts out fixed length pulses. If I put the pull-down back in 47k, the output stops. If I add as little as 20pf to the input, the pulses stop. There is improvement however, I now get fixed length pulses on all 4 outputs.
    [ATTACH]Name:  SDC11240.jpg
Views: 1135
Size:  202.9 KB[/ATTACH]
    If the attachment made it, you can see my wirng and the pulses
    Attached Images Attached Images  

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