Papilio junior v2


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Papilio junior v2

  1. 1. Gadget Building Blocks for developers | FPGA Project Kits for fun The Papilio Platform is an Open Source project that allows students, designers, and hobbyists to tap into the power and flexibility of an FPGA. At the heart of the Papilio Platform is an open source soft processor that provides compatibility with the Arduino IDE. This soft processor allows the FPGA to be programmed with the familiar and easy to use Arduino Sketches. Anyone that can make something with the Arduino can make something with the Papilio Platform. Visit for more : Papilio Junior V2The boardThe Papilio Junior (previously known as PIC Cocoon) project is an effort to create avery low cost Papilio board that includes a 16-bit Wing slot and USB. This secondversion of Papilio Junior uses PIC18F44J50 and provides a 16-bit Wing slot (or two 8-bit Wing slots), 4 analog inputs and USB interface. It also integrates a LED/Buttonutility Wing, freeing a 8-bit slot used for this essential interface.The Wing slots of Papilio Junior v2 board can be used to connect Wings that providea wide variety peripherals, sensors, actuators, displays, input devices etc, and evenmost Arduino shields by using a Arduino adapter. We will get to know about theboard in this tutorial and then create a simple program that will flash the LEDs andpause when a button is pressed, demonstrating both input and output functions ofthe microcontroller. Subsequent tutorials will deal with more complex applicationsthat the Papilio Junior v2 is capable of.The board looks like this, with the important parts marked in the image:
  2. 2. 1. USB connector: Provides USB link to the PC and supplies power to the board. Ifyour application does not use connection to the PC and can be powered from theadapter, the USB cable need not be used.2. DC power Jack: Additional power source for non-connected, stand-aloneapplications. Use a good quality regulated 5V DC adapter.3. Power source selection jumper: Select between USB power or wall-adapter.4. PICkit2 header: You can use the Microchip PICkit2 programmer to rewrite theentire device, not needed if you are using the bootloader.5. Boot Mode jumper: The bootloader reads this jumper to switch to bootloadermode, else simply starts your application.6. Reset button: Simple, resets the controller.7. LED/Button interface: One always needs some way to interact with theprogram, a frequently needed interface - the LED/Button Wing is integrated on theboard, saving you one 8-bit Wing slot. It has 4 tactile switches and 4 LEDs that youcan define any way you like in your application.
  3. 3. 8. Wing slots: These are connectors that connect that Papilio Wings to provideadditional functionality to the microcontroller.9. Analog header: Provides 6 analog inputs10. The PIC18F44J50: The main controller, runs with a 8 MHz crystal and isconfigured to work at 24 MHz. The USB section of the controller runs at 48 MHz.The essentialsThe Papilio Junior v2 support software is written in C, using the Microchip MPLAB IDEand C18 compiler. You can download the MPLAB IDE, as well as trial version of theC18 compiler. The trial version wont expire and wont stop working, it will just turnoff the optimizations after 60 days, which may result in a bit larger and/or slowerprograms. You may want to purchase the compiler after the evaluation period isover. You will also need the Microchip HID bootloader updated to work with thePapilio Junior v2, and the demo programs available on the development pages. Hereare the links to everything you would need:Microchip MPLAB IDEMicrochip C18 compiler (requires registration, you may select a version that suitsyour interest)Microchip Application Libraries (that contain USB framework and the HID bootloaderapplication)Project SVN Updated HID bootloader for Papilio Junior v2 and Demo applicationsYou will also need a standard USB-A to mini-USB cable.Note: Please install the MPLAB IDE before the C18 compiler. You dont need the USBframework right away, but we will be using it in more advanced tutorials.Wing slotsThere is one 16-bit slot (or two 8-bit slots) which is defined on the silkscreen. Thereis another 16-bit slot adjacent to it, but it is NOT a different slot. These is just amirrored slot provided to facilitate using multiple wings, especially that are larger insize and may not allow the neighbouring 8-bit slot to be populated. You can simplyturn the Wing around and connect it to the mirror slot on the other side. Of course,the connections will also be mirrored and you must update the code accordingly. Tosimplify these definitions, the two Wings are named as A and B respectively.Again, these NOT different Wings. The 16-bit wing slot is split into two 8-bit wingslots, lower slots with pins 0-7 and higher slot with pins 8-15. Thus, there are 4 wingslots AL, AH and BL, BH oriented in opposite directions.
  4. 4. The microcontroller pins are mapped to the Wing slots as follows:16 bit slots 8-bit slots RP pin MCU Port pin A B AH/AL BH/BL A0 B15 AL0 BH7 RP17 RC6 A1 B14 AL1 BH6 RP18 RC7 A2 B13 AL2 BH5 RP21 RD4 A3 B12 AL3 BH4 RP22 RD5 A4 B11 AL4 BH3 RP23 RD6 A5 B10 AL5 BH2 RP24 RD7 A6 B9 AL6 BH1 RP3 RB0 A7 B8 AL7 BH0 RP4 RB1 A8 B7 AH0 BL7 RP5 RB2 A9 B6 AH1 BL6 RP6 RB3 A10 B5 AH2 BL5 RP7 RB4 A11 B4 AH3 BL4 RP8 RB5 A12 B3 AH4 BL3 RP9 RB6 A13 B2 AH5 BL2 RP10 RB7 A14 B1 AH6 BL1 RP0 RA0 A15 B0 AH7 BL0 RP1 RA1The orientation of the Wing slots is depicated on the board silkscreen. To allowsource level compatibility, all Papilio Junior versions provide header files that definethe wing pins and functions to configure and manipulate them so that you don tneed to use actual port/pin names in your source code.The above table shows different names of the same physical pin on the wing slot. Forexample, the pin A0 or B15 on 16-bit slots or pin AL0 or BH7 on 8-bit slots are samephysical pins, that are referred to as remappable pin 17 by the microcontroller, thatis also its GPIO pin 6 of I/O port C. To avoid confusion, one should use correct nameof the pin according to the context. For example if you are using a 8-bit Wing, youcan simply refer to its slot as AL or AH or BL or BH and then address its individualpins. You may not need to use Microchip names for these pins at all.Here are a few tutorials to help you get started with the Papilio Junior v2:1 Getting Started With Papilio Junior v22 First program on the Papilio Junior v23 Using 1-axis Stepper Wing with Papilio Junior v2
  5. 5. 4 PapilioJr2CDCcomms5 SensorsWithPapilioJr26 PapilioJr2TempMonitor7 UsingArduinoAdapterWithPapilioJr2