MicroChip PIC problems (long)

MicroChip PIC problems

1) NO real datasheet: no DC parameters, no AC parameters; all of the so-called datasheets relate to programming. 2) Inconsisent or NO terminology used for designating programming pins PGD/PGC versus ICSPDAT/ICSPCLK. This means that the "datasheet" may not tell one which pins to use for programming. RA0/RA1, as shown in some diagrams, may or may not be the required pins for tha particular PIC MCU you choose to use, and some "datasheets" will not give any indications as to which pins to use. 3) PICkit 2 MCU Programmer User's Guide shows how one can wire up your application to a programming header, which gives terminology for programming pins: RA0/ICSPDAT/PGD and RA1/ISCPCLK/PGC. But..DO NOT rely on use of RA0/RA1 for programming! Real example: Check Figure A-1 of the 44-pin Demo Board User's Guide which shows RB6/RB7, which seems to be a more common useage. 4) The PICkit 2 MCU Programmer User's Guide states that the PGD/PGC pins must be isolated from the application circuit for proper programming by using series resistors from the pins (of the MCU) to the applicaion circuit. Absolutely NO guide is gives - so randomly pick a value between 1K which may be too low, and 1Meg which may be too high. 5) In the PICkit 2 MCU Programmer User's Guide section 3.4.1, they say "..set the voltage box..". WHAT voltage box? NO clue! 6) Some large PDF document >116 pages contains PIC micro family attribute charts (programmemory, RAM bytes, I/O pins, etc), Systems Products, pin count/packaging info and other info. That last section is *very* useful as it seems to be the only consistent source for PGD/PGC pinning designations for MOST of the PIC devices. But note there is one package MISSING from this valuable reference. 7) The 44-pin Demo Board User's Guide indicates a fair number of PIC devices that it supports, and the PIC16F877A is in that list of 44 pin TQFP devices. BUT that is also available in the 40 pin DIP! So, when ordering, be *very* careful about full designation required to get what you need! 8) Crystal oscillator resistors, capacitors or other circuitry neeed to get the crystal to oscillate is TOTALLY inspecified and absolutely NO guide other than a vague mention that the 2 hours you waste may result in a damaged part! 9) MPLAB IDE: a) It is NOT integrated; as far as i can tell, it cannot program anything on its own! And the PIC starter CD seems useless for real-world programming (only lessons). see #11 below. b) He IDE, being unable to assemble or compile anything on its own, has a drop-down list for choosing some external resources for those tasks. c) If i remember correctly, one or two guides leads one thru an installation of a USB driver for the PICkit 2 programming pod, and NONE of the indicated methods follow the documentation and NONE work. But running the IDE after non-directed setup (device selection, programmer selection) one finds that MPLAB does indeed "find" the PIC16F887 on the demo board, which does run (because it was pre- programmed).

10) In the PICkit 2 Debug Express Getting Started section 7, they indicate a pull-down menu to select *programmers* which is a strong indication that MPLAB cannot of itself do any programming. Worse, that pulldown menu has PICkit 2 as one of the selections. BUT they say to NOT select it even tho the PICkit 2 programming software is needed to program the demo unit! ZERO integration.

11) From PICkit Starter kit, I find NO programming software. So, I tried installing DebugExpress 12 lesson files.. Run 44pinDemoBdLessonSetup.EXE -- ERROR: "Unable to locate application file InstallLessons44P.MSI", which makes that useless. IF a CD disk cannot hold ALL of the required software,then a DVD disk is in order. 12) So I downloaded the PICkit 2 v2.55.02 Setup.ZIP, a 4Meg file which takes about 16 minutes on dial-up (chancy operation). Run it,and it immediately without any warning demands the internet giving a message "downloading required files". NO indication as to WHAT files, how many, sizes, etc.! It tok so long that one must battle auto disconnect every 25 minutes for OVER 1.5 hours (file 1); file size about 24 Megs (no file two, so the comment "required fileS"?). Then one gets "Installing .NET Framework 2.0". Well, if i knew that, I could have installed that from a CD that I had (program could have been provided - but let them be consistently INCOMPLETE and randomly chaotic. 13) Run the PICkit 2 v2.55 and get "The PICkit 2 OS v2.20.00 must be updated". WTF? So................................... Downloaded the "new" OS only to later discover it already was on the hard drive! But it gets even better! I then get the error message "PICkit 2 not found. Check USB connections" What??? It *IS* connected! Had to use the menu to tell the program to check connections! REAL WORK OF ART! 14) Connect application, check communications, PIC16F877A found, but no power. Try demo board, check communications, PIC16F887 found, no power. Nice. Another almost un-documented feature.
Reply to
Robert Baer
Loading thread data ...

