++++++++++++++++++++ From: "Rod N0RC" To: , "Jerry W. O'Dell" Subject: Re: [Elecraft] PICs Date: Sun, 20 Jan 2002 05:23:55 -0700 Jerry, ----- Original Message ----- From: "Jerry W. O'Dell" To: Sent: Sunday, January 20, 2002 5:07 AM Subject: [Elecraft] PICs > This is way off topic, but I'm fascinated by the Pic controllers > in my K1. I think I could probably make a programmer for them. > Anyone know of a good source for information? Older ham Probably the best place to start is with the book: Easy Pic'N : A Beginners Guide to Using Pic16/17 Microcontrollers from Square 1 by Dave Benson (Not Dave K1SWL of Small Wonder Labs) Here is a link to the Book at Amazon.com http://www.amazon.com/exec/obidos/ASIN/0965416208/qid%3D1011529026/ref %3Dsr%5F11%5F0%5F1/103-1432168-8644606 Microchip, makers of the PIC line have programming software for download, and more information at their website: http://www.microchip.com/1010/index.htm GL 73, Rod N0RC Ft Collins, CO +++++++++++++++++++ Reply-To: "John J. McDonough" From: "John J. McDonough" To: Cc: "Jerry W. O'Dell" Subject: Re: [Elecraft] PICs Date: Sun, 20 Jan 2002 07:46:04 -0500 Good links from Rod. You probably have all you need for a programmer in the junkbox: http://covingtoninnovations.com/noppp/index.html Also, see my version which has gotten quite a bit of use: http://www.qsl.net/wb8rcr/noppp.html I also have a collection of PIC related links at the Midland Club website: http://www.qsl.net/w8kea/001207/MM001215.html 72/73 de WB8RCR http://www.qsl.net/wb8rcr didileydadidah QRP-L #1446 Code Warriors #35 ++++++++++++++++++++ From: "ZOOM" To: , "Jerry W. O'Dell" Subject: Re: [Elecraft] PICs Date: Sun, 20 Jan 2002 09:28:06 -0500 Yes the internet has allot of info on PICs and many PIC controller kits are available. There are also several good books on how to program PICs. A search in Barnes & Noble or Amazon will reveal several. There are some very inexpensive controller kits out there for around $40. I do not suggest buying the all in one PIC kits because they are very expensive. There is plently of info on the net. ++++++++++++++++++++ Date: Sat, 16 Mar 2002 14:13:35 +0000 From: "Leon Heller" To: tcurtola at rogers.com, qrp-l at Lehigh.EDU Subject: [122222] Re: PICs and Microcontrollers Questions >1) Is a "PIC" just a brand name for one of many different >brands/manufacturers of microcontroller? I hear the name thrown around a >lot, is it the "Kleenex" of microcontrollers, that is to say, has become a >generic name? PIC stands for something like Programmable Interface Controller and was originally designed by General Instrument as an I/O device for their 16-bit CPU. It was subsequently developed as a microcontroller by Microchip, who still make them. > >2) Does each different brand or manufacturer use their own programming >language for their specific device? They all have their own different architectures and instruction sets, and hence the assembly language is different for each manufacturer's range. High-level languages like C are available and are processor-independent, to a large extent. > >3) When starting out, is there a favorite manufacturer and/or programming >language for beginners? I've seen that many companies offer their own >starter kits. You'll probably find the Atmel AVR the easiest to work with, as a beginner. It has a decent architecture, unlike the PIC, which can be very confusing for a beginner. Starter kits are quite cheap, or you can build your own hardware. I've got some tips on my web site. > >4) Does the Ham community of microcontroller gurus have a favorite >manufacturer and/or programming language? I would like to learn on the >family of chips and/or programming language that is most prevalent in the >Ham community. PICs and AVRs seem to be most popular, programmed in assembler. Assembler development tools are available free from Atmel and Microchip. 73, Leon -- Leon Heller, G1HSM Tel: +44 1327 359058 Email:leon_heller at hotmail.com My web page: http://www.geocities.com/leon_heller My low-cost Altera Flex design kit: http://www.leonheller.com ++++++++++++++++++++ Date: Sat, 16 Mar 2002 06:53:44 -0800 (PST) From: Patrick Gardella To: tcurtola at rogers.com, Low Power Amateur Radio Discussion Subject: [122226] Re: PICs and Microcontrollers Questions Good questions! PIC is a brand name for the Microchip.com microcontrollers. PIC used to stand for "Progammable Input Controller" (or something close.) There are "clones" (like the ubicom.com SX), but they have tended to spin off into their own lines. So when you hear PIC, they mean PIC. And there are lots of different types of PICs, depending on if you need I/O, A/D conversion, etc. A very common one is the 16F84, or if you want to spend a dollar or so more, you could grab a 16F877. More capable. TyPICally, there is an assembly language for each microcontroller. It's not too tough if you are familiar with computer programming. But you can get many other languages for them. I prefer Forth, but that's just because I'm weird. You can get Basic, C, macro assemblers, etc. Some are free, some cost. I like the free. A simple web search for say "PIC Basic" will find them. I'd suggest starting to learn the assembler. It's the most common language. Starter kit? I'd skip it. You can get PIC books all over the place. I'd start with building a PIC programmer first, then another Ham kit (CW decoder, CW sender, etc). With your own programmer, you don't have to buy the expensive programmers (but more full featured). One of the easiest PIC programmers is the NOPPP (No Parts Pic Programmer), http://www.covingtoninnovations.com/noppp/ No parts meaning you might not have to buy any parts. Works well. Another for the 16F877 is the Wisp or WLoader: http://www.voti.nl/wloader/ The SX chips are more powerful (or so it seems, but less common). Let me know if you have other questions. Patrick KD4LOX ++++++++++++++++ Date: Sat, 16 Mar 2002 10:47:48 -0500 From: "John J. McDonough" To: "Low Power Amateur Radio Discussion" Cc: Subject: [122235] Re: PICs and Microcontrollers Questions A couple of things to add to the info everyone else has provided.... While each different brand of microcontroller has it's own assembler, most of MicroChip's PICs share the same assembler. There are obviously slight differences in memory, I/O, and even instruction width, but they all share the same 35 instructions. The PIC happens to be a Harvard architecture part. Most of the other brands are the more traditional von Neumann architecture. The Harvard architecture may seem a little weird at first, but it ends up not really making much difference when you are programming an embedded application. It does contribute to making the PIC one of the least expensive. You may find Basic or C or whatever a little easier to learn, but the very popular 16F84 is a pretty limited part, and a high level language will put more pressure on the part's very limited resources. On the other hand, the sorts of things you would want to do with a PIC tend to be a little easier in assembler, anyway. I would suggest if you are pretty much clueless about computers, go dive into the assembler. It's a lot like designing with 7400 series logic and not really hard at all. On the other hand, if you already speak C or Basic, and no assembler of any sort, then you may find the assembler pretty counterintuitive, and something like a Basic STAMP or one of the micro C compilers may be a better choice. As far as I can tell, if you want to use something other than the 16F84, you may well have to think through your own programmer, or pay a fairly high price for a commercial programmer. Programming these things isn't all that tough, and MicroChip has some example circuits on their site, so designing your own programmer isn't all that reasonable. In fact, MicroChip has a lot of info about programming the device while it's in the target circuit, which could be a good way to go. On the other hand, the Covington programmer works well for the 16F84 and you would have to have a pretty sorry junkbox to NOT have the parts laying around. BUT, compared to some of the newer parts, the 16F84 is pretty limited and expensive (well, not like $6 is going to break you!) The support circuitry is close to nonexistent for any of them, so converting a circuit you find online to another part isn't rocket science. But you may be comfortable starting out duplicating someone else's project, and there are more examples on the web for the '84 than anything. I have some examples on my web site - look at the NoPPP, CW reader, and counter pages. I also have some tutorial information and more links on the Midland Club web site, http://www.qsl.net/w8kea/, look in the meeting notes. 72/73 de WB8RCR http://www.qsl.net/wb8rcr didileydadidah QRP-L #1446 Code Warriors #35 ----- Original Message ----- From: "Tom Curtola" To: "Low Power Amateur Radio Discussion" Sent: Saturday, March 16, 2002 9:00 AM Subject: PICs and Microcontrollers Questions -- snip -- +++++++++++++++++++++ Date: Sat, 16 Mar 2002 11:10:46 -0500 From: "John P. Cummins, Sr." To: unlisted-recipients:; (no To-header on input) Cc: Low Power Amateur Radio Discussion Subject: [122238] Re: PICs and Microcontrollers Questions I think John was using the 16F84 as an example. A couple of NoGaNaughts are using the PIC chip in different project. We use the 12C509 in the NoGa PiG as the CW keyer and we burn the public domain code for club members using the MicroChip assembler. These chips are really limited but only cost around $1.00 in quantity. Several guys are using the bigger chip in their DDS VFO projects. A couple of us are burning them with the EPIC programmer which only costs around $50 (John os right about the junk box) if you buy it assembled. I have the add on ZIFF sockets to take it all the way up to 48 pins. Having done considerable 1400/1410, 360/370 assembler programming years ago.. these are amazing chips for their size and cost. HTMF "Having Too Much Fun" Pickett, AD4S "John J. McDonough" wrote: > > > BUT, compared to some of the newer parts, the 16F84 is pretty limited and > expensive (well, not like $6 is going to break you!) > +++++++++++++++ Date: Sat, 09 Mar 2002 13:18:46 +0000 From: Brian Short To: tcurtola at rogers.com, qrp-l at lehigh.edu >2) Does each different brand or manufacturer use their own programming >language for their specific device? Generally, no. C compilers are common. That's my suggestion. >3) When starting out, is there a favorite manufacturer and/or programming >language for beginners? I've seen that many companies offer their own >starter kits. Maybe starting out you could consider the NetMedia Basic-X 24. It uses a BASIC type language and provides a number of very powerful features including multitasking, floating point, trig functions, etc. It is pin compatible with the STAMP-2 and very easy to use. >4) Does the Ham community of microcontroller gurus have a favorite >manufacturer and/or programming language? I would like to learn on the >family of chips and/or programming language that is most prevalent in the >Ham community. I find the hobby robotics guys do a lot more with microcontrollers. The 68HC11 has been popular for some time. Presently, the AVR, PICs, and Basic-X 24 are quite popular. Some robot projects use more powerful 68332, ColdFire etc for vision etc. Some use embedded PCs, too. Depends what you want to do. Repeater controller? Keyer? Ider? Again, take a close look at the NetMedia Basic-X 24 to start out. Then, look at the AVR and/or PIC depending on your needs. Use a good C compiler and/or assembler. BTW, I have some examples on my web page: http://www.k7on.com/software/micros.htm http://www.k7on.com/robotics/madmaxsw.htm I really need to update and put more of my projects online. Just my $0.02 USD, Brian -- brian at k7on.com >or< http://www.k7on.com/ -- ++++++++++++++ Date: Sat, 16 Mar 2002 12:27:43 -0500 From: "John J. McDonough" To: "Low Power Amateur Radio Discussion" Subject: [122243] Re: PICs and Microcontrollers Questions ----- Original Message ----- From: "John P. Cummins, Sr." Subject: Re: PICs and Microcontrollers Questions > I think John was using the 16F84 as an example. A couple of NoGaNaughts > are using the PIC chip in different project. We use the 12C509 in the That's something I didn't mention, and nobody else did, either. The 16F84 keeps it's program in FLASH memory. This makes it relatively expensive, but you can reprogram the part over and over. This makes it popular for experimentation and one-off projects. Commercial offerings are almost always based on one of the 12Cxxx or 16Cxxx parts which can only be programmed once, but are a lot less expensive. There are also some UV ROM parts, but compared to FLASH they are a pain, so not very popular. The 16F84 also has a little bit of EEPROM for nonvolatile parameter storage. It can be handy for some applications, but EEPROM-less parts are also available as this is not needed for all applications. > Having done considerable 1400/1410, 360/370 assembler programming years > ago.. these are amazing chips for their size and cost. Pickett!! Don't tell me you're an old Autocoder guy. Just the other day I was wondering whether any of that stuff survived Y2K. 72/73 de WB8RCR http://www.qsl.net/wb8rcr didileydadidah QRP-L #1446 Code Warriors #35 +++++++++++++++++ Date: Sat, 16 Mar 2002 13:40:20 -0500 From: Steven Weber To: qrp-l at lehigh.edu Subject: [122255] Re: PICs and Microcontrollers Questions I guess I'll weigh in too.. For some reason, PIC's do tend to dominate the hobby market, guess because they were one of the first low cost uP's widely available. But they are pretty clunky to use. About the only good feature they have is the fast prescaller input for the counter, which makes making frequency counters farily easy to do. They finally have Flash memory versions, but all the low end units are still OTP (one time program) or eprom. That means you have to buy the expenisve eprom version to develop code with, a uv eraser lamp and wait 20 minutes for the chip to erase before you can try a correction to your program. That can really slow you down. I much perfer the Atmel AVR chips. These are all Flash memory, have built in EEPROM, a much more extensive and sane instruction set, run four times faster than a PIC for the same clock speed and are very reasonably priced. Digi-Key sells a starter kit for only $49.00 which will program almost all of the AVR series chips, software and a sample chip. I also like the old 8051 series of cpu's, and thier more recent derivatives, but programmers for those are less widely available. As for learing how to program, if you are a complete novice, I'd go right to learning the assembly code. Before you start, you need to have a clear conception of what it is you want to do. A good first program to try is a simple keyer, as it's a well defined task, and makes you learn how to use many of the fundimental functions of the cpu. 72, Steve, KD1JV "Melt Solder" White Mountains of New Hampshire http://www.qsl.net/kd1jv/ +++++++++++++++ Date: Sat, 16 Mar 2002 12:08:43 -0800 From: "Trevor Jacobs" To: , "Low Power Amateur Radio Discussion" Subject: [122260] Re: PICs and Microcontrollers Questions Hi Steve and all, Nice topic! I myself agree with Steve 100% and find the PIC's a bit "clunky" as far as the programming goes. I guess that's because when I started programming, I was using Intel 8088 based stuff, and Motorola 6800 and was used to having a bit more of an instruction set, especially the math functions. My personal favorite for hobby stuff is the Intel 8051/52 and derivative Micros from various companies like Atmel, Philips, and Dallas. These chips have very nice features and are inexpensive to use. The Atmel line is available from Digi-Key. There are plans for programmers and assemblers all over the web. For an assembler I'd suggest the Metalink ASM51. It's free and available on the Atmel web site. There are also plans for building a programmer on the Atmel site. If you want to give the 8051 stuff a try, I reccomend a book called "Programming and Interfacing the 8051 Microcontroller" by Sencer Yerelan and Ashutosh Ahluwalia. You can find it at Amazon. The Atmel AVR stuff looks very nice also and has a very good instruction set. It really depends on what you want to do. One really nice application of the PIC is the little Tick Keyers, and an 8051 might be a bit overblown for a project like this, but for the DDS VFO that I've been designing for a while, the 8051 was a great choice. I'd suggest getting a couple of books and reading a bit about it first, and also experimenting with different simple projects to see what you like. Hope this helps. 72/73's Trev KG6CYN ++++++++++++++++ Date: Sat, 16 Mar 2002 16:21:10 -0500 From: "Mike Yetsko" To: , "Low Power Amateur Radio Discussion" Subject: [122267] Re: PICs and Microcontrollers Questions Just to weigh in here with more comments... I like the PIC. In fact, I was going to use one of the little 8-pin guys in a weather project I'm working on. But I quickly discovered that while you can use these things just fine with the internal RC circuit, you CANNOT do reliable timing or A2D without a crystal. And that means giving up 2 pins... So... I switched to the Z8+. I'm interfacing to a 6811 based product, so I know the 11, and yes, it IS neat, but overkill in this. And the 51 is neat too, I've done projects with that (and done keyboard controllers with it!) but again, overkill. The Z8+ is a neat part. No, there are no 'erasable' parts. OTP only. I was using CMOS PICs and then buring an OTP PIC when I hit a 'milestone' and wanted to keep it. And I have the complete PICstart package, so in the future I can do almost any PIC I choose. But while the Z8+ only has OTP parts, the whole EMULATOR / PROGRAMMER was only $99. This lets me step through stuff and really debug easily. Something I couldn't do with the PIC. The only downside is the Z8+ ICE only works at 10MHz, so I had to put switches in my code to assemble for 10MHz or 8MHz. Big deal... Being able to single step and see variables change was a great step up from what I was doing on the PIC. But I DO have to admit, the PIC was a neat little part. Mike +++++++++++++++++ Date: Sat, 16 Mar 2002 16:51:26 -0800 From: "Ian Wilson" To: "Low Power Amateur Radio Discussion" Subject: [122283] Re: PICs and Microcontrollers Questions Quick plug: I use the programmer from Dontronics (www.dontronics.com). Works well, slots right into MPASM and was a good price when I bought it. No connection, just a satisfied user. -- ian k3imw/6 +++++++++++++++++ Date: Sat, 16 Mar 2002 20:11:46 -0500 From: "Tom Curtola" To: , "Low Power Amateur Radio Discussion" Subject: [122287] Re: PICs and Microcontrollers Questions Thanks a million fellas for the responses I got from the list and direct email. Amazing help from each and everyone of you. So far I garnered that PICs are historically the most prevalent and cheapest, but not always the best way to go. ATMEL's AVRs seem to be the up and coming star and easier for the beginner according to many on the list and many web sites. These two brands were repeatedly mentioned and seemed to be the most widely used brands. There was a third one, Parallax's STAMP microcontroller which seems to be out there too. Lot's of advice on using assembler first if I haven't coded before. (I guess that is akin to using a straight key first before moving on to a keyer hi hi) Some have advised against using a starter kit and others have promoted one type of starter kit or another. I have looked at all the web sites everyone mentioned (my ass is sore from sitting all day believe me). One site caught my attention http://www.electronics123.com/amazon/ and under their PIC and ATMEL programmers link I have come across several choices. If anyone would like to peruse their page on programmers at http://www.electronics123.com/amazon/catalogue/c3-3-7.htm and give your advice/opinion on their offerings I would greatly appreciate it. Another good site recommended was http://www.dontronics.com/ So now you have helped me clear up some of my questions, and I think I can start to understand what I need to know, to make a better informed decision. Gads, that sounds like something a politician would say. 73/72 Tom Curtola VA3TY Toronto, Ontario - Canada tcurtola at rogers.com PS: I know some might believe this has nothing to do with QRP but I've been noticing more and more electronics using microcontrollers. Seems there is almost nothing these puppies can't do in the hands of a good programmer. (I'm hoping to be able to just get that LED to flash on and off) Betcha in 10 years there won't be a QRP rig without one in it. Yes, I could have started this thread on a list dedicated to microcontrollers but again would they have the knowledge of QRP/HAM radio to know what would be best for me? +++++++++++++++++++ Date: Sat, 16 Mar 2002 22:35:51 -0500 From: David Hinerman To: qrp-l at lehigh.edu Subject: [122298] Re: PICs and Microcontrollers Questions At 08:11 PM 3/16/02 -0500, you wrote: >PS: I know some might believe this has nothing to do with QRP but I've been >noticing more and more electronics using microcontrollers. Seems there is >almost nothing these puppies can't do in the hands of a good programmer. Tom, Well, there is -one- thing they can't do: they can't make the internally generated noise in a receiver lower. That's a chronic problem with using micros in sensitive analog gear. >(I'm hoping to be able to just get that LED to flash on and off) That's always a big day at work - when we get a "heartbeat." My hardware engineers know better than to bring me a prototype without at least an LED that I can blink with code. >Betcha in 10 years there won't be a QRP rig without one in it. Oh, it's much worse than you think - all these little TiCK keyer chips that people are putting into Pixies, SMK-1s, and other basic rigs are actually PICs with some finely crafted code burned into them. In 10 years, the only rigs that won't have them will be the "mint" HW-7s being sold to collectors on eBay. Computers are tools, just like soldering irons or transistors. Your choice of tools depends on what you're trying to accomplish, your comfort level with existing tools, and the desire to learn to use new tools. (In my case, cost factors in too.) Try to not let religious zealots coerce you into using their object of worship (PIC, BASIC, C, whatever) if you're not convinced it's a suitable tool. On the other hand, don't get caught up in "analysis paralysis," the inability to choose one tool over another because they both look like they'd do the job. When choosing among tools, it's usually easy to rule out the obviously wrong candidates. Anything left after that is good enough, so flip a coin and move on. As I have to remind my boss sometimes: "There's more than one way to code a cat." Dave ----------------------- Dave Hinerman WD8CIV at worldnet.att.net ++++++++++++++++++++ Date: Sat, 16 Mar 2002 22:15:30 -0500 From: David Hinerman To: qrp-l at lehigh.edu Subject: [122299] Re: PICs and Microcontrollers Questions At 01:40 PM 3/16/02 -0500, you wrote: >As for learing how to program, if you are a complete novice, I'd go right >to learning the assembly code. Before you start, you need to have a clear >conception of what it is you want to do. A good first program to try is a >simple keyer, as it's a well defined task, and makes you learn how to use >many of the fundimental functions of the cpu. Steve, A good point - while I recommended learning C earlier, the fact is most Ham applications for microcontrollers are just that - control applications. (A keyer, DDS controller, etc.) Anything else that requires massive data processing gets done on a PC. When controlling hardware, some assembly language is almost always mandatory. In many cases it takes more "dirty tricks" to get C to interface with hardware than it does to just write the program in assembly. (Some people would claim that writing the whole program in assembly is just one big dirty trick, but I say if it's the right tool for the job, use it.) Dave ++++++++++++++++++++ Date: Sun, 17 Mar 2002 07:07:53 -0500 From: "Mike, Diane and Vicky" To: "qrp-l" Subject: [122319] PICs and Micro controllers Questions Tom: 1) Is a "PIC" just a brand name for one of many different brands/manufacturers of micro controller? I hear the name thrown around a lot, is it the "Kleenex" of micro controllers, that is to say, has become a generic name? Ans: I believe that Microchip brand is the only one that use the word "PIC" in their advertising. 2) Does each different brand or manufacturer use their own programming language for their specific device? ANS: This is generally true. I have been involved with micro controllers from many different manufactures. INTEL, Motorola and lots of Japanese parts. They are different. However there are some architectures that have been widely copied and/or licensed - one of these is the venerable 8051, which you will discover in many formats and variations. One way to combat this is to use embedded C programming for development. This code can usually be ported to alternate architectures. This decision usually requires a processor with more horsepower than the minimum. 3) When starting out, is there a favorite manufacturer and/or programming language for beginners? I've seen that many companies offer their own starter kits. ANS: Not only is there are wide selection of starter kits there is also a great quantity of freeware and demo software tools that are quite useful for education or hobby usage. You may find a C-compiler and debugger in demo form that is entirely functional but limits program size. 4) Does the Ham community of micro controller gurus have a favorite manufacturer and/or programming language? I would like to learn on the family of chips and/or programming language that is most prevalent in the Ham community. ANS: I think that Microchip (PIC controllers) has done a great job marketing to the general public and thereby become accepted by industry also. They offer parts through catalog distributors along with inexpensive tools. Five years ago I would have suggested that the most popular micro was an Intel 8051 derivative or perhaps a Motorola 6805 - but I think Microchip has really cornered this small controller market. ++++++++++++++++++ From: "Bob - AG5Q" To: , "Timothy A. Raymer" Subject: Re: [Elecraft] PIC Stuff Date: Fri, 22 Nov 2002 09:15:21 -0600 Hi Tim, Several years ago when I started learning about the PIC, I found the Microchip simulator to be very helpful. With that you can step through programs and see what's happening. At that time it was free, maybe it still is. Microchip has some newer development tools listed on this page: http://www.microchip.com/1010/pline/tools/archive/mpsim/index.htm HTH. 73, Bob - AG5Q ----- Original Message ----- From: "Timothy A. Raymer" To: Sent: Friday, November 22, 2002 8:25 AM Subject: [Elecraft] PIC Stuff > I have a friend working on a project with a PIC 16F872. He has written a > program that for now just clears all the registers and a few other basic > things. Problem is, the program won't consistently run until after hitting > the reset a bunch of times. After it runs, the reset button will > consistently start the program, but it is not happy from a cold > boot. Resonator comes up, but CPU is not happy. > > Back when I was Microcontrollering with the Motorolla 68HC11, we had a > program that was called BUFFALO, or bit user friendly aid to Logical > operation. BUFFALO was the base code that made things happy no matter what > a naive college student did. Is there something like this for the PIC > series? Where is a good place to look on the web for more information? > > Thanks. > > Tim Raymer > Timothy A. Raymer > Missouri Department of Health > and Senior Services +++++++++++++++ Date: Fri, 22 Nov 2002 08:28:58 -0800 From: Wayne Burdick Organization: Elecraft To: "Timothy A. Raymer" Cc: elecraft at mailman.qth.net Subject: [Elecraft] Re: PIC Stuff Tim, Buffalo was a "monitor" program for the HC11, which also had an assembler/disassembler built in. I used it a lot some 10 years ago before switching to PICs. Your friend's problem could be caused by any number of things--including a bad PIC. Try turning on the on-chip brownout (low voltage) detect. Make sure the watchdog timer is disabled. Try a crystal instead of a resonator, in case the resonator is bad. Call the programmer's manufacturer: the unit could have a bug when programming the F-series parts. But usually this comes down to a problem with the program. There are lots of ways to initialize registers incorrectly. You could also have a stack overflow/underflow happening--this is more likely if you use assembly language to write the code, as the compilers keep track of such things. This PIC probably has a stack-overflow internal reset option (fuse) you can set. A fully-loaded K2 has six to 8 PICs, all talking on the auxBus with no difficulty, so I can say with some certainty that these things work ;) Wayne "Timothy A. Raymer" wrote: > > I have a friend working on a project with a PIC 16F872. He has written a > program that for now just clears all the registers and a few other basic > things. Problem is, the program won't consistently run until after hitting > the reset a bunch of times. After it runs, the reset button will > consistently start the program, but it is not happy from a cold > boot. Resonator comes up, but CPU is not happy. -- snip -- +++++++++++++++ Date: Fri, 22 Nov 2002 08:39:38 -0800 From: Wayne Burdick Organization: Elecraft To: "John J. McDonough" Cc: elecraft at mailman.qth.net, "Timothy A. Raymer" Subject: Re: [Elecraft] PIC Stuff Good suggestions, John. Regarding crystal vs. resonator: paradoxically, the resonator is more likely to start up than a crystal, assuming the resonator is not bad. The on-chip oscillator needs noise to kick it into action. The resonators are "noisier" (lower Q), and in my experience, they never fail to start. I've seen some cuts of crystal fail because their Q is actually too high, requiring a resistor in parallel or series to make them happy. One thing I'd suggest is using the "HS" oscillator mode. This increases oscillator current and gain, and can make marginal crystals or resonators come up more quickly. Wayne "John J. McDonough" wrote: > > Try setting the power up timer in the configuration bits. Also, check that > the configuration bits are set right for the resonator. > > You might also try a crystal instead of the resonator - might get a cleaner > startup. > > 72/73 de WB8RCR +++++++++++++++++ Date: Fri, 22 Nov 2002 19:22:00 -0500 To: elecraft at mailman.qth.net From: Kevin Cozens Subject: Re: [Elecraft] PIC Stuff Greetings, Tim. At the risk of stating the obvious, check the reset circuit. You need to ensure that the reset line stays low for at least as long as is stated in the documentation for the PIC. Next, the first instruction to execute when the program begins to run after exiting the reset state is to disable ALL interrupts. While interrupts are disabled, you configure any timers, and internal/external devices that can provide interrupts. Only once all hardware is initialized should you allow the PIC to accept interrupts. Cheers! Kevin. (http://www.interlog.com/~kcozens/) Owner of Elecraft K2 #2172 |"What are we going to do today, Borg?" E-mail:kcozens at interlog dot com|"Same thing we always do, Pinkutus: Packet:ve3syb at ve3yra.#con.on.ca.na| Try to assimilate the world!" #include | -Pinkutus & the Borg +++++++++++++++ Date: Fri, 22 Nov 2002 18:00:11 -0800 From: Jerry Hancock Subject: RE: [Elecraft] PIC Stuff To: "Timothy A. Raymer" , elecraft at mailman.qth.net Reply-To: jehancoc at pacbell.net Sounds like the GIE (global interrupts) are enabled. The start of your code should look something like this: Org 0 Goto start ; interrupt vector is at 0x04 ; unless you branch around it ; or make sure that GIE and other interrupts are ; off, you will occasionally branch to 0x04 org 16 Start: crlf porta etc ++++++++++++++ Date: Sat, 23 Nov 2002 09:20:34 -0800 From: Wayne Burdick Organization: Elecraft To: Bob - AG5Q Cc: elecraft at mailman.qth.net Subject: Re: [Elecraft] Pic stuff Bob - AG5Q wrote: > > I spent 2-3 years programming the PIC in assembly language and found it to > be interesting but tedious, even though I have done a lot of assembly coding > on other processors. Later, for business reasons, we switched to an > STMicroelectronic ST7 processor. Then I got a plain C compiler and found it > to be much, much easier..... I definitely concur, Bob. About 90% of the K2 PIC code is written in C. We used assembly only when necessary. Wayne ++++++++++++++++ Reply-To: "John J. McDonough" From: "John J. McDonough" To: Cc: "Dan Barker" Subject: Re: [Elecraft] Angle of attack - PIC Question - WAY off topic! Date: Mon, 2 Jun 2003 13:02:56 -0400 Dan, You might think a little about the design. With most microcontrollers, the math is a little tough. They are pretty simple devices and dealing with sensor data takes quit a bit of thought (and programming). The most popular, by far, PIC is the 16F84. This part needs only to have a crystal and +5 applied and away you go. (You can get away with an RC circuit or a resonator, but with teeny crystals at less than a buck at DigiKey, why bother.) There are better parts, but the 16F84 has remained popular because there are simple programming circuits out there, and no cost assembly and programming code. Some of the other PIC parts are actually easier to program, and can be programmed in-circuit (actually, the F84 can too, but typically isn't). However, the free software for these generally only works with expensive programmers, so getting started cheap is a bit of a challenge. The problem is, for your application, the F84 doesn't have any analog I/O. Sounds like you don't need any analog output, so there are quite a number of parts with analog in which you could use, but you may find actually programming them to be an expensive proposition. I wonder, though, if comparators on your sensors to provide go/no-go to the micro wouldn't be a better plan. This would allow you to adjust the setpoints (via trimpots) in the field as it were, without having to go back and reprogram the part. It would up the parts count some, but would allow you to get started with minimal pain. The programmer for the 16F84 can be built out of parts that you should have in the junk box. (http://covingtoninnovations.com/noppp/index.html) The toughest part is the 18 pin socket. A year or so ago I priced out building one entirely from new parts at Radio Shack, and it came to around $15. You would have to search pretty far to find a way to get the price much higher than that. If I recall, I built mine entirely from the junk box. If you go to Microchip's website, they have a tech note on in circuit programming. This could be a great convenience, but you need to plan for it in your original circuit. The available freeware, however, expects you to have a purpose-built programmer. Actually programming the part isn't all that painful, so if you're willing to spend the time to write the actual programming software, you could open yourself up to some of the other parts, and have the added advantage of in circuit programming. Not only is this a great convenience, but you could also choose surface mount flavors, saving some weight. Another little detail ... the most obvious flavor is the 16F84A-20/P. This is a 20 MHz part, and is about the cheapest of the 84's. However, if your design requires writing to the EEPROM frequently, you may choose the 16F84-10/P. The EEPROM on the A part can stand significantly fewer write cycles. The 10 MHz not-A part is about a buck more than the 20 MHz A part. Hope this helps. 72/73 de WB8RCR http://www.qsl.net/wb8rcr didileydadidah QRP-L #1446 Code Warriors #35 ----- Original Message ----- From: "Dan Barker" To: "Elecraft" Sent: Monday, June 02, 2003 12:35 PM Subject: [Elecraft] Angle of attack - PIC Question - WAY off topic! > I know this is the wrong forum, but there's so much brain-power here, I just > had to ask. > > Answers could include: > > a) the forum, or > > b) a part number. +++++++++++++++ From: "Bob - AG5Q" To: "Dan Barker" , "Elecraft" Subject: Re: [Elecraft] Angle of attack - PIC Question - WAY off topic! Date: Mon, 2 Jun 2003 15:25:46 -0500 Hi Dan, The PIC is a really nice little processor and the cost is low. I've used the PIC and it's good, although the assembly language is awkward to use. They have some new chips like the 16F876A and the 18F242 which are much better than the chips that were available 5 years ago. The recommended development kit is DV164006. However, this does not include the 'C' compiler. The biggest problem with most small micros is acquiring the development tools and learning to use them. This can cost a several hundred dollars. Even the tools for the PIC are in this range unless you program in assembly language, in which case the development tools are only a few dollars but the programming task is much harder than doing it in 'C'. Recently Zilog has come out with a nice controller they call the eZ8 Encore. They have a very nice development board and a complete 'C' compiler (not a limited version, like most low cost kits). This is only $50 and the chips themselves are in the $5-$10 range. You can even get the chips in dip packages, which is a real plus for home assembly. I've been playing with one of these and it's a friendly development system. Mouser has them, part #692-Z8ENCORE000ZC0. 73/ Bob - AG5Q > > I I need a PIC controller for my new gizmo. It will most likely turn > into a Finite State Automaton, with states and events to control: > ++++++++++++++++++ From: "Robert Parker" To: "Bob - AG5Q" , "Dan Barker" , "Elecraft" Subject: Re: [Elecraft] Angle of attack - PIC Question - WAY off topic! Date: Mon, 2 Jun 2003 16:49:29 -0400 There are allot of demo software for pics and allow allot of flexibility so for small programs, the demo is all you need. Also look at the NJQRP club. They offer a daughterboard for the motorola HC-908. Sure to be a real pleasure with Hams. Software is ready available. See: http://www.njqrp.org/hc908/index.html Regards, Robert VE3RPF +++++++++++++++++