Previous in Forum: Moving files   Next in Forum: Settings for exporting to DXF format .
Close
Close
Close
23 comments
Rate Comments: Nested
Power-User
United States - Member - Donald here, Campbell Lighting Co. Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Sep 2006
Location: central arkansas
Posts: 337

microprocessors

10/20/2007 2:36 PM

We are starting a new electronic project, and need to use a microprocessor.

Are these units hard to program, and what would I need to get started with that?

Also, we have a few of those laying around from other projects, and my electronics guru just left for another tour in Irak, so I wondered if I can read those and see if they are something we can use in our new project?

Any ideas?

Donald

__________________
Check out our home page for specs on "Soft Neon"
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#1

Re: microprocessors

10/20/2007 3:51 PM

The PIC microcontrollers have readilly available development kits, come in a huge variety of sizes and have plenty of examples and application well documented.

My personal recomendation is to try and get hard copies of the manuals as trying to get started by reading what is on a screen is impossible ...you will need to do plenty of reading before you get to grips with your controller...there are plenty of pic 'cook books' and such like to shoose from. Start with a small simple pic just to get going...easy to upgrade once you have mastered the basics.

Have fun

Del (I use Zilog Z86 parts myself)

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#2

Re: microprocessors

10/20/2007 4:02 PM

"We are starting a new electronic project, and need to use a microprocessor."

Depends what you want to do in your project. You can use some version or other of a microprocessor to control just about anything from traffic lights to a CAT scanner.

"Are these units hard to program, and what would I need to get started with that?"

Again, all depends. To get started, I would suggest something from the Microchip PIC range. Have a look at:

http://rswww.com/cgi-bin/bv/rswww/searchBrowseAction.do?obs=sObs&name=SiteStandard&No=0&N=0&Ntk=I18NAll&Ntt=microchip%20pic%20kit&Nty=1&D=microchip%20pic%20kit&Ntx=mode%20matchpartial&Dx=mode%20matchpartial&callingPage=/jsp/search/search.jsp&BV_SessionID=@@@@1938650329.1192909387@@@@&BV_EngineID=ccceaddmflhmfelcefeceeldgondhgi.0&cacheID=ukie&Nr=avl:uk

If that 'orrible looking link doesn't work, go to www.rswww.com and search for

microchip pic kit

"Also, we have a few of those laying around..."

Depends what they are. Have you got the gubbins to read them? Are the manuals there? If you're starting a new project, it's probably as well to start from scratch with new hardware - it doesn't cost much.

John

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Hobbies - HAM Radio - New Member United Kingdom - Big Ben - New Member Fans of Old Computers - Altair 8800 - New Member Canada - Member - New Member

Join Date: Jun 2006
Location: Toronto
Posts: 3968
Good Answers: 120
#3

Re: microprocessors

10/20/2007 11:49 PM
__________________
Per Ardua Ad Astra
Register to Reply
Guru
Safety - Hazmat - New Member Safety - ESD - New Member Engineering Fields - Transportation Engineering - New Member Popular Science - Evolution - New Member Technical Fields - Procurement - New Member Hobbies - Target Shooting - New Member Popular Science - Cosmology - New Member Engineering Fields - Architectural Engineering - New Member Technical Fields - Marketing/Advertising - New Member Engineering Fields - Food Process Engineering - New Member

Join Date: Dec 2005
Location: Mariposa Ca
Posts: 5800
Good Answers: 114
#4

Re: microprocessors

10/21/2007 12:08 AM

More details will yeild more answers.

do you mean PLC's?

what brand & model

are they programmed using a specialzed programmer or PC?

Some sections of the programs may be useful, depending on your intended project.

Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#5

Re: microprocessors

10/21/2007 4:17 AM

The path upward sounds like it is going to be really hard for you, at least at first...

I second the PIC idea as you can learn from a Tutorial in a relatively short time to do quite useful things quickly....always good for your self esteem!

Make sure that you pick (no pun intended) a PIC that is fully supported with tutorials and examples and a programmer that falls within your budget. Make sure that the cables to go from PC to programmer are included as well as the assembler etc., often a free assembler is enough to get going....

In the UK for example, you would need to lay out around $100 and have a PC/Laptop for programming. Age of PC usually not too important, speed neither......at a guess Win98SE or later, no internet connection needed as long as you can download somewhere else and pass it via a CD or similar to the programming PC.

There are several UK electronics magazines that have run courses and you could purchase back copies, the hardware is available as a kit to buy from advertisers in the Mag, all software on CDs from the magazine and a lot of support help.....If you need further details just ask via a CR4 email to me.....or in this forum.

