Corrado D'Achille
info@corradodachille.it
ultimo aggiornamento 18/03/2015
it_page
english page
disclaimer
Home Pic


demoboard imageDemoboard with PIC18F2550
DEMO2550 is a module based on PIC18F2550, that enables the development and testing of HW/SW applications, in a simple and quick way.
Choosing the PIC was motivated by the presence, within it, a USB interface that allows  to program the component and to communicate with it.
All the necessary software for programming via USB is provided by Microchip (c) and consists of a program to be loaded on the PIC (Bootloader) and a PC tool. The bootloader (for the beginners) is loaded into a reserved area of ​​memory of the PIC. The program enter on action only after a specific power-up sequence and puts it in direct communication with the program running on the PC. At this point the PC we can load our application on the module. Details of the transaction will be clarified in the example given. For dialogue with the PIC even here we find solace in the Microchip that provides us with a basic infrastructure (Framework) ready to be integrated in our programs.
 
The module has some simple adds-on (Leds, Buttons). They have been
designed to make it completely independent and to facilitate the testing of simple solutions of interfacing with the outside world.


Module Features
  • microcontrollor PIC18F2550 with 20MHZ clock
  • USB port
  • it can be powered from the USB port or from an external power supply (9-15volts). The choice between USB and external power supply is made by moving a jumper on the board.
  • button to reset the module
  • 100mils strip connectors with all I/O pins of the PIC, power signals and reset signal.
  • a button (connected to pin RB4) which can be used both as an input device, or  to activate the software loading via USB.
  • three LED driving by digital signals.  They can be used as flag devices.
  • two momentary button connected to ground and having a 10kohm pull-up. They can be used as input devices.
Building

For the construction of the module you have to play the printed circuit board, taking the master from the link given below. The resistors are 1 / 8w to 5%. The component PPTC (represented in the circuit diagram from the capacitor C2) is an element ofprotection in case of extra currents. It really is not necessary, because the USB ports of the PC are already protected. In consequence of this, can be replaced with a jumper.
PIC programming

After the building and the electrical verification, the module must be programmed with the bootloader. The binary file is available at below link:

Installations of the Software Development Enviroment and programming tool 

The software development environment to create applications for the module consists of two tool, the IDE and MPLAB C18 compiler. The tools are to be taken to the link below and installed in this order, ie before the IDE and then the compiler. For the use of the tools I refer to the documentation provided by Microchip. The program to load the application on the module is always the Microchip and is available from the link below. Module connections and controls

In Figure 1 there is the pinout of the module with all connections and controls for its use.
The connections of the module are:
  • DC socket for connection to an external power adapter (center positive),
  • USB socket for connection to a PC
  • VDD pin (red) that provide a voltage of 5 Volts, to be used for external circuits
  • pin GND (colore nero) da utilizzare come riferimento per i circuiti esterni
  • pin VCC, connected to the DC
  • pin MCL. The reset line of the module. This pin can have two functions: to provide the reset to the external circuits, input for external reset
  • pin RA0-RA5, RB0-RB7, RC0-RC7 (Color Blue). I/O from/to the outside world. The functionality of the pin depends on the type of application loaded in the module. Note that the pins RC4 and RC5 cannot be used when the module is connected to the PC via USB.
  • pin L1-L3, connected to the signal LEDs
  • pin S3 and S4, S3 and S4 connected to the buttons.

The controls of the module are:

  • Strip VDC-VUSB. Through these pins, you can supply the module from the USB port or from the DC.
  • RESET button: to reset the module
  • PGM/RB4 button, to put the module into programming mode. This button is connected directly to pin RB4 and can be used as an input device for the application. 
demo2550 pinout
Figure 1: module pinout 

Use of the module

To load an application on the module, you have to activate the loader mode, to do it,  you must connect the module to a PC's USB port and perform the following steps:

  • On the PC, launch the program MCHPFSUSB
  • on the Module, press RESET button and PGM button simultaneously
  • on the module, leave the RESET button while holding down the PGM button
  • Wait a few seconds and then release the PGM button . At this point the module is connected to the PC.
  • on the PC, into the  MCHPFSUSB panel:
    • select the module via the drop-down menu in the upper left,
    • press the "LOAD HEX FILE", a dialog box will appear that will allow us to select the file to upload. After you have selected and confirmed the file, all the panel buttons become active.
    • press the "Program Device". In the bottom window will appear a series of messages to confirm programming.
    • press the "Execute" and the application will start. Alternatively you can press the reset button on the form.
For demonstration purposes I have prepared a program that flashes the three LEDs in binary sequence. The three LEDs should be connected to pin RB0, RB1, RB2 and.

Conclusions

Although dedicated to PIC2550, nothing prevents you to mount the module other PICs, which have the same pinout. In this case, you lose the functionality of the USB and programming and must be carried out in any other way (Serial, programmer, etc). At the moment I have not foreseen this possibility and then I'm moving towards just basic applications for 2550. In particular, I'm adapting the framework of Microchip to develop the software in an easy and intuitive way

Disclaimer

The material contained in this web site is provided "AS IS" without warranty of any kind. The author is not responsible for direct or indirect damages, accidents or others problems cause by the use of information contained in this web site. All the product names, logos and trademarks belong to the respective owners. The use and distribuition of the material contents in this site is free with the condition to summon the source. The commercial use of the web site materials is forbidden without the written authorization of the web site author.