A Defines Request


Closed Thread
Results 1 to 23 of 23

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 Re: A Defines Request

    Ok, so you are new to gleaning info from a data sheet. They can be overwhelming at times. But things like connecting power should be pretty straight forward. That is why I mentioned the data sheet.

    Code:
    ADCON1 = 15               ' Set all I/Os to Digital      
    CMCON = 7                 ' Disable Comparators
    Is what you will need to add near the beginning of your code.

    BTW, who do I address suggestions for improving PIC Basic Pro to?
    It is obvious you are new to PBP so how can you say it needs improvement?
    Dave
    Always wear safety glasses while programming.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    Tris Registers?

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


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    Quote Originally Posted by mark_s View Post
    Tris Registers?
    The OP needs to learn about those also, but if I am not missing something his code is using commands that set TRIS in the background.
    Dave
    Always wear safety glasses while programming.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    Quote Originally Posted by mackrackit View Post
    The OP needs to learn about those also, but if I am not missing something his code is using commands that set TRIS in the background.
    Dave,

    Did not realize that. thanks.

    But, I always set them even if it's not needed.

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


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    Quote Originally Posted by mark_s View Post
    But, I always set them even if it's not needed.
    That is good practice along with good code comments. It does not hurt a thing.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    You can follow the same topic here How do I learn configuration?
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  7. #7
    Join Date
    Feb 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    Dear Dave,

    Attached is the latest program. I did add the suggested capacitor between the +-5 supply lines. Somehow I smoked a regulator and PIC trying it. I got new chips and retried our program to flicker the LEDs and that worked fine. I tried the attached program (with your suggested OSC 48 configs ADCON1 and CMCON plus the OSCCON from the LED program) . It sounded like it was driving the valve coil but the 5VDC regulator started to smoke then it settled down and looked ok with one LED lit except the program, the same as the one which works on the stamp, didn't change anything when the POT was turned. Eventually I reloaded the program to make sure I hadn't fried the PIC chip and tried it with a new regulator. This time all three LEDs were on bright and the regulator shot a bit of plastic (about half the front) and hit me in the stomach. Any suggestions?

    With assistance from the other forum I located the Bits section and saw the config table. I wonder why the stuff they specify such as config1L PLLDIV has extra syntax like _CONFIG1L, _PLLDIV_1_1L and similar for all specified bits. Where is that documented?

    Also, your ADCON1 'Set all I/O's to Digital and CMCON 'Disable Comparators would seem to turn off the analog function needed on pin 2 aka. PORTA.0 which is supposed to read a Pot and Capacitor for the RCTIME command. Could that have anything to do with blowing up the regulator? I'll try it without after posting this.

    Thanks,
    Kirk
    Attached Files Attached Files

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