Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

AVR or PIC

Status
Not open for further replies.
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?

Brian
 
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.
 
ThermalRunaway said:
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?

Brian

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.
 
Last edited:
beginer electroner said:
I mean, just pick one and use it. It doesn't matter if you have no history in either chip. PICs are just yelling out "PIC ME!", however.
 
Last edited:
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"?
 
Just pic a chip. That is the point really.

Let's do this.

I am you. I want to learn.

I can pick a 16F84. There are sites all over about it. It will work fine if you have a programmer, read the docs and have an assembler/compiler..

I am looking at the 16F88 at this point.. So I would recommend that chip. In the PIC world, you have to read..
 
dknguyen said:
I mean, just pick one and use it. It doesn't matter if you have no history in either chip. PICs are just yelling out "PIC ME!", however.

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.

Brian
 
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.

Brian
 
I use both.

I like the AVR as they are a little faster for one and assembler is easier for me.

But the ICD2 is a nice feature for the pic and many website.

They are both good.
 
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.........
 
I've heard that code for 16F84 runs on 16F628.
Is that true?
 
Tarsil said:
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.
 
how does that debugger work?

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.
 
eblc1388 said:
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$.
 
eblc1388 said:
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.
Btw, you made me curious. Got a link to a tested schematic for AVR?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top