PIC or AVR

Status
Not open for further replies.

They usually only take a few days.


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

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.


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)
 

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


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:
 
Re: I've heard of PICs used in...

williB said:
I too started on the Z80

I started on the 6502, a 'Tangerine Microtan 65', which I've still got (but hasn't been plugged in for a great many years)
 
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...
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…