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.

PIC or AVR

Status
Not open for further replies.
jrz126 said:
Ok, I'm going to order 2 samples (maybe 3) of the 877A's and 2 of the 628's. About how long does it take for the samples to come in? (and I think you guys are going to regret getting me convinced to use PICs, because I'm probably going to have a bunch of questions)

They usually only take a few days.

I found googled for an ICSP programmer and this came up https://www.olimex.com/dev/pic-pg1.html The schematic is very simple, using the serial port, 2 transistors and a handful of caps, diodes, resistors.
The software that this programmer will use is here:
Is this software easy to use?

Yes, easy to use, but I'm not happy with the reliability of serial port programmers - see many other threads about problems!.

Also, how do I go about generating the hex file? (which compiler do I need?)

With MPASM, the MicroChip assembler - it comes as part of MPLAB as a free download. You can use it from within MPLAB if you wish.

What clock speed should I run it at? (what crystal should I order? looking at the schematics at Nigel's site, I'm assuming 20MHz.)

Anything upto 20MHz, I use 20MHz on my 877 tutorials, but 4MHz on the 628 tutorials (with it's internal oscillator).

Whats the minimum number of I/O that I would have to use to connect a 4x4 matrix keypad, and a standard 14 pin LCD?

Check my tutorials!.
 
Nigel Goodwin said:
It's not just this board that's biased towards PIC's, it's the entire world!, PIC's are the biggest selling micro-controller.

A fair while back someone posted a poll on this board asking which processors people used, I seem to recall that PIC won it by a long way?.

PIC's were out there a LONG!! time before the AVR, which was simply Atmels attempt to 'jump on the PIC bandwagon'.

You will notice that I've never criticised AVR's, I freely admit that AVR's may be more suitable for a few applications, but PIC's are more suitable for some as well. The speed difference between PIC's and AVR's isn't a great deal, any only rarely has any bearing - plus the 24 bit 80MHz PIC is probably faster than AVR's anyway..

I'm not critisizing PICs in any way! I know they have been out for a very long time and that partially accounts for there wide use. I'm just saying AVR's should definatly not be overlooked! For more complex circuits and software I'd definatly be using an AVR. For simpler circuits 35 instructions would be great to use.

The 'best' microcontroller for any job is the one you can do the job with, regardless of who makes it, or what code it runs - it's obviously advantageous to use one you can write code for, and for any micro-controller (PIC, AVR or other) a decent knowledge of assembler is essential, even if you mainly use a high level language.

From a hobbiest point of view PIC's are cheap, fast, and have plenty of support available - the AVR probably comes second, although the larger instruction set makes it slightly more complicated to use.

Agreed.
 
jrz126 i would suggest that you dont use a serial port programmer like the one you are mentioning. if u do want to use a serial port programmer then go for a proper programmer with a built in microcontroller for programming. actually the simple serial port programmmers program the PIC by direct bit banging and the use the power from the serial port. many serial ports (especially the ones in laptops) arent up to this. so you should always use a programmer with an external power supply. Nigel's site has the schematics for the programmer i have built. its basically a parallel port programmer so its faster than the other programmers and it uses an external power supply. basically its a variation of the original David Tait design and it is widely accepted and used by PIC programmers. you could either download the schematics from Nigel's site or go to **broken link removed**

in addition to this programmer you would need a software programmer. for that i would recommend Nigel's WinPicProg.

and i would also say that you should start reading Nigel's tutorials. and go to http://www.piclist.com and try out the code from there.
 
About Nigel's programmer, looking at the supported PIC's, there is a star next to the 877, meaning the software will support these soon. Thats why I was a little unsure about using his programmer. Is this still the case?

Also, digikey doesnt have the bc557 transistors, is there a specific substitute I need to use, or would say a 2n3906 (or 2n3904) work?

And for R9, what is the value of that resistor? it says "680E" is that just 680 ohms?
 
jrz126 said:
About Nigel's programmer, looking at the supported PIC's, there is a star next to the 877, meaning the software will support these soon. Thats why I was a little unsure about using his programmer. Is this still the case?

The latest beta supports those chips with a '*', the 877 has been supported for many years, it's the FLASH 877A which has the '*'.

You can download the latest beta from the Announcements section of the support BBS - it's looking pretty good, no reports of any problems.

ICProg also supports the P16PRO40 hardware.

Also, digikey doesnt have the bc557 transistors, is there a specific substitute I need to use, or would say a 2n3906 (or 2n3904) work?

Any small signal PNP transistor will be fine.

And for R9, what is the value of that resistor? it says "680E" is that just 680 ohms?

Yes 680 ohms, the programmer hardware isn't mine, I just have it available as I got loads of requests for where to download it. Bojan isn't English, presumably 'E' is the suffix for ohm in his language?.

I notice that 'E' is often used in the Dutch magazine Elektor as well.
 
Thanks a bunch for your help guys, I ordered my 5 samples from microchip, and I finally placed my digikey order, I was waiting about a week, because I knew I would think of some other stuff that I needed. (I know that now that i've placed it, I'll discover that I needed some more stuff)
For that programming circuit, can I just put a 9 pin header on my board with the necessary pins routed to the pic and have the rest of the programming circuit on a different board? So that I wont have to remove the pic to program it.
 
jrz126 said:
For that programming circuit, can I just put a 9 pin header on my board with the necessary pins routed to the pic and have the rest of the programming circuit on a different board? So that I wont have to remove the pic to program it.

You can do ICSP (In Circuit Serial Programming) with almost all PIC's, but personally I never do - it puts too many constraints on your target board. It's no trouble whatsoever to unplug the PIC from a ZIF socket on the programmer and place it in a socket on the target board. I fit all my working PIC's with turned pin sockets, this gives nice straight pins to plug in and out - it's so easy, and protects the PIC against damaged or broken pins.

If you do go the ICSP route, bear in mind the wires from the programmer to the PIC need to be EXTREMELY short - otherwise the extra capacitance can stop it working. The P16PRO40 isn't designed to be an ICSP programmer, so hasn't the capability for driving other than short wires.
 
Zif's are too expensive for me. I think what I'll do is put my pic in an extra 40 pin socket and keep it there, so when I'm removing it from programmer/ target board, I will only have the possibility of bending the leads on the 40pin socket and not the pic. (hope this makes sense.)
(which means I shoulda ordered some more 40 pin sockets)

I've got plenty to do before I can seriously work on building the logic board. I did manage to get the new leds mounted in the headliner. I'm just waiting on some heatshrink tubing in my digikey order to attach the connectors and put it back in my car.

EDIT:
I'm looking at Nigel's tutorials, and I've got a quick basic question about the code:
movlw 0x07
movwf CMCON ;turn comparators off (make it like a 16F84)
Does this code mean (line1) load 0x07 into the working register (line2) load the working register into CMCON. (which is defined in the 628.inc file)?

I know I'm going to get on your nerves, so what would you pic experts recommend as the best description of the instruction set commands?
(The tutorials are great, but if you dont understand the instruction set, it's hard to understand what the tutorials are doing)
 
jrz126 said:
Zif's are too expensive for me. I think what I'll do is put my pic in an extra 40 pin socket and keep it there, so when I'm removing it from programmer/ target board, I will only have the possibility of bending the leads on the 40pin socket and not the pic. (hope this makes sense.)

Yes, it's what I said above! - but use a turned pin socket on the PIC, and normal sockets on the board. I keep turned pin sockets for this sole purpose, I don't like to use them on boards.

In all my years of PIC programming I've never broken a PIC pin, nor even broken a turned pin socket.
 
I'm looking at Nigel's tutorials, and I've got a quick basic question about the code:
movlw 0x07
movwf CMCON ;turn comparators off (make it like a 16F84)
Does this code mean (line1) load 0x07 into the working register (line2) load the working register into CMCON. (which is defined in the 628.inc file)?
yes Exactly..
movlw 0x07 --> move literal to Working register..
movwf CMCON --> move working register to F ,where F being the CMCON register..
the best description of the instruction set commands?
chapter 15.. page 113..

https://www.electro-tech-online.com/custompdfs/2004/10/40044b.pdf
 
I've heard of PICs used in...

the system opening subway cars' doors, washing machines and some domestic appliances as well, (besides my own thermometric data collector for 8, 16, 24 or 32 sensors) :)

I've read all coments regarding how easy is to learn with less instructions to what I basically agree.

But the next point to consider is how much faster you can proceed, when you mastered the whole set and with a ready made instruction you do the same than with probably three or four of those from a RISC like PICs.

My start was with the Z80. Nice instruction set! Powerful indeed.

Next the 8052 (Basic or assembler). Same comment applies.

But, I am in the PIC trend for long time now.

In the beginning I used to take preferences seriously and argued to prove how right I was in my choices. But life, personal economic reality, where you are located in this small big globe and unexpected variables dictates what are your options (if any) to make a choice from them.

To a certain point is more or less like with girls. Usually you choose from what is available around in the "local market". Feelings appear later. Like it or not, I think it's like that.

And keep in mind this: if mothers in law are a concern, every girl in normal circumstances has one behind her. The worst of PICs is the Picstart Plus programmer. With WIN 98 SE it takes up to 5 (five) minutes to program 300 lines of code in a 16F877!.

Fred Eady's parallel programmer does it in 31 seconds, exactly. A pitty is that it's not supporting newer PICs.

This forum is nice!

Agustín Tomás
 
Re: I've heard of PICs used in...

atferrari said:
And keep in mind this: if mothers in law are a concern, every girl in normal circumstances has one behind her. The worst of PICs is the Picstart Plus programmer. With WIN 98 SE it takes up to 5 (five) minutes to program 300 lines of code in a 16F877!.

It's worse than that, even for one line it will take just as long, as it programmes the entire memory every single time!.

A programmer should take about ten seconds per 1K, based on 10mS programming time per word with EEPROM based PIC's, so a full 877 should take about 80 seconds. Using an 877A reduces this significantly, as it programmes four words at a time - so drops to about 20 seconds.

Fred Eady's parallel programmer does it in 31 seconds, exactly. A pitty is that it's not supporting newer PICs.

As far as I'm aware the fastest programmer software is mine, WinPicProg, even back in it's original DOS days (as PicProg) it's only ever programmed as far up memory as required. The very latest versions even skip over single blank words, gaining a few more milliseconds here and there :) - however, this doesn't apply to true FLASH PIC's, you can't skip single bytes when you have to program in sequential blocks off two or four!.
 
Well I just got the Email notice from microchip, it says my samples are coming from tiawain, and the 628's are being shipped the 22nd, and my 877a's are beging shipped Nov. 8. Are these times usually pretty accurate?
Oh well, I'm getting my digikey order friday, so I'm going to have plenty to do with making the driver circuit board.

Are these pic's that I got samples of flash based or eprom based? (Will I need a UV light to erase them?)


On a side note, anyone that has made PCB's before, what did you have your track width, spacing between tracks, and grid set to? I read somewhere to use 12.5mil for width, and 25 mil for the grid and spacing. does this sound good?
 
jrz126 said:
Are these pic's that I got samples of flash based or eprom based? (Will I need a UV light to erase them?)

877A's are FLASH, 628's (or 628A's) are EEPROM (although MicroChip call them FLASH), neither need a UV eraser.

Generally they won't provide UV eraseable JW series chips as samples, presumably due to their high cost? - but I got a 16C745JW as a sample before they stopped suppling them :lol:
 
Well, I just found out some bad/good news (havnt decided on which it is yet, but I think it's bad). My college only offers the microcontrollers class in the fall, so I wont be able to take it in the spring. It looks like I'm going to be learning the code on my own. (which is the only good thing about it because if I learn it on my own now, it will be easier taking the class)

I have a kaypro 4 sitting in my room collecting dust. I found it in the back room of my gradeschool (catholic private school, so they had a bunch of junk) when I was in 8th grade. They let me take it, and I'm hoping that it will be worth a lot of money when I'm in my 60's and I can retire off of it. :wink: (although I'm going to be an Engineer, so I'm going to have plenty of money anyways.)
 
I just looked over the Z80 instruction set - Talk about CISC- its got an instruction for everything but washing the dishes.
 
bmcculla said:
I just looked over the Z80 instruction set - Talk about CISC- its got an instruction for everything but washing the dishes.
thats in there ..its under W... :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top