A Defines Request


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    Look up ADCON1 register in the datasheet. to find it faster, make sure bookmarks are on and scroll do the the A/D section. this section will tell you lots of stuff about how the pic does the A/D. the registers are always listed at the end of the section. BTW, within the first few paragraphs it explains how to turn the Analog input on and off to use the pin as Digital or analog. Any way, look up ADCON1 and read which bits need to be on or off, 0 or 1, set or clear.

    PWM is not an analog output.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Feb 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: A Defines Request

    Bert,

    I'm pretty sure the reason it doesn't work is some kind of setup is needed for the A/D like there was when the LED test wasn't working. My explination of how the burnout works may be imperfect but it's gotta be close. Whatever the reason, if either output pin defaults to "1" when not setup, that would trigger the IRL530 to max out its coil.

    I need to know something about how registers work - do they execute in sequence like a program? If I set ADCON1 =15 that turns off the A/D for all pins, then I set ADCON0 = 3 will it turn on A/D for Port.A0? Or will it ignore it if written in reverse order? Or can I assume the A/D defaults to off when not set up then perhaps only the ADCON0 = 3 would be necessary?

    I don't quite understand what a comparator is. I understand the digital "or" but how does that handle A/D? I'd think CMCON = 7 should be ok unless required for A/D. Perhaps its safer (to conserve my remaining PIC chips) to assume the register is completely unnecessary in my application.

    PWM is not strictly a digital signal since the width of each pulse can vary but it doesn't need conversion from digital to analog by the A/D converter, with the output bit set, does it? On page 151 item 15.4.4 is a list to set up PWM. Does PBP do any of that when the PWM command is used? I'm guessing not because of the burnt chips. So how do I tell which pins can receive a PWM output command? Do I use ordinary or enhanced PWM?

    It would be nice if PBP did everything it could including setting up each chip function when called.

    Kirk
    Last edited by Kirk Fraser; - 19th March 2011 at 06:32.

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