• AVR Freaks

How Do I Learn Configuration?

Page: 12 > Showing page 1 of 2
Author
Kirk Fraser
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2008/04/21 15:13:37
  • Location: 0
  • Status: offline
2011/03/17 20:43:39 (permalink)
0

How Do I Learn Configuration?


Is there a tutorial, online class, or better help available than found in the Data Sheet (book)?  How does one learn what all the configuration defines do and what the chip functions are and how to call them?  In one of the simplest programs possible, just to turn LED's on and off, the chip refused to work until I was given a block of configs to include, which didn't help on my next stage of circuit development.

The book for PIC18F4550 is the worst computer documentation I've tried to read since the IBM 370-135 operator's manual 30 years ago.  It lacks structured organization and educational orientation.  If you want to write a job description for a person who can rewrite the book to be more useful, I can help.


#1

32 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 18847
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/17 20:51:02 (permalink)
    0
    It is a Data sheet not an educational book.
    I assume you found the section on Configuration bits in the data sheet.
    Do you have any specific questions on any specific bits?
    #2
    Kirk Fraser
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2008/04/21 15:13:37
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/17 23:48:59 (permalink)
    0
    If it's not educational it should not exist.  I searched on "Config" and got many many hits throughout the book, no specific section on bits.  I wouldn't know a good one to ask about.  I have an application I want the chip to work for, which works correctly but slowly on a Parallax Stamp.  I don't know why your system is more complicated.  Just being faster and cheaper would be enough for me to become a customer.  In fact that's why a community college teacher recruited me and sold me a PIC programmer, on his advice that the PIC is better for eventual production than the Stamp.  But having to include a bunch of unknown stuff added to my program just to get your chip to turn on and no education on anything about it causes frustration.   So please answer the original question.  If the book on the chip isn't educational, where may I find educational material on the chip?  Thank you.

    If the only pertinent information that exists is the section on bits, what page does it start on?  Thank you.
    #3
    Aussie Susan
    Super Member
    • Total Posts : 3735
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 00:58:56 (permalink)
    0
    Can I suggest Section 25.1 "Configuration Bits" (page 286 of the PIC18F4550 [plus other related MCUs in the family] data sheet, document ID 39632D - that is the version I've downloaded anyway)

    The above describes all of the registers and what each of the bits (or groups of bits) do.

    If you are actually talking about how to set the configuration values, then you need to look at the appropriate compiler manual.

    Susan
    #4
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11928
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 01:12:26 (permalink)
    0
    Kirk Fraser

    your chip

    This is a community forum; you are not generally addressing Microchip employees or sales people.


    #5
    MarkEHansen
    Senior Member
    • Total Posts : 153
    • Reward points : 0
    • Joined: 2008/08/06 11:07:23
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 05:51:34 (permalink)
    0
    As a new one to Microchip application development, I feel your pain. I started with the PicKit 2 and Low Pin Count development board, which came with the 16F690 along with a book on C programming which featured this combination. It was mildly helpful. Next, I found a set of tutorials which used the 18F4520. These really helped. If you're interested in these, have a look here:

    http://extremeelectronics.co.in/microchip-pic-tutorials/

    As for the configuration bits, start at the section titled "Special Features of the CPU". I went through this and determined what I wanted for each feature so I could set all the configuration bits. If there is a feature that you don't know whether or not you want, just ask here. After a while, you'll get the hang of it.

    Additionally, read the section on Oscillator configuration. It seems this is one thing that can trip up anyone. If the oscillator is not right, the chip won't run.

    And remember, we're all friends :)

    #6
    skimask
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2010/07/07 18:12:22
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 06:13:36 (permalink)
    0
    Ya know, you've all but been given information on everything you could possibly want to know about CONFIG bits over on the PBP forums...links to answers to the questions you posed (and those links which have helped numerous people 'see the light' over the years).  Apparently you STILL want somebody to hand-hold you thru the whole process from start to finish.  If what you say is true, then dictionaries, encyclopedias, and other reference material should not exist, since they apparently don't teach you anything.
    Perhaps you should stick with the Stamp and the PICAXE.  Nothing wrong with that.  However, I think there is something wrong with telling everybody else that they are wrong when you seem to be the only one 'out of the loop'.
    #7
    violin
    Super Member
    • Total Posts : 3301
    • Reward points : 0
    • Joined: 2005/05/09 04:59:48
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 07:37:38 (permalink)
    0
    If it's not educational it should not exist.  I searched on "Config" and got many many hits throughout the book, no specific section on bits.  I wouldn't know a good one to ask about.  I have an application I want the chip to work for, which works correctly but slowly on a Parallax Stamp.  I don't know why your system is more complicated.  Just being faster and cheaper would be enough for me to become a customer.  In fact that's why a community college teacher recruited me and sold me a PIC programmer, on his advice that the PIC is better for eventual production than the Stamp.  But having to include a bunch of unknown stuff added to my program just to get your chip to turn on and no education on anything about it causes frustration.   So please answer the original question.  If the book on the chip isn't educational, where may I find educational material on the chip?  Thank you.

    If the only pertinent information that exists is the section on bits, what page does it start on?  Thank you.

     
    Oh. If it is the case that you are really really not interested in to learn about uC's and all. I'll give you this code that turns on a LED.
    #include <p18cxxx.h>
    void main(void)
    {PORTB=0; TRISB=0;      
      while(1){ if(PORTAbits.RA4==0)  
           PORTBbits.RB1=1; } }  
     
     
    Smile
    #8
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 08:47:22 (permalink)
    0
    Use LATx registers when writing anyway

    GENOVA :D :D ! GODO
    #9
    recursos
    Super Member
    • Total Posts : 674
    • Reward points : 0
    • Joined: 2006/01/20 03:50:18
    • Location: Portugal\Carcavelos
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 09:00:04 (permalink)
    0
    Eagle eye DarioSmile
    Rec
    #10
    violin
    Super Member
    • Total Posts : 3301
    • Reward points : 0
    • Joined: 2005/05/09 04:59:48
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 09:06:44 (permalink)
    0
    Opps thanks, I missed that one. - My only excuss is that I have been jumping around in much recent time between the 16f's and the 18f's and this was a clear oversight on my part when moved back to the 18f's, even though it still runs as it is expected it should, as tested it out before posting it. Smile
    #11
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 10:49:01 (permalink)
    0
    Smile

    GENOVA :D :D ! GODO
    #12
    skimask
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2010/07/07 18:12:22
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 16:32:50 (permalink)
    0
    DarioG
    Use LATx registers when writing anyway

    I know using LAT registers is the proper way and all, but I still don't.  Don't know why.  Hard habit to break???
    I still write to the ports directly, "the old fashioned way".  I've never had a problem, even at 64Mhz with the new-ish PIC18's, R-M-W in the middle of the routines, on those solderless-breadboards and everything.
    What am I doing right (or wrong for that matter) that I'm not the issues that others have?
    #13
    NKurzman
    A Guy on the Net
    • Total Posts : 18847
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 17:06:51 (permalink)
    0
    If it's not educational it should not exist.


    Data sheets provide answers to people who know the questions.  It is not a computer it is a chip.
    Some of microchips data sheets do provide examples in some sections.
    There are Tutorials on the Net.  Microchip offers web-seminars and classes.  Amazon has Books
     
    And as pointed out I do not work for Microchip, But I sit near an Ex-employee.

    Anyway,  Assuming you found the section of the manual dealing with the bits.  Which ones do you need help with?
    And what ASM or Compiler are you using, and what voltage is your Vcc Xtal or internal oscillator?
    People here will help you so Question?

    #14
    rmteo
    Super Member
    • Total Posts : 1007
    • Reward points : 0
    • Joined: 2007/05/02 20:33:25
    • Location: Colorado, USA
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 18:21:43 (permalink)
    0
    NKurzman
    ....And what ASM or Compiler are you using, and what voltage is your Vcc Xtal or internal oscillator?

    See post #6.


    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!! mr greenmr green
    #15
    NKurzman
    A Guy on the Net
    • Total Posts : 18847
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 18:50:38 (permalink)
    0
    ?????
      Post #6 is not from the Original Poster?
    #16
    rmteo
    Super Member
    • Total Posts : 1007
    • Reward points : 0
    • Joined: 2007/05/02 20:33:25
    • Location: Colorado, USA
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 19:02:13 (permalink)
    0
    He was referring to these posts by the OP:
    A Defines Request
    Improve PBP with integrated configuration

    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!! mr greenmr green
    #17
    NKurzman
    A Guy on the Net
    • Total Posts : 18847
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/18 21:05:03 (permalink)
    0
    OH!!!!!!!!!

    He is not Talking about the Configurations Bits.
    He is talking about Register Configuration.  Well my advice is wrong.

    1) Do not use such a fast Xtal on a Protoboard ( Start with 4 or 8 Mhz). Connect all the Vcc and Gnd Pins. Add a .1uF cap from Vcc the Gnd.   I would sugest a board like an OLIMEX PIC-P40 it is cheap and comes assembled.

    2) What are you programming with? ASM, C, Forth?  That will help in directing you to help.

    3) Yes the PIC is loaded with control registers,  And it can take a while to set them up.  I have spent a full work day on some new chips. So start with the basics get it up and running, then add stuff.  You can not eat the cow whole.  I like to start by blinking the LEDs.  So Step 1 is get the CONFIG Bits set.  Step 2 is the LEDs  the chapter on ports is good.  Find you Port there is a list on Registers that it uses at the end of the section.

    4) I repeat you can get help here.   Many people have posts from project start to finish here.

    5) that 24 volts into the LM7805 will get very hot.  it needs a Heat sink or use a PT5101A

    6) you have code posted at the other forum.  Add that to this post if you just want to port that it can be done without too much hassle.
    post edited by NKurzman - 2011/03/18 21:12:45
    #18
    violin
    Super Member
    • Total Posts : 3301
    • Reward points : 0
    • Joined: 2005/05/09 04:59:48
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/19 02:55:15 (permalink)
    0
    I know using LAT registers is the proper way and all, but I still don't.  Don't know why.  Hard habit to break???
    I still write to the ports directly, "the old fashioned way".  I've never had a problem, even at 64Mhz with the new-ish PIC18's, R-M-W in the middle of the routines, on those solderless-breadboards and everything.
    What am I doing right (or wrong for that matter) that I'm not the issues that others have?

    Hi. It really isn't the case whether you have had a problem or not, - whether its works or it doesn't. - I also don't ever recall a problem with using PORTx against LATx. -- It really comes down to good or bad code practice and if the opportunity is there to escape from things like the R-M-W issues then it should be taken up without hesitance, after all it is no point in inviting issues if there is no need too. Yours maybe through bad habits, mine is through forgetfulness. – Probably an age thing with me… Smile
    #19
    Stefan Uhlemayr
    Super Member
    • Total Posts : 4292
    • Reward points : 0
    • Joined: 2005/05/12 12:25:46
    • Location: Germany
    • Status: offline
    Re:How Do I Learn Configuration? 2011/03/19 03:34:13 (permalink)
    0
    skimask

    ... I know using LAT registers is the proper way and all, but I still don't.  Don't know why.  Hard habit to break???
    I still write to the ports directly, "the old fashioned way".  I've never had a problem, even at 64Mhz with the new-ish PIC18's, R-M-W in the middle of the routines, on those solderless-breadboards and everything.
    What am I doing right (or wrong for that matter) that I'm not the issues that others have?
    As long as you neither exceed the rated max. output-current for having save output-levels nor the rated max. capacitance connected to an output-pin, the chances for falling into a rmw-issue are very small. See this summary about the rmw-effect - you're just using solution 1...Smile

    On the other side, using the LATx-registers for writing to the outputs will not give you even one disadvantage - so just use them...Smile

    Greetings,
    Stefan
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5