Rubbish. They have comprehensive DC and AC parameters in the datasheets Do you are obviously downloading the wrong datasheet, Microchip have various versions of the datasheets available containing either full or specific info - quite handy actually. Just want data on the I2C module? - just download that PDF part etc.

Rubbish, the datasheets have a whole section on how the use the oscillators, something like 6-8 pages of it.

The PICkit 2 is brilliant, I've never had any issues at all. Take a deep breath, have a drink, get some sleep, and then try again.

forum.microchip.com is handy.

Dave.

Reply to
David L. Jones

All the data sheets I've seen have DC/AC parameters at the back. It's often incomplete (eg. missing curves of output drive) or full of TBDs or missing typical values, but it's there.

They changed terminology at some point-- and some chips support ICD and others (low end ones typically) only ICP.

Well, it would be a REALLY good idea to look at the data sheet for the particular MCU you choose rather than some other one, and hope that they are using the same pins.

Ideally, dedicate the pins to programming. Otherwise I guess you'd be looking at the drive capability of the programmer and of the PIC. The latter should be easy to figure out. The former maybe not so easy, might have to look at the schematic. 10K should be safe for 5V/3.3V operaton. But remember you can't debug stuff connected to those pins, so it's generally better to dedicate them, at least during development.

Why do you need this information in one place? Unless you're designing a programmer it's not all that useful.

Yeah, well, nobody tends to take full responsibility for the oscillator circuit in microcontrollers and other similar parts. You can calculate the load caps but the start up reliability is unknown. With 4-8MHz crystals (HC49 or HC49/U) the calculated load caps (from the crystal data sheet) are usually okay. With watch crystals and tiny SMT crystals you NEED to worry about exceeding the crystal drive power as well as start-up.

It's software, so of course it can't program anything! You need hardware to write the object code into the processor.

The language tool locations? Yes. It is "integrated" in the sense that you don't have to leave the IDE to perform any operations in the assemble or compile- link- program cycle.

I only installed the cheapie PickKit once, but it worked perfectly. There are some issues with USB and if you plug it in before loading the software I recall you have to go through some rigamarole to get back to square one (this was with ICD2/3 and or RealICE, but the Pickit is probably similar)

Yeah... it supports more than one type of programmer..

Dunno the exact issue here, but I think if you select it as a programmer it won't be available as a debugger, the latter being far preferable for development purposes. A programmer only programs, a debugger will act as a poor man's ICE allowing you to single-step, set a couple of hardware breakpoints, and examine the internal registers as well as simply program. That's assuming the chip you choose has the extra hardware on board to support ICD.

In the old days we had zero integration-- the assembler or compiler created object files, the linker created a hex file and then you fired up a programming application (or a terminal program) and downloaded the hex file to the programmer. An assembler cost a week's wages. A full development system (not as good as what you can get for $300 now) about 6 months wages for an intermediate engineer.

Now you are using "programming" to mean writing programs? IIRC the Microchip assembler and Hitech's 'lite' compiler are installed automagically. You just select them and use them.

Dunno about that-- never looked at their lessons. MPLAB has bloated up a bit (used to be < 30M, now 80M+) but its still not much of a CD.

I wouldn't expect anyone these days to give much consideration to dial-up users. Even in developing countries like China broadband is ubiqitous.

Sounds like you're learning-- always a frustrating experience. Note that to get full information (such as it is) on a single chip you probably have about 1,000 pages of documentation. In particular, you'll need the relevant reference manual as well as the exact data sheet. For the 16F series, it's the "Midrange Reference Manual".

You're almost there..

Reply to
Spehro Pefhany

You forgot the prime rule: Stay away from PIC. It will do you no good.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
                     "If it doesn\'t fit, use a bigger hammer!"
--------------------------------------------------------------
Reply to
Nico Coesel

On a sunny day (Sun, 01 Feb 2009 01:55:07 -0800) it happened Robert Baer wrote in :

Do you also have relational problems ;-)?

So, I really dunno if you are right or wrong about all that, so I will not comment on that.

I will show how *I* do it (and I have zero problems).

First I use Linux, this allows me many things, one of those is: leave everything on and connected for as long as I like, And, modifiy software, as I also modify hardware.

In Linux I use fvwm as window manager, the OLDEST version of fvwm. It has 9 virtual screens, or 'desktops', arranged and selectable from a pager as 3 rows of 3. Pager is top right in my screen where it does not interfere with anything. The screen is now set a 1440x900 (monitor can do more, but this grahics card has problems with video in xine in higher resolutions). ftp://panteltje.com/pub/screens/

So, in the bottom 3 'screens' I now have: Left (screen7): ftp://panteltje.com/pub/screens/screen7.gif ptlrc, my serial communication program, talking via a USB to serial adapter to the serial port of the col_pic project PIC: I wrote ptlrc, you can find it here:

