Actually, can anyone shed any light on why Microchip organised the PIC this way? Why not just use an 8-bit address for the registers and do away with the status bit for the register banks altogether? Is there some advantage to having just a 7-bit address?
8 bits for regs would get you 256 addresses. how do you expand beyond 256? banks. doubling the size of a bank really doesn't buy you very much. basically the PIC14 architecture was originally designed to have a max of 128 regs and 2K words of code. banking and paging allowed clumsy expansion beyond that.
it's really a shame that the designers did not pay attention to the trends that have going on since the dawn of the computer age. every successful architecture bumps into it's limits much sooner than the designers think.
to be fair, it's always a trade-off. chip size vs features. more address bits means programs are larger which means a smaller available market. larger chips cost more to make which means higher prices - smaller available market again. while the "learning curve" drives the prices down, it's a risky move to start too far up the learning curve (i.e. price yourselves out of the market). where was the tipping point for success? no one really knows when designing a product, you can only tell later. Had the designers known how successful the PIC would be, maybe they would have been a little more generous but hindsight is 20/20.
Actually, can anyone shed any light on why Microchip organised the PIC this way? Why not just use an 8-bit address for the registers and do away with the status bit for the register banks altogether? Is there some advantage to having just a 7-bit address?
This question is not difficult to answer. The 7-bit address is a limitation imposed by the core design of 14-bit word microchip.
PIC instruction execute in single instruction cycle with pipeline and thus everything needed for decision must be ready or presented inside a single instruction word, which is 14-bit for 16F628a.
Inside these 14 bits one must also allocate different bits for the actual instruction itself so the instruction can be decoded. The remaining bits being used to carry data. With 35 instructions, all single word, one would need 6 bits (64 combinations) to decode them separately. This leaves 8 bits available for data and is of not much use. However, using special cases of these 64 combinations, part of the data code space can be turned into instruction space but now the available data width is reduced. Therefore only a few instructions can enjoy 11( the GOTO instruction) or 10 bit(BTF instructions) dedicated for data use, a few that have 8-bit data(those that deals with literal) and most of remaining uses 7-bit for data(register addresses) instead.
Your suggestion for 8 bit register address wil bring out two problems. First, the number of registers will be limited to 256, which is not sufficient for modern microcontroller and also means that one still has to switch banks to access more than 256 registers. The second problem is one cannot possible fit 8 bit register addresses into the current 14-bit word instruction set without reducing the data width of some of the existing instructions.
Agreed - When starting out, nearly any microcontroller is sufficient. And once you know how one of them works, it's relatively easy to jump ship and swap to another one later on. And if you're interested in getting a really deep understanding of microcontrollers, the question should be "AVR or PIC, which one first"?
Using your advice, the only things left to consider would seem to be the cost of development equipment and the availability of information. I think the PIC would win on those counts, so it's probably better for the beginner to start with the PIC.
Not really. They are both tied now IMHO. For me, I need a cheap program to make and both have them. A free basic compiler, they both have them. Cost are about the same.
So they are abount the same for me. I went PIC maybe 6 months ago and have spent about $400+ (on compilers as the free one did not get it).
On the Atmel I spend $129 for a programmer.
Again, this is going BASIC, it was cheaper for me. If I went ASM, a tie.
The huge internet resource would swing it for me. The PIC has massive support. Not only would he be better off starting with the PIC, there's no reason why he shouldn't stay with the PIC afterwards as well because it's a good Microcontroller series.
Anyway....for pic you can use a cheap, homemade JDM programer and ICprog (Free download). The main problem with the JDM is that, on some (most) ports, doesn't give enought yoltage for programing (12-13.5V). U can modify it by using an external voltage source just for the Prog enable. The developing tools.........
Anyway....for pic you can use a cheap, homemade JDM programer and ICprog (Free download). The main problem with the JDM is that, on some (most) ports, doesn't give enought yoltage for programing (12-13.5V). U can modify it by using an external voltage source just for the Prog enable. The developing tools.........
If what you meant is to show that PIC is better in this respect, I bet you don't know one only needs, at the minimum, a few resistors and the parallel port to program an AVR.
- the low pin count AVRs have a really nice single pin programming interface (2 for PICs, trust me, 1 pin can make a difference).
- if you are programming in assembly, the AVR is a far nicer chip.
because i was thinking of using my pc - spi interface to clock in four clocks into a PIC , note the output , clock in four more .. ect
that way i could keep a running total of clocks and repeat a step or sequence , immediatly if needed.
If what you meant is to show that PIC is better in this respect, I bet you don't know one only needs, at the minimum, a few resistors and the parallel port to program an AVR.
Yes, I have no experience with AVR, and limited with PIC's. I was just answering to a post that said that has spent 400$+ for a PIC programer and 129$ for AVR. The JDM works, and I've seen kits for less then 10$.
If what you meant is to show that PIC is better in this respect, I bet you don't know one only needs, at the minimum, a few resistors and the parallel port to program an AVR.