Menu

Prototyping with the MPLab Xpress Evaluation Board.

2016-06-22
2016-06-23
  • Chris Roper

    Chris Roper - 2016-06-22

    BB-Tray-Xpress, Part 1 - Introduction.

    The Microchip Xpress Evaluation Board is a very cost effective and powerful Demo board.

    It has an onboard programmer, an integrated USB to Serial function, a powerfull PIC16F18855 MCU, a MikroBus Expansion Header, which is my personal favorite expansion footprint, and as with all Microchip Evaluation boards it has a Push Button, 4 LED's and a Potentiometer. The Board, pictured below, is expected to have a retail price of only US$10.

    Thanks to a lot of hard work behind the scenes by Anobium and others this board will soon be supported by Great Cow Basic.

    What it lacks, however, is space to breadboard your own circuits.

    The board (Above) has space for pin headers but they are too far apart to fit into a standard breadboard and any attempt to build a Shield that fits over the Xpress Board would block the onboard controls and the MikroBus Expansion Header.

    To overcome this limitation and allow the Great Cow Basic user some room to experiment I developed the "BreadBoard Tray Xpress", an easy to make board that plugs into the MikroBus Expansion Header and allows you to prototype expansions or just build experimental circuits.

    The photograph below shows an experiment driving an RGB LED as per a previously published Great Cow Basic Demo Program.

    The Mini Breadboard has the ability to accommodate up to 28 PIN Devices or many discrete components. You could easily build a Second PIC MCU setup to test inter Device communication, an RTC chip, an OP-Amp Frontend or Backend to drive speakers, use it as a breakout board to link a 16 Pin Expansion module to drive displays or simply perform experiments with FETs, Transistors and basic passive components. The Opportunities are virtually limitless.

    If you like the results of your experiments you can easily make it permanent by building it up on Veroboard and then plug it in whenever you need it..

    In the Following posts I will document how to build and use this useful addon to, not only the Microchip Xpress Evaluation Board but, indeed, any Board that has the MikroBus Expansion Header.

    Cheers,
    Chris

     

    Last edit: Chris Roper 2016-06-24
  • Chris Roper

    Chris Roper - 2016-06-22

    BB-Tray-Xpress, Part 2 - Acquiring the Parts.

    The BreadBoard Tray Xpress is easy to build, requires no special PCB manufacture and very few parts.

    I used a piece of ViroBoard, or Strip Board as it is called in some countries, but perfboard or pad per hole board would work just as well. Dig through your parts bin and see what you have.

    As I used Veroboard I will use that in all the example drawings.

    Parts List:

    1) VeroBoard or equivalent. 7.5 x 2.5 cm - 28 x 10 holes.


    Fig1 - BB-Tray-Xpress - ViroBoard.png shows the copper side of the board with the needed cuts in the copper strips.

    2) 2 x 8 Pin Stackable Female Headers, normally sold as part of an Arduino Uno Header Pack.


    Fig 2 - Arduino headers.png shows what they look like.

    3) 1 Strip of Female header to be cut into a strip of 10 and 2 strips of 4.
    I normally Buy it in strips of 40 pins but get whatever you can.


    Fig3 - Female Header.png shows what I used.

    4) Mini BreadBoard - Size 45 x 35 x 8mm - 170 tie points


    Fig4 - Mini BreadBoard.png shows the one you need.

    Finally you will need some hookup wire, I just stripped away 3 inches of a CAT 5 cable and used that.

    Next Post will be the circuit board cutting details.

    Cheers
    Chris

     

    Last edit: Chris Roper 2016-06-24
  • Chris Roper

    Chris Roper - 2016-06-23

    BB-Tray-Xpress, Part 3 - Preparing the Circuit Board.

    Construction is very easy, a lot easier than these instructions make it sound, and with practice you will be able to build projects like this faster than you can read these instructions.

    Start with the Circuit Board, in this case Veroboard or Perfboard. We already know the dimensions, but as Veroboard is sold in several sheet sizes we will need to cut it to make a board of the size we require.

    Cutting Veroboard is a lot easier than you may initially think. Simply Score, on both sides, along a row or column of holes and snap the board over the edge of a desk or work bench. Two such “Cuts” should yield a board of the size you require, in this case 7.5 x 2.5 cm or 28 x 10 holes.

    I find it easier to work in terms of holes when measuring or cutting Veroboard and remember to allow for the row and column that we are snapping. In this case we need a resulting board of 28 x 10 holes so we will score the board on the 11th row and 29th column, they are considered sacrificial.

    You will be left with a Castellated edge on two or more sides so dress the edges with a Smooth or Medium File, working slowly and ensuring the edges remain square. You may also wish to round the edges and corners slightly.

    It is also a good idea to file the Top Right Corner to a 45 Degree angle to assist in orientation later.

    To prevent short circuits we now need to cut a few tracks on the copper side of the Veroboard. Flip the board over and look at the attached image “Fig7 Veroboard Cut 3.png”.

    There are special cutting tools available but are not essential, I get good results with a 3mm Drill Bit in a Pin Vice handle. If you don't have a Pin Vice a few turns of insulating tape around the shank of the drill bit will make an adequate handle. Insert the tip of the Drill Bit or Cutter into the hole you wish to cut and give it a twist or two, being careful to lift all the copper but not drill through or weaken the board.

    You can see from Fig7 that we need to cut the copper from nine of the holes. Do so now whilst the board can still be placed flat on your work surface.

    Cheers
    Chris

     

    Last edit: Chris Roper 2016-06-24
  • Chris Roper

    Chris Roper - 2016-06-23

    BB-Tray-Xpress, Part 4 - Female Headers.

    As mentioned above I buy my Female Headers in strips of 40 sockets.

    For this project we need a strip of 10 sockets to act as our Gnd Bus and two strips of 4 to act as our 3V3 and 5V power strips. Unless you manage to buy the headers in those sizes you will need to cut up a larger piece of header strip. This is how I do it.

    Count out the required number of sockets, starting from one edge. When you reach the required number, using a pair of long nose pliers, pull the pin out of the next socket.

    In this case we counted out 10 sockets and then extracted the 11th pin.
    Now using a razor saw or a sharp knife cut through the empty socket.

    Use a Smooth or Medium File to carefully dress the cut ends of the strip.

    Make two more cuts using the same count, extract, cut and file method to make the two 4 pin headers.

    We have lost 3 sockets out of our strip of 40 but I think you will agree that the versatility and ease of making arbitrary sized Female Sockets is worth the sacrifice. Out of that strip of 40 you should still have 19 Sockets available for future projects.

    The Arduino Headers are the correct size so no cutting is required.

    With the preparation work behind us the next section will deal with the actual construction of the BB-Tray-Xpress.

    Cheers
    Chris

     

    Last edit: Chris Roper 2016-06-24
  • Chris Roper

    Chris Roper - 2016-06-23

    BB-Tray-Xpress, Part 5 - Construction.

    At last we are going to put it all together.

    Start construction with the 10 socket Female Header we made in the last part. It is inserted into the first (Left Hand) column, furthest away from where we made the cuts in the copper.

    Turn the board over and solder One Pin, then examine the socket to ensure that it is square and upright. Alignment is critical here so if it is out in any dimension melt the solder again and adjust the socket.

    Once it is square you may solder another pin at the far end to anchor the socket strip. Check the alignment and adjust if necessary. Once you are happy that everything is aligned correctly go ahead and solder the rest of the pins.

    Repeat the above procedure for the two 4 Pin Power Strips, again alignment is critical but should be easier to achieve now that the board will lay flat, Work slowly and carefully.

    Test fit the Breadboard, if you have everything placed correctly it should fit snugly between the ten pin header and the two 4 pin headers.

    Now we need some linking wires. The two 4 pin headers are to act as 3V3 and 5V power strips, but the 3V3 and 5V power is feed into the board on the second row of pins of the Stackable headers and the Ten Socket strip is a Ground bus witch connects to the first row. So before we go any further we need to install those links.

    I soldered them to the underside of the board so that they would be hidden, but they can also be soldered through hole style if you prefer.

    Now we can add the Stackable Headers.

    Due to the length of the pins, these headers can be difficult to work with, so work slowly and have patience, it is worth it in the long run. I suggest you install one at a time, which one you start with is up to you.

    Insert the header and turn the board over. Because of the power strips the board should lay flat, face down, on your work surface and hold the header vertical. Solder one pin to secure it then check alignment.

    Once you are happy that it is aligned correctly solder another pin to secure it and check again.

    Now proceed to solder all the pins being careful not to form any solder bridges between pins and avoid bending the pins out of alignment.

    When you are happy with the first header repeat the process for the second. The second will be harder to do because of the long pins of the first header getting in your way but persevere and you will get it done.

    Finally, test fit the breadboard, if it fits remove it, peel off the paper covering the Adhesive on the back of the breadboard and carefully attach the breadboard to the workpiece. Watch your alignment as you do so, once the tape touches it sticks very firmly so you only have one shot at getting this right. Removing the Breadboard once it is stuck down can damage it.

    Congratulations you now have a BB-Tray-Express board. In the next section we will perform some tests to make sure it works befor pluging it in and then finaly we will build and test a simpe circuit.

    Cheers
    Chris

     

    Last edit: Chris Roper 2016-06-24
  • Chris Roper

    Chris Roper - 2016-06-23

    Part 6 - Testing the BB-Tray-Xpress.

    Before plugging our BB-Tray-Xpress into the Xpress Evaluation board there are 6 continuity tests we need to perform in order to test our construction and to avoid inflicting irreparable damage on the Xpress Evaluation board.

    If you have a larger size Breadboard you can plug the BB-Tray-Xpress into that whilst conducting these tests, it will hold it stable for you. If you don't have a Breadboard you could also plug it into a suitably sized piece of styrofoam. It is also a good Idea to plug it into something to keep it stable whilst building circuits so if you do cut some styrofoam to fit, keep it handy for building circuits.

    The Red and Black lines in the drawings indicate the leads from the Multimeter or Continuity tester.

    First we will test the BUS connections:



    If any of the above tests fail check your soldering on the link wires and the headers.

    Next we test for critical short circuits:


    None of the above should have continuity, if there is continuity you have a short circuit that could and probably would damage the Xpress Evaluation board and possibly your PC's USB Port. If any of these tests fail look for and repair any short circuits.

    It is also a good idea to ensure that there is no continuity between adjacent pins on the Stackable headers or between opposing pins on both headers.

    Repeat for each pair of pins.

    Repeat for each pair of pins.

    There is one exception to the above in that the last pair of opposing pins may have continuity and will have continuity if tested whilst plugged into the Xpress Evaluation Board.

    If the Board has passed all of the above tests we are ready to build up a Circuit and test it plugged into the Xpress Evaluation Board.

    We will do exactly that in the next and final section.

    Cheers
    Chris

     

    Last edit: Chris Roper 2016-06-24
  • Chris Roper

    Chris Roper - 2016-06-23

    BB-Tray-Xpress - Part 7 - LED Demo.

    Build the Circuit shown below:

    It has a 1K resistor an LED, any colour, I used Green, and a length of hookup wire.

    Plug the BB-Tray-Xpress into the Xpress Evaluation Board, plug in the USB Cable and the LED should light.

    Move the hookup wire like this:

    Again it should light but not quite as bright. That is because we are now attached to the 3V3 supply whereas the first test was the 5V supply.

    Now move the hookup wire again so it is like this:

    It may or may not light the LED becouse we have connected it to the RB0 Pin of the PIC16F18855 MCU. So the state of the Pin, and our LED, now depends on whatever program is running.

    If you look at the Xpress Evaluation Board you will notice a silkscreen for J7 & J8. The First 8 pins on each of those are also available on the adjacent MikroBUS Headers and, by extension, on our BB-Tray-Xpress board.

    The MikroBUS specification assignes different names and functions to these Pins, the Image below is a cross reference of MCU Pin to MikroBUS Specification. It acts as a handy guide when building circuits on our BB-Tray-Xpress Board or when mapping peripherals with the PPS (Peripheral Pin Select) capability of the MCU.

    If you have not installed the latest version of Great Cow Basic do so now.

    On the additioanl Tasks Page make sure to select the Xpress Programer.

    Load SynWrite

    Edit the FlashPIC.bat file, there is a short cut to it on the tool bar here:

    Uncomment the XpressLoader line:

    REM Call XpressLoader for the Xpress Evaluation Board
    REM A tool developed as part of Great Cow BASIC
     "XpressLoader\XpressLoader.exe" %1
    

    That will use the Xpress Evaluation Board's onboard programmer.
    Look further down the file and REM out any other programmers. PICKit2 is probably un commented so put a rem in front of it.

    Save the FlashPIC.bat file.

    Create a new file called "BB-Tray-Xpress-Test" and enter the following:

    ;
    ; BB-Tray-Xpress-Test.bas
    ; C.A.Roper - 24/06/2016
    ;
    ; ----- Configuration
    
      'Chip Settings.
      #chip 16f18855,32
      #config RSTOSC_HFINT32
    
    ; ----- Define Hardware settings
    
      #define LED PORTB.0
    
      'LED port directions
      dir LED out
    
    ; ----- Main body of program commences here.
      Do
    
        LED = 1
        wait 250 ms
    
        LED = 0
        wait 250 ms
    
      Loop
    
    end
    

    Click the HEX/Flash Button on the toolbar (above) and the LED on the BB-Tray-Xpress should start blinking.

    For the sake of comparison or for users who don't yet have the Latest Great Cow Basic, here is the same program in XC8 created in MPLAB Xpress:

    /*
     * File:   BB-Tray-Xpress-Test.c
     * Author: caroper@gmail.com
     *
     * Created on 6/27/2016 8:44:28 AM UTC
     * "Created in MPLAB Xpress"
     */
    
    #include <xc.h>
    #define _XTAL_FREQ 4000000  // clock freq
    
    #define TRIS_LED TRISB0     // Define LED Port
    #define LAT__LED LATB0      // and Pin
    
    void main(void) 
    { 
        TRIS_LED = 0;           // Set LED as output pin
    
        // Infinite loop
        while(1) 
        {
            LAT__LED = 1;       // LED On
            __delay_ms(500);    // delay
            LAT__LED = 0;       // LED Off
            __delay_ms(500);    // delay
        }           
    return;
    }
    

    There you have it, a powerful, working development board with prototyping space.

    You can use the above code to test other Pins, Use the chart above to crossreferance the Socket to the MCU Pin and edit the line

    #define LED PORTB.0
    

    in the GCBasic Code or the Lines:

    #define TRIS_LED TRISB0
    #define LAT__LED LATB0
    

    In XC8, to match the Pin you wish to use.

    Future Tutorials will go into more detail of using the BB-Tray-Xpress as well as developing for and using the MikroBUS.

    Till then,

    Cheers
    Chris

     

    Last edit: Chris Roper 2016-06-27

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.