Trouble starting PIC or internal clock on 12f683?


Closed Thread
Results 1 to 22 of 22

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

    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.

  2. #2
    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

  3. #3
    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.

  4. #4
    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.

  5. #5
    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).

  6. #6
    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

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


    Did you find this post helpful? Yes | No

    Default

    Thanks Walter.

    In my circuit, I needed a pull-down resistor for pin 5. Without it the trailing edge of each pulse was badly sloped. It could be just a difference between our receivers, mine is a Spektrum AR6000.

    Best,

    Mike

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


    Did you find this post helpful? Yes | No

    Default

    Mine were a little sloped as well. But when I tried to add a resistor, it dropped the voltage down too much for it to detect a pulse. I suppose they would all slope equally, so it should not change things too much. Or, a transistor could be added to boost the voltage.

    I did notice that I had my MCLRE_ON on my circuit, but did not show it on the schematic. But you can sort of see it in the picture, with the red wire:


    I used
    Code:
    @ __config _INTRC_OSC_NOCLKOUT  & _WDT_OFF & _MCLRE_ON & _CP_OFF
    I will test with an extra receiver or two tonight, but you might try changing the osc setting, and MCLRE to what I have above, tying MCL to high, and using no resistors for the receiver in on pin5.

    Walter

  9. #9
    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.

  10. #10
    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.

  11. #11
    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: 1194
Size:  202.9 KB[/ATTACH]
    If the attachment made it, you can see my wirng and the pulses
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    I compiled the program I had on the website, and it ran correctly for me. A couple things I notice that are different. The diodes you are using look to be different than the small diodes I used, the 1n914. The scope seems to show this difference on the input signal, as the channels never quite get back to zero voltage, although they do get pretty close. I would try the 1n914's if you have them. If not, try just inputting a single channel with and without the diode, and see what it looks like on the scope. It will still output a single channel (as servo 3). If this is the issue, a single channel without the diode should work.

    I have also included a hex file, just in case there is a difference there. I used Darrels latest DT_INTS version 1.00 for mine, but it seems like the old version would have worked as well.

    1.00 can be found here: http://darreltaylor.com/DT_INTS-14/intro2.html

    I tried it on a FMA FS8 Co-Pilot, and a Hi-Tech Electron 6 receiver.
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    Thanks for the information. I'll pick up some 1N914's and see if that's the problem.

    Best,

    Mike

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