On Wed, Jun 02, 2010 at 09:04:22PM -0400, mcd@is-sixsigma.com wrote: > > > As an aside, why use the 16F84 at all? > > Simple, really. If you have 16F84 code and you aren't terribly familiar > with PICs it can be monstrously difficult to port. Most of the 84 code > out there is absolute and horribly written. Most of the code for the 16F84 is horribly written because the 16F84 functioned with virtually no hardware assistance. No USART meant everything had to be bitbanged. No CCP means that PWM and timer capture had to be done by hand. A single 8 bit timer meant that all multiple timings had to be virtualized. No ADC meant that you had to resort to cap timing to get analog readings, or to hook up an external ADC. Literally once you get past the blinky LED, the 16F84 becomes like the old Adventure game: "You're in a maze of twisty passages, all alike." > > The 84 is a great learning part because it avoids a number of > complications of all the other PICs, allowing the learner to bite off a > smaller piece initially. The problem is that it by necessity teaches the newbie the ultimately much more difficult way to manage real embedded projects. It's the software equivalent of asking a new programmer to write his own compiler and libraries from scratch instead of using an existing compiler. Sure it's a bit tougher to learn how to use the more complicated tools. But in the long run you leverage so much more by learning to use them properly, that it is worth the effort. > All of the GPRs show up in all banks so no data > mysteriously disappearing, Which teaches the bad habit of not tracking bank accesses. > and none of the I/O pins do weird things like they do on every other PIC. > (Sure, they're not weird when you are familiar with them, but having I/O > pins simply not work because you have given the magic incantation can be > very distressing.) Easily explained with a one paragraph explanation. Let me take a crack at it: "When a PIC that can do analog input first starts, it does not know if an analog input or a digital one is connected to an analog I/O pin. An analog signal connected to a digital input can cause some weird effects. On the other hand a digital signal on an analog input is no problem. Because of this, when a PIC restarts, all analog inputs are automatically reset to analog mode to prevent any weird effects from happening. So if you plan to use one of these pins as a digital input, you need to use blah register (ADCON or whatever the equivalent may be) to change the input from analog mode to digital mode. It needs to be done once near the top of the program." Now exactly how distressing is that? People get distressed when they do not know what's going on. Instead of dumbing down the system, simply explain why something needs to be done. Then they will not only do it, but know why they need to do it. Every peripheral in a PIC makes the designer's life easier. It does this because hardware facilitates a useful action (read analog input, PWM, timing capture, serial data transmission) without the designer having to manage every single detail of the operation in software. It's as simple as: 1) Set up the peripheral. 2) Check to see if it's ready. 3) Use it. And it can go off on its own and do the job without having to track it every second. So I'm diametrically opposed to the 16F84 simplicity model. I believe that a newbie should get the most packed part with every peripheral, and a good tutorial that shows how to set up and use each one. Then they can decide what it is that the do not need, instead of now being aware of what they have. In the 14 bit Microchip universe that would probably be the 16F1936/16F1937 now. 8K of flash. 512 bytes of RAM. 256 of EEPROM data memory. USART/I2C/SPI, CCP, ADC, runs up to 32 Mhz on an internal oscillator. And still clocks in an about 1/3 the price of the 16F84. Also I would try to get newbies to kick the 18 pin part habit. I/O pins are the lifeblood of a project. The 28 pin skinny DIP is the right size balance for prototyping. > > > It is expensive, old, and doesn't really have any peripherals. > > There are much better and cheaper PICs out there like the > > 16F628A as one example. Use the product search on Microchip's > > site and you'll see what I mean. Bingo! > > This, however, is also true. The 84A is horribly expensive for what you > get. Even the 628A is a little aged. Many 16F84 projects don't rely on > EEPROM, which can make the 716 a really nice choice for the hobbyist > because of it's low price. At the other extreme, the 88 has more of > everything and in hobbyist quantities, barely more expensive than the > 628A. You are still a generation behind. The XLP 16F parts should be the only type of 14 bit parts anyone should be checking out right now. Once the 16F1938 with 16K of flash, 1K RAM, 32 Mhz clock, and 28 pin skinny form factor and the 12F1822 which is an 8 pin part with hardware USART/I2C/SPI along with all the rest of the standard periperal package comes out, the circle will be complete. And all of these parts barely clock in at $2 each in quantity. And that's from Digikey, which isn't known as the low price leader. > But if the OP is a relatively new PIC user, the 84A is understandable. > PICs can be pretty intimidating at first. Better to spend a few bucsk > extra to get something warm and cuddly. I fervently disagree. It's a model that teaches all the bad habits at the beginning. And as a coworker of mine always used to say "You love what you learn first." So if you learn it wrong, it's a bad habit to break. BAJ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist