venerdì 29 febbraio 2008

What is MPLAB IDE?

An Overview of Embedded Systems MPLAB IDE is a software program that runs on a PC to develop applications for Microchip microcontrollers. It is called an Integrated Development Environment, or IDE, because it provides a single integrated "environment" to develop code for embedded microcontrollers. Experienced embedded systems designers may want to skip ahead to Components of MPLAB IDE. It is also recommended that MPLAB IDE On-line Help and MPLAB IDE Updates and Version Numbering be reviewed. The rest of this chapter briefly explains embedded systems development and how MPLAB IDE is used.
Description of an "Embedded System" An embedded system is typically a design making use of the power of a small microcontroller, like the Microchip PIC MCU or dsPIC Digital Signal Controller (DSCs). These microcontrollers combine a microprocessor unit (like the CPU in a desktop PC) with some additional circuits called "peripherals", plus some additional circuits on the same chip to make a small control module requiring few other external devices. This single device can then be embedded into other electronic and mechanical devices for low-cost digital control.
Differences Between an Embedded Controller and a PC The main difference between an embedded controller and a PC is that the embedded controller is dedicated to one specific task or set of tasks. A PC is designed to run many different types of programs and to connect to many different external devices. An embedded controller has a single program and, as a result, can be made cheaply to include just enough computing power and hardware to perform that dedicated task. A PC has a relatively expensive generalized central processing unit (CPU) at its heart with many other external devices (memory, disk drives, video controllers, network interface circuits, etc.). An embedded system has a low-cost microcontroller unit (MCU) for its intelligence, with many peripheral circuits on the same chip, and with relatively few external devices. Often, an embedded system is an invisible part, or sub-module of another product, such as a cordless drill, refrigerator or garage door opener. The controller in these products does a tiny portion of the function of the whole device. The controller adds low-cost intelligence to some of the critical sub-systems in these devices.
An example of an embedded system is a smoke detector. Its function is to evaluate signals from a sensor and sound an alarm if the signals indicate the presence of smoke. A small program in the smoke detector either runs in an infinite loop, sampling the signal from the smoke sensor, or lies dormant in a low-power "sleep" mode, being awakened by a signal from the sensor. The program then sounds the alarm. The program would possibly have a few other functions, such as a user test function, and a low battery alert. While a PC with a sensor and audio output could be programmed to do the same function, it would not be a cost-effective solution (nor would it run on a nine-volt battery, unattended for years!). Embedded designs use inexpensive microcontrollers to put intelligence into the everyday things in our environment, such as smoke detectors, cameras, cell phones, appliances, automobiles, smart cards and security systems.
Components of a Microcontroller The PIC MCU has program memory for the firmware, or coded instructions, to run a program. It also has "file register" memory for storage of variables that the program will need for computation or temporary storage. It also has a number of peripheral device circuits on the same chip. Some peripheral devices are called I/O ports. I/O ports are pins on the microcontroller that can be driven high or low to send signals, blink lights, drive speakers - just about anything that can be sent through a wire. Often these pins are bidirectional and can also be configured as inputs allowing the program to respond to an external switch, sensor or to communicate with some external device.
In order to design such a system, it must be decided which peripherals are needed for an application. Analog-to-Digital Converters (ADCs) allow microcontrollers to connect to sensors and receive changing voltage levels. Serial communication peripherals allow you to stream communications over a few wires to another microcontroller, to a local network or to the internet. Peripherals on the PIC MCU called "timers" accurately measure signal events and generate and capture communications signals, produce precise waveforms, even automatically reset the microcontroller if it gets "hung" or lost due to a power glitch or hardware malfunction. Other peripherals detect if the external power is dipping below dangerous levels so the microcontroller can store critical information and safely shut down before power is completely lost.
The peripherals and the amount of memory an application needs to run a program largely determines which PIC MCU to use. Other factors might include the power consumed by the microcontroller and its "form factor," i.e., the size and characteristics of the physical package that must reside on the target design.
Implementing an Embedded System Design with MPLAB IDE A development system for embedded controllers is a system of programs running on a desktop PC to help write, edit, debug and program code - the intelligence of embedded systems applications - into a microcontroller. MPLAB IDE runs on a PC and contains all the components needed to design and deploy embedded systems applications.
The typical tasks for developing an embedded controller application are:
Create the high level design. From the features and performance desired, decide which PIC MCU or dsPIC DSC device is best suited to the application, then design the associated hardware circuitry. After determining which peripherals and pins control the hardware, write the firmware - the software that will control the hardware aspects of the embedded application. A language tool such as an assembler, which is directly translatable into machine code, or a compiler that allows a more natural language for creating programs, should be used to write and edit code. Assemblers and compilers help make the code understandable, allowing function labels to identify code routines with variables that have names associated with their use, and with constructs that help organize the code in a maintainable structure.
Compile, assemble and link the software using the assembler and/or compiler and linker to convert your code into "ones and zeroes" - machine code for the PIC MCUs. This machine code will eventually become the firmware (the code programmed into the microcontroller).Test your code. Usually a complex program does not work exactly the way imagined, and "bugs" need to be removed from the design to get proper results. The debugger allows you to see the "ones and zeroes" execute, related to the source code you wrote, with the symbols and function names from your program. Debugging allows you to experiment with your code to see the value of variables at various points in the program, and to do "what if" checks, changing variable values and stepping through routines."Burn" the code into a microcontroller and verify that it executes correctly in the finished application.Of course, each of these steps can be quite complex. The important thing is to concentrate on the details of your own design, while relying upon MPLAB IDE and its components to get through each step without continuously encountering new learning curves.
Step 1 is driven by the designer, although MPLAB IDE can help in modeling circuits and code so that crucial design decisions can be made.
MPLAB IDE really helps with steps 2 through 4. Its Programmer's Editor helps write correct code with the language tools of choice. The editor is aware of the assembler and compiler programming constructs and automatically "color-keys" the source code to help ensure it is syntactically correct. The Project Manager enables you to organize the various files used in your application: source files, processor description header files and library files. When the code is built, you can control how rigorously code will be optimized for size or speed by the compiler and where individual variables and program data will be programmed into the device. You can also specify a "memory model" in order to make the best use of the microcontroller's memory for your application. If the language tools run into errors when building the application, the offending line is shown and can be "double clicked" to go to the corresponding source file for immediate editing. After editing, press the "build" button to try again. Often this write-compile-fix loop is done many times for complex code as the sub-sections are written and tested. MPLAB IDE goes through this loop with maximum speed, allowing you to get on to the next step.
Once the code builds with no errors, it needs to be tested. MPLAB IDE has components called "debuggers" and free software simulators for all PIC MCU and dsPIC DSC devices to help test the code. Even if the hardware is not yet finished, you can begin testing the code with the simulator, a software program that simulates the execution of the microcontroller. The simulator can accept a simulated input (stimulus), in order to model how the firmware responds to external signals. The simulator can measure code execution time, single step through code to watch variables and peripherals, and trace the code to generate a detailed record of how the program ran.
Once the hardware is in a prototype stage, a hardware debugger, such as MPLAB ICE or MPLAB ICD 2 can be used. These debuggers run the code in real time on your actual application. The MPLAB ICE physically replaces the microcontroller in the target using a high-speed probe to give you full control over the hardware in your design. The MPLAB ICD 2 uses special circuitry built into many Microchip MCUs with Flash program memory and can "see into" the target microcontrollers program and data memory. The MPLAB ICD 2 can stop and start program execution, allowing you to test the code with the microcontroller in place on the application.
After the application is running correctly, you can program a microcontroller with one of Microchip's device programmers, such as PICSTART Plus or MPLAB PM3. These programmers verify that the finished code will run as designed. MPLAB IDE supports most PIC MCUs and every dsPIC Digital Signal Controller.
The Development Cycle The process for writing an application is often described as a development cycle, since it is rare that all the steps from design to implementation can be done flawlessly the first time. More often code is written, tested and then modified in order to produce an application that performs correctly. The Integrated Development Environment allows the embedded systems design engineer to progress through this cycle without the distraction of switching among an array of tools. By using MPLAB IDE, all the functions are integrated, allowing the engineer to concentrate on completing the application without the interruption of separate tools and different modes of operation.
MPLAB IDE is a "wrapper" that coordinates all the tools from a single graphical user interface, usually automatically. For instance, once code is written, it can be converted to executable instructions and downloaded into a microcontroller to see how it works. In this process multiple tools are needed: an editor to write the code, a project manager to organize files and settings, a compiler or assembler to convert the source code to machine code and some sort of hardware or software that either connects to a target microcontroller or simulates the operation of a microcontroller.
Project Manager The project manager organizes the files to be edited and other associated files so they can be sent to the language tools for assembly or compilation, and ultimately to a linker. The linker has the task of placing the object code fragments from the assembler, compiler and libraries into the proper memory areas of the embedded controller, and ensure that the modules function with each other (or are "linked"). This entire operation from assembly and compilation through the link process is called a project "build". From the MPLAB IDE project manager, properties of the language tools can be invoked differently for each file, if desired, and a build process integrates all of the language tools operations.
The source files are text files that are written conforming to the rules of the assembler or compiler. The assembler and compiler convert them into intermediate modules of machine code and placeholders for references to functions and data storage. The linker resolves these placeholders and combines all the modules into a file of executable machine code. The linker also produces a debug file which allows MPLAB IDE to relate the executing machine codes back to the source files.
A text editor is used to write the code. It is not a normal text editor, but an editor specifically designed for writing code for Microchip MCUs. It recognizes the constructs in the text and uses color coding to identify various elements, such as instruction mnemonics, C language constructs and comments. The editor supports operations commonly used in writing source code, such as finding matching braces in C, commenting and uncommenting out blocks of code, finding text in multiple files and adding special bookmarks. After the code is written, the editor works with the other tools to display code execution in the debugger. Breakpoints can be set in the editor, and the values of variables can be inspected by hovering the mouse pointer over the variable name. Names of variables can be dragged from source text windows and then dropped into a Watch window.
Language Tools Language tools are programs such as cross-assemblers and cross-compilers. Most people are familiar with language tools that run on a PC such as Visual Basic or C compilers. When using language tools for embedded systems, a "cross-assembler" or "cross-compiler" is used. These tools differ from typical compilers in that they run on a PC but produce code to run on another microprocessor, hence they "cross-compile" code for a microcontroller that uses an entirely different set of instructions from the PC.
The language tools also produce a debug file that MPLAB IDE uses to correlate the machine instructions and memory locations with the source code. This bit of integration allows the MPLAB IDE editor to set breakpoints, allows watch windows to view variable contents, and lets you single step through the source code, watching the application execute.
Embedded system language tools also differ somewhat for compilers that run and execute on a PC because they must be very space conscious. The smaller the code produced, the better, because that allows the smallest possible memory for the target, which reduces cost. This means that techniques to optimize and enhance the code using machine specific knowledge are desirable. The size of programs for PCs typically extends into the megabytes for moderately complex programs. The size of simple embedded systems programs may be as small as a thousand bytes or less. A medium size embedded system might need 32K or 64K of code for relatively complex functions. Some embedded systems use megabytes of storage for large tables, user text messages or data logging.
Target Debugging In a development environment, the execution of the code is tested on a debugger. The debugger can be a software program that simulates the operation of the microcontroller for testing, or it can be special instrumentation to analyze the program as it executes in the application.
Simulators are built into MPLAB IDE so a program can be tested without any additional hardware. A simulator is a software debugger, and the debugger functions for the simulator are almost identical to the hardware debuggers, allowing a new tool to be learned with ease. Usually a simulator runs somewhat slower than an actual microcontroller, since the CPU in the PC is being used to simulate the operations of the microcontroller. In the case of MPLAB IDE, there are many simulators for each of the PIC MCU and the dsPIC DSC processors.
There are two types of hardware that can be used with MPLAB IDE: programmers and hardware debuggers. A programmer simply transfers the machine code from the PC into the internal memory of the target microcontroller. The microcontroller can then be plugged into the application and, hopefully, it will run as designed.
Usually, however, the code does not function exactly as anticipated, and the engineer is tasked with reviewing the code and its operation in the application to determine how to modify the original source code to make it execute as desired. This process is called debugging. As noted previously, the simulator can be used to test how the code will operate, but once a microcontroller is programmed with the firmware, many things outside the scope of the simulator come into play. Using just a programmer, the code could be changed, reprogrammed into the microcontroller and plugged into the target for retest, but this could be a long, laborious cycle if the code is complex, and it is difficult to understand exactly what is going wrong in the hardware.
This is where a hardware debugger is useful. Hardware debuggers can be in-circuit emulators, which use specialized hardware in place of the actual target microcontroller, or they can be in-circuit debuggers, which use microcontrollers that have special built-in debugging features. A hardware debugger, like a simulator, allows the engineer to inspect variables at various points in the code, and single step to follow instructions as the hardware interacts with its specialized circuitry.
Debugging usually becomes urgent near the end of the projected design cycle. As deadlines loom, getting the application to function as originally designed is the last step before going into deployment of the product, and often has the most influence on producing delays in getting a product out. That's where an integrated development environment is most important. Doing fine "tweaks" to the code, recompiling, downloading and testing all require time. Using all tools within a single environment will reduce the time around the "cycle." These last steps, where critical bugs are worked out, are a test for the embedded systems designer. The right tool can save time. With MPLAB IDE many tools can be selected, but they all will have a similar interface, and the learning curve from simulator to low-cost in-circuit debugger to powerful in-circuit emulator is small.
Device Programming After the application has been debugged and is running in the development environment, it needs to be tested on its own. A device can be programmed with the in-circuit debugger or a device programmer. MPLAB IDE can be set to the programmer function, and the part can be "burned". The target application can now be observed in its nearly final state. Engineering prototype programmers allow quick prototypes to be made and evaluated. Some applications can be programmed after the device is soldered on the target PC board. Using In-Circuit Serial Programming (ICSP) programming capability, the firmware can be programmed into the application at the time of manufacture, allowing updated revisions to be programmed into an embedded application later in its life cycle. Devices that support in-circuit debugging can even be plugged back into the MPLAB ICD 2 after manufacturing for quality tests and development of next generation firmware.
Components of MPLAB IDE The MPLAB IDE has both built-in components and plug-in modules to configure the system for a variety of software and hardware tools.
MPLAB IDE Built-In Components The built-in components consist of:
Project ManagerThe project manager provides integration and communication between the IDE and the language tools.
EditorThe editor is a full-featured programmer's text editor that also serves as a window into the debugger.
Assembler/Linker and Language ToolsThe assembler can be used stand-alone to assemble a single file, or can be used with the linker to build a project from separate source files, libraries and recompiled objects. The linker is responsible for positioning the compiled code into memory areas of the target microcontroller.
DebuggerThe Microchip debugger allows breakpoints, single stepping, watch windows and all the features of a modern debugger for the MPLAB IDE. It works in conjunction with the editor to reference information from the target being debugged back to the source code.
Execution EnginesThere are software simulators in MPLAB IDE for all PIC MCU and dsPIC DSC devices. These simulators use the PC to simulate the instructions and some peripheral functions of the PIC MCU and dsPIC DSC devices. Optional in-circuit emulators and in-circuit debuggers are also available to test code as it runs in the applications hardware.
Additional Optional Components for MPLAB IDE Optional components can be purchased and added to the MPLAB IDE:
Compiler Language ToolsMPLAB C18 and MPLAB C30 C compilers from Microchip provide fully integrated, optimized code. Along with compilers from HI-TECH, IAR, microEngineering Labs, CCS and Byte Craft, they are invoked by the MPLAB IDE project manager to compile code that is automatically loaded into the target debugger for instant testing and verification.
ProgrammersPICSTART Plus, PICkit 1 and 2, MPLAB PM3, and PRO MATE II, as well as the MPLAB ICD 2 debugger and MPLAB REAL ICE emulator can program code into target devices. MPLAB IDE offers full control over programming both code and data, as well as the Configuration bits to set the various operating modes of the target microcontrollers or digital signal controllers.
In-Circuit EmulatorsThe MPLAB REAL ICE, MPLAB ICE 2000 and MPLAB ICE 4000 systems are in-circuit emulators for PIC MCU and dsPIC DSC devices. They connect to the PC via I/O ports and allow full control over the operation of microcontroller in the target applications.
In-Circuit DebuggerMPLAB ICD 2 provides an economic alternative to an emulator. By using some of the on-chip resources, MPLAB ICD 2 can download code into a target microcontroller inserted in the application, set breakpoints, single step and monitor registers and variables.
MPLAB IDE Documentation The following documents are available to help you use MPLAB IDE:
"MPLAB IDE Quick Chart" (DS51410)"MPLAB IDE Quick Start Guide" (DS51281) - Chapters 1 and 2 of user's guide."MPLAB IDE User's Guide" (DS51519)Other documents exist for various Microchip software and hardware tools that work with MPLAB IDE. Check the Microchip web site for downloadable PDF versions of all these documents.
MPLAB IDE On-line Help Since MPLAB IDE is under a constant state of change (see MPLAB IDE Updates and Version Numbering) some details in this documentation may change. Dialogs might not appear exactly as they do in this manual, menu lists may be in different order, or may have new items. For this reason, the on-line help is the best reference to the version of MPLAB IDE being used.
MPLAB IDE comes with extensive on-line help, which is constantly being updated. If questions arise while using MPLAB IDE, be sure to check the on-line help for answers. Most importantly, the on-line help lists any restrictions that might exist for a particular tool in support of a particular device. Always try to review this section before working with a new device/tool combination.
The Limitations tab in the Debugger>Settings dialog displays any restrictions the simulator, emulator or in-circuit debugger might have, compared to the actual device being simulated. General limitations are shown in the text area.
Press the Details button to show specific limitations of the device being debugged. From this display, help on general limitations related to the debugger can also be accessed.
From the main MPLAB IDE Help menu, select Help>Topics to get a list of help on MPLAB IDE and all of its components.
MPLAB IDE Help covers all aspects of MPLAB IDE and all of the Microchip tools. It can be viewed in an outline, as an index and with a search utility for help on any MPLAB IDE topic. It also directs users to other types of assistance, such as the Microchip Update Notification system.
MPLAB IDE Updates and Version Numbering MPLAB IDE is an evolving program with thousands of users. Microchip is continually designing new microcontrollers with new features. Many new MPLAB IDE features come from customer requests and from internal usage. Continued new designs and the release of new microcontrollers ensure that MPLAB IDE will continue to evolve.
MPLAB IDE is scheduled for a version update approximately every four months to add new device support and new features. Additional "interim" releases are produced in between these major releases. The version numbering scheme for MPLAB IDE reflects whether it is a major production release or an interim release. If the version number ends in a zero, e.g., MPLAB IDE v7.00, v7.10 or v7.20, this identifies a major production release. If the version number ends with a digit other than zero, e.g., v7.11, v7.22 or v7.55, this identifies an interim release. Interim releases are typically provided for early adopters of new devices or components, for quick critical fixes or for previews of new features. These interim releases, although based on production releases that are fully tested, may have components that are not as fully tested, and therefore these releases are not recommended for rigorous design use. It is advised that production releases be used for development work, unless a new device or component is being used or a particular problem has been fixed in an interim release that enables more productive use of MPLAB IDE.
Each new release of the MPLAB IDE software has new features implemented, so the printed documentation will inevitably "lag" the on-line help. The on-line help is the best source for any questions about MPLAB IDE.
To be notified of updates to MPLAB IDE and its components, subscribe to the Development Tools section of the Customer Change Notification service on http://www.microchip.com/.
Integrated Language Tools
MPLAB IDE is designed to work with many Microchip and third party language tools. These tools take your application code (written in assembly, C or BASIC language) and turn it into executable code that may be programmed on your selected Microchip device.
Language Toolsuite Overview MPLAB IDE supports many language toolsuites. Integrated into MPLAB IDE is the Microchip MPASM Toolsuite, but many others can be used, including the Microchip C17, C18 and C30 Toolsuites, as well as language tools from HI-TECH, IAR, CCS, microEngineering Labs and Byte Craft. These are integrated into MPLAB IDE in two ways: using "plug-ins" designed by the manufacturer, and by older style ".MTC" files that can be customized for any language toolsuite.
Language Suite Plug-Ins Vendors of language tools can write a "plug-in" that can be installed into MPLAB IDE to provide custom dialogs to access the various tool build options. This is the preferred method of support.
.MTC File Interface A language tool can be integrated in a generic manner using a special file with the extension .mtc. These files are then integrated into a dialog to provide checkbox access to the various build options of the language tool. Using these files, most of the features of the language toolsuite can be controlled, but all may not be available.