You can always go back to the chips that are lying around at your home/office (you did not say what they were, an important omission!) later when you are fully up to speed!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Guru
Philippines - Member - New Member Engineering Fields - Instrumentation Engineering - New Member Engineering Fields - Control Engineering - Who am I?

Join Date: Oct 2006
Location: Northern Mindanao, Philippines
Posts: 2147
Good Answers: 53
#6

Re: microprocessors

10/21/2007 7:29 AM

I don't know if you mean microprocessor or micro-controller but in case it is a microprocessor, programming it is not difficult. It's getting the program into the ROM that's difficult.

If you have a ROM programmer/burner, this won't be much of a problem. You create your program on your PC, connect your ROM burner, bung in your chip and make the transfer.

Back when I was using microprocessors, I built a contraption that burned the ROM one address at a time. It was painstaking work. One mistake and the whole chip was useless. I finally graduated to a real burner and things were easy as pie.

__________________
Miscommunication: when what people heard you say differs from what you said. Make yourself understood.
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#7
In reply to #6

Re: microprocessors

10/21/2007 7:40 AM

PICs are much easier, you switch a pin of the PIC to a specific voltage and pass data to it. That is a bit simply said, but it doesn't amount to much more than that really....a PIC programmer handles that and an average PC and the correct data cable is the rest of the hardware. Software is free for the good PICs....

Which is one of the many reasons I (and someone else I believe) recommended a PIC as a good place to start to learn!!!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Power-User
United States - Member - Donald here, Campbell Lighting Co. Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Sep 2006
Location: central arkansas
Posts: 337
#8

Re: microprocessors

10/21/2007 3:08 PM