formatting link
The col_pic PIC is in the noppp PIC programmer, but (of course :-) ) I modified that programmer, it has separate sockets for 16F84, 12Fxxx, 16F690, 16F648A. The noppp programmer is ALSO connected to the parallel port, so I can program from screen3, bottom right, using the noppp softeare, that I of course modified so it works on this faster PC (software loops), and supports these PICS. Also in screen3 I run gpasm, the free (also) GNU pic assembler.

On the bottom middle screen (screen 8): ftp://panteltje.com/pub/screens/screen8.gif I have the source code open, do the editing of the asm file. Never exit the asm, just type ~KS to write to disk in this editor, 'joe' is the name of this editor, it actually does nice coloring of the asm.

Bottom left screes (screen9): ftp://panteltje.com/pub/screens/screen9.gif Holds the assemmbler and the (modified) noppp programmer software.

So, the sequence is:

1) Select screen bottom middle, write some asm, some hundreds of lines preferably. 2) Select screen bottom right, type ./make_asm (script), this invokes gpasm with all the needed options. (Of course I do not need to type './make_asm', I use zsh as shell, just type './' and hit the cursor up until './make_asm" appears (from the previous time). This wil assemble the asm source, and give me an error report and line number if I made a typo. If no errros, and ready, then simply type 'nopp", select a PIC, load the hex, and type 'E' for erase and then 'P' for programming. 3) Then I select the left bottom screen, and in the 'ptlrc' communication program type the commands to the PIC, and see the response. Changing 'screen', or 'desktop' if you will, is easy in fvwm, just control cursor up / down left / right. 3) In some of the other desktops I have the PIC docs.pdf for example, ftp://panteltje.com/pub/screens/screen3.gif in an other one firefox, ftp://panteltje.com/pub/screens/screen4.gif and in other one Opera (browser), in yet an other one NewsFlex usenet reader (so I can type this), ftp://panteltje.com/pub/screens/screen6.gif and an other one audio that is playing, mixers, net monitoring. ftp://panteltje.com/pub/screens/screen5.gif So, no PIC was moved, the test circuit can either be the noppp programmer itself with the circuit connected to it, or the final circuit with the data, clock, Vpp and ground lines running to it from the nopp programmer.

As to reading datasheets, sometimes that needs some real digging, if I get stuck I sometimes type the code part in google, google will find many related parts of code, I found a nice page of somebody who sends a 8 kB sound file from PIC FLASH to a R2R DAC to have it say 'Hello I am mister Ed', used that code for my menu in col_pic, as the menu was getting so long, with all those options.

formatting link

So, basically I do not have all those problems.

Do not be a complainer, be a 'solutionist' :-)

And get rid of that MS Windos crap. Shifting around little windows, and staring mindless at debuggers is the wrong way to go about programming. A simple serial interface or a scope ao nan output pin is all real men need.

Reply to
Jan Panteltje

On a sunny day (Sun, 01 Feb 2009 12:32:58 GMT) it happened snipped-for-privacy@puntnl.niks (Nico Coesel) wrote in :

Is everybody at planet.nl an idiot?

Reply to
Jan Panteltje

Rubbish. I've had "issues" with *every* family of microcontrollers I've ever used, PIC are no different - more or less so depending upon which aspect you are talking about.

Dave.

Reply to
David L. Jones

  • I am on dial-up and cannot afford the HOURS to look at every "datasheet". I have seen 2 or three, and NOT ONE of them had anything even pertending to have DC or AC parameters. If i had accidentally found even one, i would not have complained about that aspect. Please be kind as to point to a specific one, specifically concerning the PIC16F877A and the PIC18F6527.
  • Been ther, done that - and found ZERO designations. Looking at some other part and "hoping" the pin designations are the same is rather chancy at best.
  • Fortunately i have a number of pins to spare, so i avoided those programming pins. Since there is NO DC or AC info on the programmer and seemly (for me so far) no data on the PICs then one can only make WILD guesses. Yep, i agree 10K should be safe.
  • I was trying to design my own application in such a way that it could be programmed. Thus, i needed to know WHICH pins were for PGD/PGC. NOT given in that document, as it did not cover 40 pin DIP devices.
  • Seems that a little research should have been done to give reasonable guidelines. It did not take me too long to come up with that "semi-universal" CMOS gate Pierce oscillator which is useable for all tuning fork crystals, and most of the standard crystals (as one approaches 40+ MHz, that series resistor becomes too large to support oscillations).
  • It cannot create that hex code or present it to an external programmer. The PICkit 2 program at least allows programming.
  • Yes, but at least, since it was in DOS, one could use a batch file to string them together. And now, the (good) IDEs make it look like a single program without bitching like MPLAB does.
  • What i mean is that the software that works with the PICkit 2 pod to program your unit WAS NOT on the CD.
  • The point is that ALL of those files, most especially the one that works with the programming pod SHOULD have been provided ON THE CD.
