Documente Academic
Documente Profesional
Documente Cultură
Article Title
Author
Contents
Microchips XC-lent C Compilers World Wide Webinars Is MPLAB X IDE Too Automated for You? Theres a Doc for That! CCS Announces Support for MPLAB X Debuggers in the CCS IDE Proteus RTC Editions Available on microchipDIRECT MGC3130 Single Zone Development Kit Hillstar A Powerful New Wireless Tool Advanced Emulation Tool Offers Many New and Powerful Debugging Features New Analog Tools New Tools Best Sellers 2 2 3 4 5 6 7 8 9 15 17 18
October 2013
2. Or select the Clean and Build for Debugging from the drop-down menu under the Clean and Build icon.
3. Select Program Device for Debugging from the drop-down menu under the Program icon.
An additional drop-down menu is also available under the Upload icon to allow you to read the device up into memory or export the device memory to a file.
One last tip: Did you know you can change the install path of the IDE during an installation and have as many versions of MPLAB X IDE installations on your PC as you would like? Each installation has its own persistence directory to remember its last configuration.
The CCS C Profiler provides detailed information on execution times for every function.
Design Support:
Useful software, code examples and documentation are available on the web at http://www.microchip.com/gesticgettingstarted. Internal Microchip information including MGC3130 software and documentation, feedback to the GestIC team (e.g. issue tracking), FAQ, and training materials and plans can be accessed on the GestIC SharePoint page at http://mchpweb-2010/eng/HMID/gestic/SitePages/default.aspx.
Features:
MiWi stack support MiWi, MiWi P2P and MiWi Pro Wi-Fi stack support on Wireless Evaluation Board Feature-packed PIC32 MCU on Wireless Evaluation Boards to run MiWi and Wi-Fi protocol stacks PIC18F46J50 MCU featuring nanoWatt XLP Technology for MiWi Nodes MRF24J40MA FCC/IC/ETSI certified module MRF24WG0MA FCC/IC/ETSI certified module for IEEE 802.11 b/g MCP9700A temperature sensor LCD display to develop interactive wireless demos (Removable for lower power) Board can be powered by AAA batteries, 9V power supply, external power supply, or USB
Demo Software:
The demo software can be downloaded from the Microchip Libraries of Applications at www.microchip.com/MLA. After installing the MLA, you can find the demo source code at \Microchip Solutions\Combo folder
Advanced Emulation Tool Offers Many New and Powerful Debugging Features
Ken Pergola Microchip returns to its emulator system roots with the introduction of its Enhanced Midrange family PIC16(L)F1939 Emulation Extension Pak (part number AC244055, $50.00). This low-cost, second-generation in-circuit emulator system (ME2), when paired with a MPLAB REAL ICE, MPLAB ICD 3, or PICkit 3 tool, offers a toolbox full of emulation/debugging features for assisting customers with their tough code debugging jobs. Never before has Microchip offered this level of competitive and powerful emulation/debugging features at such a low price point. Execution out-of-bounds detection Breakpoints, trace, stack snapshots, triggers, and event combiners are driven by a common set of events that can feed each other to create complex triggering mechanisms for each feature Low-cost, single-product solution for emulating all PIC16(L)F1933/4/6/7/8/9 Enhanced Midrange devices (across 1.8 to 5.5 volt range, up to 32 MHz operational speed as specified in the PIC16F1939 family data sheets). The PIC16(L)F1939 Emulation Extension Pak comprises the Emulation Header board, the trace cable, the trace adapter board, and the gold SIP pins (pictured) and should be available for sale on microchipDIRECT in October. At this writing, introductory yellow-light support is available starting in MPLAB X IDE v1.90 for MPLAB REAL ICE only, with MPLAB ICD 3 and PICkit 3 tool support expected in future releases. To find out which of the above emulation features are expected to be phased into future MPLAB X IDE releases, please read the Functional Overview section that follows. How can this brand new emulation product help our customers? The PIC16(L)F1939 Emulation Extension Pak offers many new and powerful debugging features that give customers more choices to pick the right debugging feature(s) to solve the debugging task at hand efficiently at a minimal price. Time is money and engineers who are outfitted with powerful and easy-to-use advanced debugging solutions are better able to meet their companys ever decreasing product design life cycle schedules.
Features:
Real-time hardware instruction trace (up to MCUs full 32 MHz operational speed) 32 powerful hardware address/data breakpoints Enhanced event breakpoints 32 runtime data watch points Background debug mode (provides runtime ability to read/write RAM/SFRs and set breakpoints) Four Event Combiners (modelled after MPLAB ICE 2000 complex trigger machine) Hardware stack snapshot External trigger I/O Enhanced stopwatch cycle counter Previous program counter (PC) query
Functional Overview:
The PIC16(L)F1939 Emulation Extension Pak offers capabilities far beyond Microchips existing Enhanced Midrange lineage of debug headers formally known as Processor Extension Paks. Comparing and contrasting these two debugging solutions is beyond the scope and purpose of this short article. The main focus of this article is to give a brief introduction primarily of the exciting new capabilities of the PIC16(L)F1939 Emulation Extension Pak.
Its all about events with the PIC16(L)F1939 Emulation Extension Pak, so its best to introduce them now before delving into the various debug/emulation features which employ them. Breakpoints, trace, stack snapshots, triggers, and event combiners are driven by a common set of events that can feed each other to create complex triggering mechanisms for each feature. This common set (pool) of event sources is as follows: RESET instruction External halt (initiated by development tool) Device wake-up Stack overflow Stack underflow SLEEP instruction Watchdog timer reset Software breakpoint External trigger In signal MCLR reset Execution out-of-bounds condition Interrupt entry Interrupt exit Each of the four Event Combiners Each of the 32 hardware breakpoints
CPU stall to keep up with tough to trace programs. External Trigger In signal can initiate a trigger trace packet (or marker) in the trace data stream.
Powerful Hardware Address/Data Breakpoints Up to 32 powerful hardware address/data breakpoints are available to use on the PIC16(L)F1939 Emulation Extension Pak. Software breakpoints are useful, but theres nothing like real hardware breakpoints when you need unfettered control of qualifying the breakpoint/event conditions beyond the simple address matching that simple software breakpoints provide. Add to the mix a special interrupt contextual qualifier and these hardware breakpoints offer a high degree of configurability for our customers. With the PIC16(L)F1939 Emulation Extension Pak, using the term breakpoint is now a bit limiting, so at this point the concept of events can be introduced to augment the term breakpoint. Breakpoints are typically thought of as a mechanism to simply halt code execution but events need not actually halt code execution at all (although they still can if desired) but rather, can initiate some type of action while code is still running. For example, a watchdog timer reset event (breakpoint) need not halt execution anymore, but instead can be user-configured to generate a trigger out signal on the trigger out pin. Additionally, our ME2 Architect cited a succinct and rather clever example of configuring a data memory breakpoint to only generate a trigger out pulse in a routine that receives
Each of these event sources can be used to start/stop the Stopwatch Cycle Counter, set/reset an Event Combiner stage, start/stop Instruction Trace, or take a Stack Snapshot. Real-time Hardware Instruction Trace One of the PIC16(L)F1939 Emulation Extension Paks bragging rights is its real-time hardware instruction trace capability. Certain code troubleshooting situations lend themselves very well to gathering instruction trace data in order to find the root cause quickly and efficiently. The PIC16(L)F1939 Emulation Extension Pak can help customers bugs disappear with a trace: Up to full 32 MHz MCU operational speed. Ability to trace through reset conditions. Any event from the common event source pool can start/stop trace.
UART data bytes. An external frequency counter can then be used to determine the data rate of the communications. Some notable breakpoint features: 32 available address/data hardware breakpoints. Address range breakpoints (break within data or program memory address ranges). Data-Masking qualifier for data breakpoints (allows bit-field breakpoints). Data-Comparison qualifier for data breakpoints: = (equality), (inequality), < (less than), and > (greater than). Interrupt Context qualifier for address/data breakpoints (break in ISR code only, main code only, or both ISR and main code). Trigger Out qualifier for address/data breakpoints (generate a trigger out signal on event condition). Pass Count qualifier for address/data breakpoints (break on event condition occurring N times). Data breakpoints trigger on both normal and linear address modes. Breakpoints and other events can trigger without halting execution and can be used as trigger events to other features. A sample of some breakpoint options in MPLAB X IDE:
Enhanced Event Breakpoints The PIC16(L)F1939 Emulation Extension Pak introduces a new twist on what MPLAB X IDE has traditionally presented as Event Breakpoints in that you can assign a specific action to each of the following Event Breakpoints: RESET instruction SLEEP instruction Stack overflow/underflow Device wake-up Watchdog timer reset Execution out-of-bounds MCLR reset External Trigger In signal Software Breakpoint
The specific action that can be assigned to each of the above event breakpoints can be one of three choices: 1. Break (halt code execution only) 2. Trigger out (initiate a pulse on the Trigger Out pin only) 3. Break and trigger out (both halt code execution and initiate a pulse on the Trigger Out pin) Background Debug Mode The PIC16(L)F1939 Emulation Extension Paks onboard ME2 silicon contains a Background Debug Mode control interface that allows read/ write access to user RAM memory, SFRs, and emulation registers while the user program is running or even sleeping! Why is this significant? In some cases, stopping the user application in order to view and modify registers can cause damage to the system being debugged, or disrupt application functions to the extent
that debugging is actually counterproductive. For example, halting applications with communications between multiple microprocessors can lead to unrecoverable communications errors. Background Debug Mode capability includes: Allows Reading and Writing of RAM and Peripheral SFRs while device is executing code without disturbing execution. Allows Reading and Writing of RAM and Peripheral SFRs while device is in sleep. Allows Reading of the 16-level stack area while executing. Captures Stack Snapshot. Allows runtime/sleep time changes of In-Circuit Debug (ICD) settings and breakpoints (i.e. runtime address/data/complex/event breakpoints). Noticeably faster single-stepping speeds at lower MCU operating frequencies. Event Combiners An event combiner monitors multiple event inputs (from the event source pool) and can generate a halt or a trigger out based on combinations and sequences of those inputs. The PIC16(L)F1939 Emulation Extension Pak has four Event Combiners and each combines eight combinational or sequential events into a single event trigger. Individual breakpoints may be grouped into sequences, logical AND lists, or a nested combination of these for more complex control. The Event Combiners were modelled after the legacy MPLAB ICE 2000 complex triggers. Hardware Stack Snapshot The PIC16(L)F1939 Emulation Extension Pak has the ability to take a snapshot of the entire 16-level hardware stack area (including the stack pointer and program counter) by either a user-initiated snapshot or asynchronous event-triggered snapshot (via any event from the common event source pool). The stack area can then be inspected to ascertain code flow history.
Previous Program Counter (PC) Query The Previous PC feature captures the value of the Program Counter of the instruction that preceded the instruction which caused the actual break. For example, if a breakpoint occurs at the first instruction of a subroutine or the destination of a branch a query of the Previous PC will indicate the address of the calling or branch instruction. Additionally, if a code execution out-of-bounds halt occurs, a query of the Previous PC will indicate the address of the instruction that changed the PC. The breakpoint address stored in the stack will be the erroneous PC value that triggered the out-of-bounds condition. Execution Out-of-Bounds Detection Firmware on safety-critical systems needs to be rock-solid, and assurance that rogue code can be detected is paramount in these applications. The PIC16(L)F1939 Emulation Extension Pak can be used to detect out-of-bounds execution of code. Out-of-bounds code execution is detected by an event breakpoint that watches for PC values that exceed the available program memory of the emulated MCU. The out-of-bounds code execution condition is typically caused by a computed GOTO or CALL that erroneously computes the index, or by loading PCLATH with an incorrect value. Once code is halted due to the execution out-of-bounds event breakpoint the Previous PC functionality can be used to identify the offending instruction. Runtime Data Watch Points, Up to 32 runtime data watch points are available on PIC16(L)F1939 Emulation Extension Pak to allow visibility into SFR/variable changes while code is executing. Since the runtime data watch points use the Emulation Extension Paks trace hardware functionality, this feature requires the use of the MPLAB REAL ICE tool. Each runtime data watch point consumes a hardware breakpoint resource.
Enhanced Stopwatch Cycle Counter (32-bit Instruction Cycle Counter) The Stopwatch Cycle Counter has the ability to perform the existing basic instruction cycle counting (all instructions cycles counted) that exists on standard Enhanced Midrange parts as well as brand new enhanced modes: Only instruction cycles within the interrupt handler will be counted. Only instruction cycles outside the interrupt handler will be counted. Any event from the common event source pool can start or stop the Stopwatch Cycle Counter. NOTE: The count units are in instruction cycles, not in instructions (as not all instructions execute in a single cycle). External Trigger I/O One trigger input and one trigger output pin are available to the user externally on the PIC16(L)F1939 Emulation Extension Paks board. The trigger I/O allows the customer a lot of flexibility to generate or respond to various event conditions via externally-interfaced hardware or test equipment. Trigger In Used to generate a trigger condition, halt and/or trigger out signal when a falling edge occurs on the trigger input pin. Trigger In features: A trigger in pulse can be used to start/stop the Stopwatch Cycle Counter, set/reset an Event Combiner stage, start/stop Instruction Trace, take a Stack Snapshot, or generate a trigger trace packet (or marker) in the trace data stream. Programmable trigger in polarity (rising/falling edge generates a halt or trigger condition). Programmable Noise reduction/pulse reject filter enable (helps mitigate spurious triggers from halting code).
Trigger Out When an event, such as a breakpoint, occurs with an enabled trigger, a positive going pulse on the trigger out pin is generated. Numerous sources can initiate a Trigger out pulse: Each of the 32 hardware breakpoints Software breakpoint Each of the four Event Combiners Trigger test RESET instruction SLEEP instruction Stack overflow or underflow Device wake-up Watchdog timer reset Execution out-of-bounds condition MCLR reset Trigger In signal Halt External halt (initiated by development tool)
A handy feature regarding the trigger out signal is that its duration can last as long as the occurring event. For example, if the customer needs to time the duration of the watchdog timer (whose timeout period is user-programmable), the following code in conjunction with the trigger out and SLEEP event breakpoint features can make this super simple all without employing the old-school technique of writing a single line of (special, non-production) code to wiggle an I/O pin:
; ; ; ; ; ; ----------------------------------------------------T R I G G E R O U T T E S T : T I M I N G T H E W A T C H D O G T I M E R ----------------------------------------------------1) Ensure the watchdog timer configuration bit is enabled. 2) Set an Event Breakpoint (Break on SLEEP) to initiate a Trigger out action only. ; 3) Connect your oscilloscope probe to the TRIGGER OUT pin and set up your ; oscilloscope to trigger on the rising edge. ; 4) Run the following code: CLRWDT NOP NOP SLEEP ; The expiration if the watchdog timer will wake up the MCU from sleep after ~2 seconds.
; The trigger out pulse high-time duration is the duration of the watchdog timer: ___---___ ; Since the default watchdog timer period value is 2 seconds typical, the trigger out pulse ; measured on the oscilloscope should be approximately 2 seconds. NOP NOP NOP Loop_101: BRA Loop_101 ; -----------------------------------------------------
Programmable trigger out polarity (allows a negative going pulse to be generated on the trigger out pin upon a trigger condition occurring). Trigger test (allows a trigger out sanity check test by unconditionally forcing a trigger out pulse on the trigger out pin). Programmable slew rate control (allows the customer to enable/ disable slew rate limiting on the trigger out signal). NOTES:
Trigger Out features: Programmable one-shot mode (allows the trigger out pulse duration to be a fixed width regardless of MCU operating frequency, or the length of the event itself, which is MCU frequency-dependent).
MPLAB ICD 3 and PICkit 3 tool support planned for a future MPLAB X IDE release. Feature requires MPLAB REAL ICE tool. Feature is expected in future MPLAB X IDE releases.
Features:
Headers for connecting an external diode or CPU/GPU Resistance Error Correction verification USB-to-SMBus bridge for power and communications Capability to connect directly to an external SMBus master Accompanying Chip Manager software allows for viewing, changing, and saving of register values
Features:
Graphical user interface for control of all functions Built-in Highest Current Algorithm demonstration Charge ration and current measurement plot mode Capability to create custom emulation profiles Fully BC1.2 compliant
Features:
Dedicated charger emulation for popular downstream USB devices such as tablets and smart phones Configurable through jumper pins Selection of current limit and fault handling Fully BC1.2 compliant
Features:
Can be powered by one-cell, two-cell, or three-cell alkaline, NiCd, NiMH, one-cell Li-Ion or Li-Polymer batteries Input voltage range (Vin ): 0.35V to 5.5V, with Vin Vout Fixed output voltage: 2.0V or 3.3V and 3.3V or 5.0V, selected using a mini-dip switch on board Output current: typical 125 mA @ 3.3V output, 1.5V input or 200 mA @ 5.0V output, 3V input Start-up voltage: 0.82V (for MCP16251s converter) or 0.65V (for MCP1640Bs converter) at Vout = 3.3V and Iout = 1 mA, resistive load Automatic PFM/PWM operation for the MCP16251 converter PWM Switching Frequency = 500 kHz Enable state, selectable using the mini-dip switch on board Peak Input Current Limit (800mA for MCP1640 or 650mA for MCP16251) Over-temperature protection
New Tools
Sharon Baker AC164151 ADM00516 ADM00540 DM160218 DM182018 DM182020 DM183037 DM240015 DM320017 EVB88730 EVB-USB2642 SPI SRAM PICtail with Battery Backup EMC1182 Evaluation Board UCS1001 Evaluation Board MGC3130 Single Zone Development Kit Hillstar MiWi Protocol to Wi-Fi Wireless Demo Kit Wi-Fi Client Module Development Kit PIC18F67J94 Development Board MPLAB Starter Kit for PIC24F Intelligent Integrated Analog PIC32 CDMA M2M Development Platform LAN88730 Automotive Grade High-Speed MII/ RMII 10/100 Ethernet Transceiver Board USB2642 USB 2.0 2 Port Hub with UCS81001 Port Power Controller and Ultra Fast Flash Media Controller (MMC 4 and 8 bit SD) USB3613 3-port HSIC Up/Down USB 2.0 Hub Evaluation Board USB3813 3-port HSIC Down USB 2.0 Hub Evaluation Board MA330033 MA330035 SW006021-1H SW006021-1NH SW006021-2H SW006021-2NH SW320013-1 SW320013-2 SW320014-1 SW320014-2 dsPIC33EP512GM706 Single Motor Internal Op Amp PIM dsPIC33EP512GM710 General Purpose PIM MPLAB XC Standard High Priority Access MPLAB XC Standard High Priority Access (Floating License) MPLAB XC PRO High Priority Access MPLAB XC PRO High Priority Access (Floating License) AAC Decode Library (Non-modifiable Binary Code) AAC Decode Library (Source Code) PIC32 Bluetooth Audio Software Suite 1 PIC32 Bluetooth Audio Software Suite 2
EVB-USB3613 EVB-USB3813
AVAILABLE INTERNALLY (NOT VIA microchipDIRECT) PEGASUS-EVB Pegasus Mobile Embedded Controller Firmware Debugger Board
Best Sellers
Sharon Baker
10 DV164121
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, PIC32 logo, rfPIC and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MXDEV, MXLAB, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, mTouch, Omniscient Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. 2013, Microchip Technology Incorporated, All Rights Reserved.