sabato 23 febbraio 2008

Proposta di attività

Quali sono le esperienze già fatte con i "micro"?
Descrivetele in appositi commenti a questo post.
Buon lavoro!

Proposta di attività

Provate a leggere il contenuto di due siti tra quelli indicati, relativi al mondo dei "micro".
Indicate come commento a questo post quali sono le idee più interessanti che avete trovato.
Cercate poi nel web alcune applicazioni industriali secondo voi particolarmente significative dei "micro" e descrivetele, sempre in uno o più commenti a questo post.
Buon lavoro!

venerdì 22 febbraio 2008

Visitate questi siti...

Ciao,
vi segnalo alcuni siti dove si parla di microcontrollori:
Provate a visitarli.
Potrete osservare che hanno un "taglio" molto diverso tra loro, ma spulciando qua e là si trova molto materiale utile. Il primo, in particolare, è stato realizzato dalla Facoltà di Ingegneria dell'Università di Padova e può costituire una valida "traccia" per uno studio personale dell'argomento.
Buon lavoro!
Mauro

MICROCONTROLLORI PIC

Cosa sono i PIC?

Un microcontrollore è un dispositivo elettronico che opportunamente programmato è in grado di svolgere diverse funzioni in modo autonomo. Essenzialmente gestisce delle linee di input e di output in relazione al programma in esso implementato. Esistono diverse famiglie di dispositivi in grado di svolgere queste funzioni come ad esempio lo Z80, ST6 e il più evoluto 8088; in questa sezione ci occuperemo dei più semplici dispositivi oggi in commercio, i PIC prodotti e distribuiti dalla Microchip.
Questi dispositivi implementano al loro interno un vero e proprio microprocessore completo di CPU, RAM, Timer e numerose linee di IN/OUT. A differenza dei microprocessori più evoluti nei PIC il programma è contenuto all'interno in un'apposita area di memoria (non volatile) e viene eseguito ciclicamente, anche la RAM per i dati volatili è all'interno dello stesso dispositivo, alcuni dispongono di aree dati non volatili e riscrivibili (EPROM). Lo stadio di IN/OUT è già implementato all'interno ed alcuni dispongono già di interfacce per segnali analogici, per comparatori o per comunicazioni seriali. I microcontrollori PIC dispongono di un numero ridotto di istruzioni e quindi sono dei dispositivi di tipo RISC e si programmano in assembly ovvero in codice macchina. In commercio si trovano diversi modelli di PIC a seconda della complessità e delle funzioni implementate, alcuni dispositivi si differenziano anche per la quantità di memoria disponibile e per la quantità di Timer a disposizione. Per le nostre applicazioni è sufficiente un modello base come ad esempio il PIC 16F84A ma va benissimo anche un 16F84 oppure un 16C84. Le versioni con memoria Flash sono programmabili più volte (e quindi idonei alla sperimentazione) mentre le versioni OTP (One Time Programmable) si programmano una sola volta. Le versioni UV sono riprogrammabili dopo la cancellatura con raggi ultravioletti.