Oh sorry guys, I forgot to tell you what I have found on the work bench where my Electronics guy WAS working.. :o(

These are 18 prong, and one has PIC 16f716 on it, the other has PIC 16c711 on it.

Sounds geek to me..

Thanks all you smart guys, i love this site...

Donald

__________________
Check out our home page for specs on "Soft Neon"
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#9
In reply to #8

Re: microprocessors

10/21/2007 3:30 PM

THOSE ARE THE EXACT PICs I WAS REFERRING TO!!!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Power-User
United States - Member - Donald here, Campbell Lighting Co. Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Sep 2006
Location: central arkansas
Posts: 337
#10
In reply to #9

Re: microprocessors

10/21/2007 5:00 PM

Thanks Andy... and everybody....

http://www.piclist.com/techref/microchip/pocketprog.htm

does this look like it might help me understand it all?

donald

__________________
Check out our home page for specs on "Soft Neon"
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#11
In reply to #10

Re: microprocessors

10/22/2007 6:34 AM

Yes, but why not use something that is still supported and used? Check out this magazine and back numbers:-

This is the book you need

This is the magazine to order or get as a download each month. Check thru the back issues for interesting PIC articles and training.

This is the company that produces the kits for the programmer and other units for PICs - metal detectors and what have you!

This is the order form for the book.

All this was taken from a recent copy of EPE.....

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#12
In reply to #10

Re: microprocessors

10/22/2007 7:34 AM

... or there's a dev. system produced by Microchip, available from RS Components (PICkit 2 Starter Kit, RS stock no. 615-3059, £27.50). It's ready to plug in & go.

From the datasheet:

Features
Low pin count demo board supporting 8/14/20-pin mid-range PlCmicro microcontrollers
Fasy to use Windows programming selected Flash based PlCmicro microcontrollers
Twelve sequential lessons wiitten in Assembly demonstrate how to use Microchip's 8/14/20-pin Flash family of microcontrollers
Technical documentation CD including
— PICkit 2 User's Guide
— Low Pin Count Demo Board User's Guide
— Tips n Tricks Booklets
— Selected Application Notes
FREE! Microchip's MPLAB IDE software for a complete code development environment
FREE! HI-TECH PICC LITE C Compiler (contained on the MPLAB CD)

PiCkit 2 Starter Kit Contents
PICkit 2 Development Programmer
Low Pin Count Demo Board with 20-pin PICI6E69O
PICIKit 2 Starter Kit CD ROM
MPLAB IDE (Integrated Development Environment) CDROM -
Software and Hardware "Tips n Tricks" for PlC Microcontrollers

USB Interlace Cable

Host System Requirements

PC-compatible system with an Intel Pentium class or higher processor, or equivalent
CD-ROM drive
Available USB port
Microsoft Windows 98 SE, Windows 2000 or Windows XP

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#19
In reply to #10

Re: microprocessors

10/26/2007 8:46 AM

The magazine I mentioned before has just started a new series with a new PIC programmer, you could be in on the ground floor. I can highly recommend them as they have been showing private persons the way to PIC programming for many years now, in an economical manner, that the average Joe can afford and fully understand....

If you want more details just let me know (or anyone else for that matter!)

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Power-User
United States - Member - Donald here, Campbell Lighting Co. Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Sep 2006
Location: central arkansas
Posts: 337
#13

Re: microprocessors

10/22/2007 9:51 AM

Thanks Guys, you've been a Big Help.. I feel like we're half way there already.

Donald

__________________
Check out our home page for specs on "Soft Neon"
Register to Reply
Commentator

Join Date: Sep 2006
Location: Cleveland, Ohio USA
Posts: 98
Good Answers: 2
#14

Re: microprocessors

10/24/2007 8:52 AM

Programming a microprocessor can be very easy, and is extremely powerful in want you are able to do. Most of the work is in the setup, so be meticulous about that:

- Start with the standard variables associated with your chosen microprocessor (timers, interrupts, port settings ...) and assign suitable values for each as you read the users manual describing the function of each variable.

- Add "constants" of your own.

- Most important: be sure to write good detailed comments with each variable and constant indicating what they do (include page number to the explanation in the users manual)

- Write a detailed outline of what you want to do. This means writing each task as a (nearly) line by line subroutine, showing decisions and branches.

- Create names variables that will hold the data and flag status bits for each subroutine.

- Have a good block diagram showing program flow. Expect to change it a few times as ways to simplify the arrangement become apparent.

All this happens before you write any code! Once this "up front" work has been done, it is a simple matter of choosing the assembly instructions which correspond to your detailed subroutines.

One other hint: It is a good idea to start up the program with a simple "straight forward" portion that is easy to debug, and will give you a foothold to build from.

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#15
In reply to #14

Re: microprocessors

10/24/2007 3:58 PM

Agree with all of the above (in an ideal world - I know I should really do it every time!).

Just like to amplify on:

(Quote) "One other hint: It is a good idea to start up the program with a simple "straight forward" portion that is easy to debug, and will give you a foothold to build from."

A good way to go about this is to use "stubs". Start off with a main chunk of code (call it "main" if you like!), which calls subroutines (or procedures or whatever the nomenclature in your manual) to do each of the operations you need your micro to perform.

Initially, each of these can be written as a "stub", doing a fixed task (e.g. setting an output bit on or off, returning a constant value for a function-type call or even doing nothing at all). You can then gradually replace these stubs with the real code. Retain the original code as a comment, so it is easy to comment out your new code and revert to the stub code if something behaves unexpectedly elsewhere in the program.

Hope I'm not teaching my grandmother to suck eggs,

Happy programming, Donald,

Regards, John

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#16
In reply to #15

Re: microprocessors

10/24/2007 5:46 PM

Hi JohnDG,

even if your comment was true:-

Hope I'm not teaching my grandmother to suck eggs

I would hope that the rest of us would see it as being valid and a good comment that nobody else has made up to now and keep any nasty comments to themselves.

I liked it, it is good advice for any programmer, new or old.

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Power-User
United States - Member - Donald here, Campbell Lighting Co. Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Sep 2006
Location: central arkansas
Posts: 337
#17
In reply to #16

Re: microprocessors

10/24/2007 7:13 PM

Why do people have to make those nasty comments anyway. It reminds of the chat programs that young immature minds engage in..

I REALLY (not screaming, just emphasis), do appreciate all the brilliant minds on this site, and certainly everyones comments and help.

Fortunately for me, I am finding help with this project as my Guru needed to further serve his country, and I am proud of him for that..

It's just weird for this 60 year old mind of mine to have to learn more new tricks, that's why I solicit the brilliant, active minds of the CR4 community.. :o)

Donald

__________________
Check out our home page for specs on "Soft Neon"
Register to Reply
Commentator

Join Date: Sep 2006
Location: Cleveland, Ohio USA
Posts: 98
Good Answers: 2
#18
In reply to #15

Re: microprocessors

10/26/2007 8:37 AM

I thought the idea of using "stubs" was an excellent approach to software development. It brings to mind another important technique: Error Trapping.

-Write a subroutine that "captures" error codes and records/displays them in some way. This is especially useful in early development, but can evolve to handle anomalies in the finished product.

