At 10:25 PM 6/24/2004 -0700, William Chops Westfield wrote: >On Jun 24, 2004, at 7:14 AM, David VanHorn wrote: > >>Then the AVR would fit that bill entirely, give you vectored >>interrupts, no "holes" in your ram, no pages, the equivalent of 32 "W" >>registers... > >The AVRs are nice, but those 32 registers aren't nearly as "general >purpose" as Atmel would have you believe. Ok, I was being brief. The lower 16 work with almost all instructions, and the upper 16 work with all instructions. LPM (sort of equivalent to RETLW) outputs to R0 in lower end parts. The top two (ZH/ZL) are used as pointers for LPM, and the next two down are general purpose 16 bit registers/pointers. Also, when I build tables, I can build them anywhere, with no worries about page boundaries. I know you can work around it in the pic, but in the AVR, it's a total non-issue. The way I generally allocate the registers is like this: R0 = LPM so I remember it's sort of tied up. Most of my apps use the LPM instruction. R1 = SREG for saving the SREG during ISRs (where needed) R16 = TEMP R17 = TEMP2 R18 = ITEMP dedicated ISR temp, to avoid pushing and popping R19 = LOOP Local use loop counter. R26 = XL GP 16 bit register pair R27 = XH R28 = YL GP 16 bit register pair. R29 = YH R30 = ZL Pointer for LPM and other 16 bit ops R31 = ZH That works out to 10 "W" register equivalents, plus 14 slightly less capable registers in the low page, plus the fact that I can put a lot of vars that I need in the ISRs in those low page registers. When the ISR hits, I can "inc Counter" directly, rather than load it into W, inc, then save it back. With the AVR running typically four times faster at the same clock, my ISRs can be unbelievably fast. Vectored ints helps as well, unless you only have one Int source active. I also didn't mention the lack of "pages" in I/O and RAM. > They are a bit nicer than >PICs, but they're also a bit more expensive and harder to find ?? www.digikey.com, Arrow, etc. >, and their "pin compatible ranges of parts" are not nearly so broad as >the PICs. Does it need to be? > And they appear far less often at bargin prices on eBay. That's never been an issue for me. I mostly get mine from distribution, or digikey. I've never understood why someone would put themselves through much trouble at all, to save $1 on a one-off or hobby project. I just did a one-day project for a guy, two systems that needed to behave a bit differently than stock. I wrote some code for a tiny-26 because A: I had them on hand, and B: they had enough pins to handle the job. I could have selected a slightly less expensive part, but there wasn't any point to it. I would have saved maybe $1. It's a gnat fart in a hurricane. (someone will no doubt work this out mathematically and show that I'm off by a couple orders of magnitude :) Your time looking for the less expensive part is worth more than $1, and then you have the time you spend dealing with it. :-P >(and for some reason, there don't seem to be nearly as many cheap build >it yourself programmers for the AVRs, although I can't see any reason >why there shouldn't be...) The BA1FB programmer works nicely on the earlier parts. Atmel's AVRISP at $29 does everything else, and there are many clones, how many alternatives for the same thing do you need? -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads