Re: Need guidence for programming a DS1821C+
Yes those register names are VERY chip specific. Although you may find similarities between chips I would always check the data sheet for the chip you are using.
That is probably the one thing that took me a while to realize. You simply can not work with these PIC microcontrollers (or other micro's for that matter) without having the data sheet available for reference. .pdf file works great.
Just google your PIC part number and "datasheet" and find the link to Microchips web site for the datasheet.
Now reading the data sheet is an "aquired talent" There is a LOT of information there and you have to figure out what is importaint at the moment for what you are trying to do.
Not sure how to tell you how to go about digesting the data sheet, other than to say KEEP AT IT. Start by finding the section on the Port Pins as there you will find all the registers that are pertinant for that given Port Pin. You will have to do quite a bit of jumping around in the document as you look at each of the various registers.
I also try and start my projects by loading a previos file that uses the same chip I am working with at the time. That way I know it worked for that previous project and I can delete most of the code and start witht the begging register configuration section.
Dont forget the Configuration "fuses" that are set at the time the chip is flashed. This configuration register is usually what sets the watch dog timer, brown out detect, int/ext type of oscillator, how the MCLR pin behaves (as an mclr or as an INPUT) etc., etc,
good luck
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Bookmarks