Curso assembler

Páginas: 190 (47418 palabras) Publicado: 28 de junio de 2011
My First PIC Projects
An introduction to the PIC processor.

© Bubble Software 2000

mICro’s First Projects

Introduction Flash That LED Define The Problem Writing The Software Mnemonics The Assembler Labels Using a text assembler The Flowchart MicroPlan Assembler The Simulator The Real World 7 segment LED display The Counter Using Switches

My First PIC Projects - Page

1 Introduction
Welcome to MICRO’s. I know you are itching to get started with your new software and begin programming PICs as soon as possible, so this introduction will get you familiar with the MICRO’s suite of software and during the process you will also start writing some small programs and hopefully get them working in the real world.

If you have the MICRO’s Experimenters Kit, then going throughthe projects will be quite easy. If you do not have the Experimenters Kit, then you may like to get a PIC programmer so that you can program the software into a 16F84 chip to complete the projects.

Before we get going, you have to understand that a PIC, or any other microcontroller chip for that matter, is just a piece of silicon wrapped in plastic with pins sticking out to connect it to theoutside world. It does not have any brains, nor can it think for itself, so anything the chip does is the direct result of our intelligence and imagination. Sometimes you may get the feeling that these things are alive and are put here to torment your every waking minute, but this is usually due to bugs in your software, not a personality inside the chip. So please remember:

The PIC will alwaysdo what you tell it to, not necessarily what you want it to.

One other thing that can cause problems is in the way you handle the chip itself. Your body is more than likely charged with Static Electricity and is usually the zap you feel when you touch a metal object after walking on nylon carpet or similar. The PIC’s most definitely do not like this high voltage discharging into them. It candestroy the functionality of the chip either totally or partially, so always try to avoid touching the pins with your fingers.

The PIC 16F84 data sheet is available in PDF format on the CD ROM in the Acrobat directory.

My First PIC Projects - Page

2

Flash That LED
This would have to be the universal number one project for new PIC programmers. If you have had anything to do with writingsoftware for PC’s, then it would be the equivalent of writing “hello world” on the monitor for the first time.

You might be thinking at this stage...“What a boring project. I want to create a robot that does amazing things, not mess around with silly ‘hello world’ or LED flash programs.” Patience my friend. Things like that will come in due course, and as the old saying goes, “You have to crawlbefore you can walk”.

OK then, so how do we get started? You might be tempted to jump straight in and write volumes of code right from the start, but I can only say, that in all probability, your software will not work. Now this might sound a bit tedious, but “planning” is the best way to begin any piece of new software. Believe me, in the long run, your code will stand a much better chance ofworking and it will save you valuable time. Other benefits are that your code will be structured and documented much better, which means you can read through and understand it more easily in the future if the need arises.

So just how do we get this piece of silicon to do our bidding? In this case - flash a LED.

Fundamentally, the PIC needs three things to make it work. 1) 2) 3) 5 volt powersource. Clock source Software

The 5 volt supply is there to power the chip. The clock source gives the chip the ability to process instructions. The software is a list of instructions that we create. The PIC will follow these to the letter with no exceptions, so we must make sure that they are written correctly or our program will not work as intended.

My First PIC Projects - Page

3...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Assembler
  • Assembler
  • Assembler
  • assembler
  • Pwm Assembler
  • Intrupciones Assembler
  • Calculadora Assembler
  • Leds

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS