A rant about port configurations


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Location
    Maine, USA
    Posts
    81

    Default A rant about port configurations

    I have a pet peeve about how Microchip writes their datasheets.

    I don't know about most folks, but the first thing that I need to know when I'm getting to know a new chip is what the default configurations are for the ports. Most of the time I don't need half the special features that come with the chip, I just need sufficient memory and lots of digital I/O. So I have to wade through hundreds of pages to try and figure out what the default configuration is for each port so I can disable the features that just get in the way of using the port for simple digital I/O.

    Why the heck can't they put a simple page in every spec sheet that lists what the POR config is per port? It would look something like this:

    PortA:
    All pins digital I/O
    PortB:
    All pins digital I/O with pull-ups enabled
    PortC:
    These special features are enabled....

    Is it just me, or does anyone else struggle with this issue?
    "Do or do not, there is no try" Yoda

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: A rant about port configurations

    I'm with you on this one. Every time I get a new chip I type in every register name (usually about a hundred), and look at each bit. I generally I wind up configuring all 800 bits, because I don't look at the POR defaults much, I just set them the way I need them. The whole process takes 4-5 hours, and is getting worse with some of the new "J" and "K" series parts. One upside - I learn a lot about the new part.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default Re: A rant about port configurations

    I know I may ba a little wierd, but I like reading them. Admitedly I don't read the parts I never use, like ethernet and such. I usually zoom straight for the osc section after looking at the pinout section. From there I will read the example for each port I/O it usually tells me what needs setup to make it work. I like the charts that show each pin and what it can do, this way I know where to look to see if I need to set stuff.

    I HATE writing headers for the initial set up, hence my wish list item for a header wizard. I think it could knock your 4-5 hours down to 10 mins.
    -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!

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: A rant about port configurations

    It should be possible for uChip or someone else to write such a wizard - maybe they already have. If I was really good at some 'useful' language like Java, I might try it myself. As it is, I'm going to have to wait for someone smarter than me to do it.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default Re: A rant about port configurations

    I am on that list with you. But I don't agree with the useful part. You already know the most useful language - PBP. The rest can only make pretty pictures and parse text.
    -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!

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: A rant about port configurations

    I highly dislike the method of trying to initialize ALL the registers at the top of your program.
    Unless you know EVERYTHING about that chip, many of them get initialized incorrectly.
    This had led to more problems than any other issue.

    With the exception of comparators on the older chips ... Everything is turned OFF at power-up.

    All you have to do is turn ON the things you want to use.
    Don't try to turn everything off, they already are.

    Now the first thing people will say is ...
    Then why do I have to turn off analog pins with ADCON1 or ANSELx?

    It's because you aren't turning the Analog functions OFF, you are turning the Digital Inputs ON.
    Analog inputs are always ON, even when the Digital Input is enabled.

    So just concentrate on what you want the chip to do, not what you don't want it to do.
    DT

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