Microchip's PIC32 Development Kit Kick Starts Ethernet Designs

DN Staff

July 9, 2010

6 Min Read
Microchip's PIC32 Development Kit Kick Starts Ethernet Designs

MicrochipTechnology's PIC32 Ethernet kit gives developers an opportunity to workwith a 32-bit MCU and its Ethernet and USB capabilities. Fifteen exercisesprovide many opportunities to learn about the kit's software and hardware. Ihighly recommend this kit.

The PIC32 Ethernet kit I received included an evaluation board,CD-ROM, Ethernet cable and two USB cables. A PIC32MX795F512L MCU controls I/Odevices on the board, including a separate MCU that manages USB communicationsand on-board debug capabilities.

The board's Ethernet connector and three USB connectors givedevelopers plenty of ways to use the MCU's capabilities. A USB-Standard-Aconnector provides access to the board as an embedded host. A USB-Micro-ABconnector lets developers use the board as a host, a device or USB-on-the-godevice. A USB-mini-b connector serves as the link between a host PC andintegrated debug portions of the MCU and board. A Hirose connector on the boardlets people add PIC32 expansion boards or create their own add-on boards.

This kit requires the usual start-up steps to load software andcheck for updates. Afterward, the software starts a Windows media-playerpresentation of the steps needed to configure the USB drivers and connect a PCto the PIC32 board. This format worked well and should give a newcomer to devkits confidence to get the kit up and running quickly without any problems. TheUSB steps include a diagram for a different board, but the connection becameobvious - use the full-size-A to mini-B USB cable. The three versions of PIC32starter kits, General Purpose, USB, and Ethernet/USB, each use a slightlydifferent board.

My PC offered the choice of two USB drivers for the PIC32 board. Thefirst one didn't power the board, so I tried the second one, which worked.

I recommend people print the "PIC32 Starter Kit User'sGuide" (DS61159A) available on the accompanying CD or within the installedcode and documents: C:/PIC32 Starter Kits-->Documentation. You will findmany other useful documents in this folder, too. Hats off to Microchip for theexcellent documentation. The guide explains its own format and conventions andlists the contents of its five chapters and one appendix. A list ofrecommended-reading materials points to release notes, MCU-family data sheets,guides for the MPLAB IDE, the MPLAB C compiler and provides a link to USBdocuments. Do review the PIC32MX Starter Kit Release Notes in the Documentfolder noted above. These notes provide a table that shows the directorystructure for Starter Kit files loaded on my PC. If only all dev kits providedthis type of helpful information.

The first chapter in the User's Guide describes the three boardtypes and provides component-placement diagrams for each so you can quicklyidentify a kit's components, signals,LEDs, jumpers and so on. It's good to see that type of information in a dev-kitdocument.

Chapter 2 starts with a description of what you'll accomplish inthe chapter, the starter kit and the Microchip software -- the MPLAB IDE and Ccompiler. (The compiler has a 60-day trial period.) A written tutorialduplicates the set-up steps from the audio-visual tutorial and takes you throughan LED-toggle sample program you build, load into the PIC32 MCU and run. Theinstructions are clear and easy to understand. The program let me type a key,R, G or O, to control the red, green and orange/yellow LEDs on the PIC32 board.(The board comes with a preprogrammed "Simon Says" game but I jumpedright to the first LED-Flash example. The demo applications include the game incase you want to reload it onto the board.)

Next I went through a tutorial that explained how to start my ownprogramming project. When you start a project on your own, refer to thischapter as a refresher.

All of the 15 starter-kit demo applications will run on the PIC32Ethernet board. The last general-purpose demo I compiled and ran illustrateshow to sense pushbuttons (or other digital events) and respond directly or viaan interrupt service routine. Anyone who uses this kit should also run the"Hello World" demo that illustrates how to embed commands in code todisplay debug and test information in the output window on a host PC's display.The IDE included the usual trace, step and watch capabilities, too.

Microchip does not burden any of the sample code with"extras" that could confuse people who want to start at a basiclevel. (The company offers source code for many other PIC32 programs,libraries, and examples.)

After flashing lights and seeing "Hello World," I wentright to the "Ethernet-TCPIP-BSD-HTTP Server" demonstration. But Icouldn't find any instructions for this demo. I opened the code and lookedthrough comments but still couldn't find instructions about what to do next.After searching the Internet and Microchip's website I was about to give upwhen I uncovered the three-page "Getting Started: Running the 'TCPIP-BSD -HTTP Server' demo," in the same folder as the source code for the project.

When you use the MPLAB IDE, the list of files on the left side ofthe screen shows "Other Files" at the bottom. I expected to findinstructions here, but found only the main User's Guide and the Release Notesreferred to previously. But Microchip's support people should have thedemo-instruction document added to the Other Files list now. If not, you nowknow where to find it.

The Ethernet demo code compiled properly, although I got severalwarning messages. But the newest code from Microchip should not generate thesemessages. If you do get warning messages about an "r" or"READ" command, you can ignore them and proceed. I loaded the codeinto the PIC32 board and followed instructions in the three-page document. Iconfirmed settings in the code before I tried to connect directly to my lab PCvia a cross-over Ethernet cable (not supplied) or to my small router with thesupplied cable. But, neither my lab PC nor other network computers could"find" the PIC32 board. After trying and retrying to make aconnection without success, I contacted technical people at Microchip whowalked me through several steps to set up my router properly. After Idisconnected everything else from the network but my lab PC and reset therouter, the program worked. So, if you get into the Ethernet demo applicationand it doesn't work, check your router settings and ensure the router canrecognize the board. The problem I had didnot relate to the PIC32 board or its software.

During my conversation with the Microchip support people I followedinstructions in the three-page guide and revised the demo code to turn on theDynamic Host Configuration Protocol (DHCP): DEMO_USE_DHCP = 1
Then I changed the router settings and achieved the goal ofdisplaying five images on my lab PC's display.

The main User's Guide includes lots of useful hardwareinformation that includes block diagrams, large schematic diagrams andschematic diagrams of circuit sections you can read without eye strain.

One warning: Don't expect to become an Ethernet programming whizafter you go through the demo applications in this kit. Mastering Ethernetcommunications takes work and experimentation. I recommend the followingpublication: "Microchip TCP/IP Stack with BSD Socket API," AN1108.Microchip Technology. You can download code that goes with this applicationnote.

Microchip provides a free TCP/IP stack and additional applicationinformation and tutorials here.

Sign up for the Design News Daily newsletter.

You May Also Like