- Always consider the alternatives in each branch of code. When a branch would lead to a functional problem, give it a number and pass that to the "Error Sub".

- When you write code and are unsure of the outcome (i.e. Will this NEVER happen?), assign en error code to the branch that is never expected to be followed.

- Group error codes by type: say 10 to 19 are related to a motor function, 20 to 29 are anomalies ...

- set up the error sub to record the number of times each error occurs.

Register to Reply
Guru
Philippines - Member - New Member Engineering Fields - Instrumentation Engineering - New Member Engineering Fields - Control Engineering - Who am I?

Join Date: Oct 2006
Location: Northern Mindanao, Philippines
Posts: 2147
Good Answers: 53
#20
In reply to #15

Re: microprocessors

10/26/2007 8:52 AM

Stubs...hmmm

First time I ever heard of that term. We employ the same technique except that we call them "subroutines". The main routine calls the subroutines. Occasionally, a subroutine can call another subroutine. We usually end up with dozens upon dozens of these "subs" but they do make troubleshooting easier. Even if the one troubleshooting isn't the original programmer.

__________________
Miscommunication: when what people heard you say differs from what you said. Make yourself understood.
Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#21
In reply to #20

Re: microprocessors

10/26/2007 9:18 AM

Can't remember when or where I first met "stubs" - somewhere in the dim-and-distant past.

It refers to the specific variety of subroutine, used during program developement and testing, which has only a very well-defined result. The result is very probably not a 'real' result in terms of what the program is designed to do, but is just there during the program creation and debugging stages.

This can be particularly useful with c type languages, where side effects can play merry hell with the expected outcome!

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply Off Topic (Score 5)
Guru
Hobbies - HAM Radio - New Member

Join Date: Oct 2006
Location: Vancouver (not BC) Washington (not DC) US of A
Posts: 1261
Good Answers: 12
#22

Re: microprocessors

10/28/2007 4:07 AM

Hopefully the guy who did your other projects kept proper documentation ie source code with comments. If you are having to start from scratch, once you begin to understand the Pics, you will find his earlier code will make things easier for yourself.

I assume that your software guy is a soldier (being in Iraq) and hopefully we can get them home in the near future.

Sincerely

Bill

Register to Reply
Power-User

Join Date: Dec 2006
Posts: 442
Good Answers: 32
#23

Re: microprocessors

11/07/2007 12:39 PM

I have gone through the same sort of exercise. I have no programming knowledge at all, and want to learn to program a microcontroller, so I searched for the simplest way to begin. If you are more advanced, you can probably ignore this, but here is a start. Basic seems to be the easiest language for a beginner to pick up, so that is what I focused on. Other languages are supported by the hardware kits, as well. This is what I have come up with:

http://www.parallax.com/Default.aspx?tabid=234

The parallax "Basic Stamp" is very popular with hobbyists, and is supposed to be one of the best kits to get started in learning. The development kit is really geared to education, with lots of support, free tutorials, sample code, and a wide user base.

http://www.basicmicro.com/

The BasicMicro Basic Atom is pin for pin compatible with the Basic Stamp, but is much more powerful. The Basic Atom seems to have less documentation, but the command set for this chip is a superset of the Basic Stamp, so theoretically you could buy this more powerful chip, but still take advantage of code examples from the Basic Stamp.

I settled on this:

http://www.beginnerelectronics.com/beginner/Products.php

This kit uses the Basic Atom, but has a development board with an LCD, LEDs, switches etc. prewired, so that I can concentrate on the programming aspects, without worrying about wiring/connection mistakes etc.

After I ordered the BasicBoard, I came across this:

http://www.mikroe.com/en/tools/easypic4/

http://www.mikroe.com/en/offer/pic/easystart1/

Wow! This uses the same Basic Atom chip, but as you can see, the development board is much more comprehensive. The compiler looks much more user friendly as well. However, the full package (with compiler) is about $250 vs. $140 for the others. I wish I had seen this first.

I haven't got my kit yet, so I can't really comment.

All these sites offer more advanced kits for other PICS and compiler languages.

Good luck, and let us know what you decide on.

Tad

Register to Reply
Register to Reply 23 comments
Copy to Clipboard

Users who posted comments:

Andy Germany (6); aurizon (1); Campbell Lighting (4); Garthh (1); JohnDG (4); Ray8 (2); Sciesis2 (1); Tad (1); user-deleted-1105 (1); Vulcan (2)

Previous in Forum: Moving files   Next in Forum: Settings for exporting to DXF format .

Advertisement