Two hopefully easy questions?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,523


    Did you find this post helpful? Yes | No

    Default Re: Two hopefully easy questions?

    Hi Ed,
    If you look at the datasheet you'll find that on the 18F1320 you select if a pin should be analog or digital thru ADCON1 (see section 17.2), so to set all pins as digital you can simply do ADCON1 = 255. That's one command.

    It's also a good idea to look at the initialization conditions (Table 4.3), there you'll see that ADCON1 defaults to a value of 0 on power on and reset which means that all analog pins starts up in analog mode so you need to switch them to digital.

    You can use Darrels AllDigital but it's always nice to be able to do it "manually" in case AllDigital isn't kept up to date or doesn't work for whatever reason.

    /Henrik.

  2. #2
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: Two hopefully easy questions?

    Thank you both very much! It is pleasure learning from you!

    Best, Ed

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