Cosa serve per iniziare?

Fondamentalmente il modo di procedere è uguale per tutti i PIC e si suddivide in una parte di programmazione e in una parte di utilizzo all'interno del circuito elettronico scelto come di seguito descritto:

1) Stesura del programma tramite un editor di testo qualsiasi anche se io consiglio il banalissimo WordPad di Windows in quanto il file deve contenere solo testo e nessuna formattazione e si avrà cura quindi di salvarlo in modalità "solo testo".

2) Compilazione tramite un compilatore che ha il compito di trasformare le istruzioni mnemoniche (cioè fatte di parole) in codice direttamente eseguibile dalla CPU del microcontrollore. Lavorando con i prodotti Microchip sul sito è possibile scaricare il compilatore MPASM distribuito gratuitamente. Questo programma permette solo di compilare il vostro programma ma non permette la simulazione per verificare se effettivamente funziona. In questo caso è necessario scrivere prima il programma con un editor di test (anche wordPad di windows va benissimo) quindi rinominarlo con estensione .ASM e poi compilarlo tramite MPASM per ottenere il file di estensione .HEX (per la procedura esatta clicca qui). Sempre sul sito della microchip è possibile scaricare MPLAB-IDE che è un ambiente integrato e permette l'editing del file ASM, la cmpilazione, la simulazione e (disponendo del programmatore Microchip!) anche la programmazione del dispositivo .