Reply to
Robert Baer

For the former:

formatting link

4M+

There are a few errata as well. Left as an exercise. Lots of parameters.

And the latter:

formatting link
Almost 8M. But it's too new to have the detailed parameters. Page 379/448 has the abs max ratings.

Some errata and a "family" data sheet, and programming spec.

formatting link

6.65M+ Page It has more than 40 pages of electrical specifications ending at page 419,

formatting link
formatting link
formatting link

?? Don't know what you mean. The first document I give a link to above-- PDF page 5 upper right corner shows pins 40 and 39 of the DIP-40 as PGD / PGC. The PIC18F8722 doesn't come in 40 pin..

Too often stuff gets shipped with pretty rough stuff on the CD and you have to expect they'll fix the problems and have the real thing available for download by the time you receive the product.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Two words:

ATMEL

and

FREESCALE

PIC leaves much to be desired when starting with it. You have to get on the phone or on line with somebody and find all the fixes. Its annoying.

Steve

Reply to
osr

Yeah PICs are so rubbish that no one manages to use them and that's why Microchip are going bust and Atmel can afford to buy them..... err NOT.

Microchip have plenty of cost effective products which get the job done. Their products, tools, and documentation are far from perfect but the problems are generally annoying rather than show stopping.

Reply to
nospam

I've seen problems with all three suppliers. Technical issues with all three, and also supply problems from two of the three.

Reply to
Spehro Pefhany

If I, very much the analog guy, wanted to learn how to program and use ONE, which ONE?

...Jim Thompson

--
| James E.Thompson, P.E.                           |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
 I love to cook with wine     Sometimes I even put it in the food
Reply to
Jim Thompson

Language of choice?

It also depends a lot on what you want to do. If you want to do ethernet communication and such like, I'd suggest a modern ARM chip.

For simple bit banging, talking to SPI devices and such like, probably the PIC would win because there are so many different parts, easily available, and cheap development systems. But the architecture isn't the nicest.

Reply to
Spehro Pefhany

Including more failed parts? I've never seen so many post production failures than with PIC processors.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
                     "If it doesn\'t fit, use a bigger hammer!"
--------------------------------------------------------------
Reply to
Nico Coesel

Typical "analog" functions...

If that happens do this ;-)

What would you digital guys call it... sequential branching?

...Jim Thompson

--
| James E.Thompson, P.E.                           |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
 I love to cook with wine     Sometimes I even put it in the food
Reply to
Jim Thompson

Well, i will have to take your word concerning DC data, as those files aer way too big for download - would seem to be a waste of hours to see one or two pages of desired info buried deep in the document(s). Got a Skybuckish idea: the site's server "scan" thru the document as if it was in your computer's memory, just like one might do "locally". Then "print" -to- your computer only selected pages (for quick donload of 2-3 pages out of 200-500 pages). Document stays on site server and only those pages get copied / downloaded.

Reply to
Robert Baer

Something like that is supposed to happen with byte served pdfs made for "fast web view"-- if you hit the electrical characteristics bookmark when it comes up you go right there well before the rest of the document has downloaded, maybe 3 seconds on my setup. But all the pages come down eventually. Assuming everything works right, which doesn't always happen.

Trying to design without broadband internet access is an exercise in frustration these days. You know for a $1.85 coffee you can take your laptop to Starbucks and use their broadband for a couple of hours. I suggest not drinking the coffee, but the broadband wifi is usable. Or the public library. Copy them onto an inexpensive USB stick and you're done.

You NEED timely access to the latest data sheet and errata (and older versions as well at times) or you're going to have trouble and frustration. It's not like the old days when data sheet revisions were notable events and printed data books would suffice.

At a minimum (assuming you are developing using recently purchased devices) go to Microchip's website (or Digikey) and download ALL the relevant data if it is NEWER that what you have on the CD (they change the last letter so you just need to look at the file name). If that takes hours, then so be it.

Digikey shows this for the PIC16F877:

PIC16F87xA

formatting link
(created 2003)

PIC16F87XA Rev. B0 Silicon Errata Sheet

formatting link

MSSP Module Silicon, Data Sheet Errata

formatting link

PIC16F87xA Revision B2 Errata

formatting link

PIC16F87xA Rev B7 Silicon, Data Sheet Errata

formatting link

Timer1 Errata

formatting link

And, of course, you need this one:

formatting link

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

GACK!

Reply to
Robert Baer

I *finally* had a chance to use a computer on cable (Comcast). Most of them said zero percent downloaded nevermind the whole document was there. But at least two came with "downloaded 160.95Mb of 819.77Mb"; one was the 39646b.PDF . What the heck does that mean?

Reply to
Robert Baer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.