3) La programmazione del PIC avviene tramite un apposito circuito elettronico (programmatore) sul quale viene inserito il microcontrollore e che viene interfacciato al PC tramite porta seriale o parallela. Nel mio sito è disponibile tutta la documentazione necessaria per realizzare un semplicissimo programmatore. I PIC sopportano la programmazione InCircuit ovvero la programmazione direttamente sul circuito elettronico di funzionamento. In questo modo si evita di dover ogni volta togliere il PIC dal circuito di lavoro per inserirlo nel programmatore.

4) Per poter inviare il programma al PIC (tramite il programmatore) occorre un apposito software in grado di gestire i segnali di comunicazione tra PC e programmatore leggendo il file generato dal compilatore. Il programma idoneo a questo scopo è di pubblico dominio e si chiama ICPROG.

5) A questo punto vi serve un microcontrollore PIC, per iniziare va benissimo un 16F84A, ma va bene anche un 16F84 oppure un 16C84 che con una spesa ci circa 6 Euro rappresenta l'entry level della produzione microchip.

Domande frequenti

1) Con quale PIC è meglio iniziare? Il PIC 16F84 (anche nella versione 16F84A) è il più indicato in quanto di facile reperibilità in oltre essendo di vecchia generazione dispone di poche funzioni, pochi registri interni e quindi la sua programmazione è più semplice.

2) Compaiono strani messaggi di errore quando programmo con Ic-Prog! Leggi la guida in italiano di Ic-Prog.

3) Mi trovo in grossa difficoltà ad utilizzare questi PIC! Per poter utilizzare i microcontrollori è necessario disporre di buone conoscenze in campo elettronico ed informatico. La programmazione in assembler è generalmente ostica, esistono al riguardo dei compilatori in C o Basic che agevolano il lavoro ma comunque occorre disporre di buone conoscenze da programmatore.

Microprocessori e microcontrollori

Gentili studenti,
benvenuti nel sito che ho realizzato per voi, dedicato ai microprocessori ed ai microcontrollori.
Qui sono raccolte notizie tecniche e storiche su questi componenti elettronici, grazie ai quali è possibile l'attuale era tecnologica. Quando infatti parliamo di "nuove tecnologie", non dobbiamo dimenticare che il "cuore" dei sistemi che ad esse si riferisce è costituito proprio da microprocessori e da microcontrollori.
Buona lettura e... grazie se arricchirete questo blog con i vostri preziosi contributi!

Mauro Pullin