AN2263 Freescale Semiconductor / Motorola, AN2263 Datasheet

no-image

AN2263

Manufacturer Part Number
AN2263
Description
PC Master Software: Creation of Advanced Control Pages
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
AN2263/D
12/2002
PC Master Software:
Creation of Advanced
Control Pages
By Milan Brejl
Objectives
Prerequisites
Introduction
S
Motorola Czech Systems Laboratories
Roznov pod Radhostem, Czech Republic
3
L Applications Engineering
This application note describes the advanced techniques for creating PC
master software Control Pages. For example, it can be represented by the
design of a framed Control Page composed of two frames, with an HTML-
based frame and Microsoft
This enables you to control and adjust the target board application parameters
and to visualize and analyze the board application processes. An adaptive
signal-prediction algorithm running on the target board is used as a
comprehensive example.
This application note assumes basic knowledge of:
PC master software is a PC Windows®-based application providing various
support for embedded applications. It is a tool that can be used for debugging,
monitoring, and controlling the target application and also for demonstrating the
target board application functionality.
Microsoft and Windows are registered trademarks of Microsoft Corporation in the U.S. and/or
other countries.
Freescale Semiconductor, Inc.
For More Information On This Product,
PC Master
Creation of HTML pages
Basic HTML scripting with VB Script
Creation of Microsoft Excel applications
Go to: www.freescale.com
®
Excel running embedded in the second frame.
© Motorola, Inc., 2002

Related parts for AN2263

AN2263 Summary of contents

Page 1

... Freescale Semiconductor, Inc. Application Note AN2263/D 12/2002 PC Master Software: Creation of Advanced Control Pages By Milan Brejl Applications Engineering Motorola Czech Systems Laboratories Roznov pod Radhostem, Czech Republic Objectives This application note describes the advanced techniques for creating PC master software Control Pages. For example, it can be represented by the ...

Page 2

... Freescale Semiconductor, Inc. AN2263/D The embedded application runs on a target board (see connected to the PC via an RS232 interface. The PC runs the PC master software application that communicates with the target board application. The PC master software can read and write the target board application variables, record variable value courses, and provides other functions useful for monitoring, controlling, or debugging the target board application ...

Page 3

... StartCurrentRecorder starts the currently-displayed recorder StopCurrentRecorder stops the currently-displayed recorder GetCurrentRecorderState retrieves the current recorder status code and status text of the currently-displayed recorder OnRecorderDone, called when the currently-selected recorder finishes downloading new recorder data Go to: www.freescale.com AN2263/D Control Page Functionality 3 ...

Page 4

... Freescale Semiconductor, Inc. AN2263/D Example: Step-by-Step Guide The rest of this document gives a step-by-step example of the creation of a complex PC master software Control Page. The following text describes: • • • • Figure 2. PC Master Software with Control Page Consisting of an HTML Frame and an Excel Frame ...

Page 5

... FIR (finite input response) system from the input x(n) Figure 4 shows the PC master software recorder chart displaying the Processor input signal x(n) Processor desired response d(n) Processor output signal y(n) contains the C-language source code of the target board Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide Figure 3. Figure 5 shows the evolution of the — 5 ...

Page 6

... Freescale Semiconductor, Inc. AN2263/D Figure 4. PC Master Software Recorder with Signals x(n), y(n) and d(n) and Some Application Parameters in PC Master Software Watch Control Page Our goal is to create a Control Page composed of an HTML frame and an Excel Proposal frame. The Control Page will: 1. Provide an interface to monitor and adjust all application ...

Page 7

... FIR coefficients w(n) – The calculation and visualization of the Spectral Function will be done in Microsoft Excel. – It will be described how to use Microsoft Excel embedded in the Control Page and how to access the w(n) coefficients in Excel Visual Basic script. Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide 7 ...

Page 8

... Freescale Semiconductor, Inc. AN2263/D 2. Calculate the statistics of the signals captured by the PC master Control Panel The Control Panel should be designed to allow the adjustment of all application Creation parameters (see 8 PC Master Software: Creation of Advanced Control Pages For More Information On This Product, software recorder – ...

Page 9

... II</b> </td> </tr> <tr> <td>amplitude:</td> <td> <input type="text" name="A2" size="7"> </td> Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide 6. The HTML "TABLE" tag with 9 ...

Page 10

... Freescale Semiconductor, Inc. AN2263/D </td> </tr> </table> The input boxes from the first table display the following parameters: • • • • The input boxes are named the same as the corresponding PC master software variables. This establishes an assignment between the input box and the PC master software variable that will be used when writing a new value from the input box into the board application ...

Page 11

... Repeat this part for all application parameters to fill all control panel input boxes: d_omg1, A2, d_omg2 (see End Sub </script> MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product, ReadSettings A1.Value = tv A1.Value = retMsg Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide Appendix B). 11 ...

Page 12

... Freescale Semiconductor, Inc. AN2263/D To enable the manual adjustment of the parameters displayed in the input boxes, equip each input box with two event procedures. The event calls a sub- routine and the sub-routine calls the target board via PC master software activeX object. <input type="text" name="A1" size="7" onchange="WriteValue" ...

Page 13

... Control Panel. <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Adobe GoLive 4"> <title>Control Page</title> <frame src="control_panel.html" name="HTML"> <frame src="LMS.xls" name="Excel"> Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide Figure 7). The left one is the 13 ...

Page 14

... Freescale Semiconductor, Inc. AN2263/D Figure 7. PC Master Software with Control Page and Spectral Function Sheet Microsoft Excel Microsoft Excel workbook embedded in the second frame of the Control Page Data Analysis will have three worksheets: • • • Master Software: Creation of Advanced Control Pages ...

Page 15

... PC master software data. MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product, Functionality. Figure 8). The following description explains how to fill these Figure 8. The Third ("Data") Worksheet in the Microsoft Excel Application Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide Figure 8) using Excel 15 ...

Page 16

... Freescale Semiconductor, Inc. AN2263/D PC Master Software The PC master software data can be accessed in Microsoft Excel using a ActiveX control in Visual Basic code that calls the PC master software ActiveX control functions. Visual Basic Similar to the HTML based Control Panel, the PC master software ActiveX object must be created first: Public pcm As McbPcm Set pcm = CreateObject(" ...

Page 17

... Module1 and open it as well. Create a global declaration of the PC master software ActiveX object variable pcm and ScheduleTime in Module1. Public pcm As McbPcm Public ScheduleTime As Variant MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product, serCnt = UBound(data, 1) valCnt = UBound(data, 2) MsgBox (msg) Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide 17 ...

Page 18

... Freescale Semiconductor, Inc. AN2263/D Create an event-procedure in ThisWorkbook that will be activated when the Excel file is opened: Private Sub Workbook_Open() Set pcm = CreateObject("MCB.PCM") ScheduleTime = Now + TimeValue("00:00:05") Application.OnTime ScheduleTime, "RecordAndAnalyze" End Sub This sub-routine assigns the PC master software ActiveX object to the pcm variable and schedules the sub-routine RecordAndAnalyze to run 5 seconds later ...

Page 19

... For (serCnt \ 2) MSB = data LSB = data MSB >= 128 Then sht.Cells 1).Value = ... (256 * MSB + LSB - 65535) / 32768 Else sht.Cells 1).Value = ... End If Next s Else MsgBox (msg) End If MsgBox (msg) Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide (256 * MSB + LSB) / 32768 19 ...

Page 20

... Freescale Semiconductor, Inc. AN2263/D The previous part of the sub-routine gets the data for the spectral function calculation. The next part loads the recorder signals for the signal statistics. The PC master software ActiveX component function GetCurrentRecorderData will be used in its variant for the VisualBasic GetCurrentRecorderData_t that is faster because it uses a typed array instead of variant array (see the PC Master Software User Manual) ...

Page 21

... For serCnt sht.Cells( 6).Value = serNames(s) For valCnt sht.Cells 6).Value = data(s, i) Next i Next s MsgBox (msg) Procedure:="RecordAndAnalyze", ... Schedule:=False contains the complete source code of the Microsoft Excel Visual Go to: www.freescale.com AN2263/D Example: Step-by-Step Guide 21 ...

Page 22

... Freescale Semiconductor, Inc. AN2263/D Using the PC Master In the previous example the sub-routine RecordAndAnalyze is called Software periodically each 5 seconds. Another way to handle the PC master software OnRecorderDone recorder data is to use the OnRecorderDone event. This event is called each Event time the currently-selected recorder finishes downloading of the new data. To assign a handler to this event in Visual Basic, declare the PC master software ActiveX object with the WithEvents keyword ...

Page 23

... Frac16 omg2; /* sine 2 actual phase <-1,1) */ Frac16 d_omg1; /* sine 1 phase inc <-1,1) Frac16 d_omg2; /* sine 2 phase inc <-1,1) void main (void) { UWord32 j; UWord16 i; MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product error */ */ */ */ */ */ */ Go to: www.freescale.com AN2263/D Appendix A 23 ...

Page 24

... Freescale Semiconductor, Inc. AN2263 master software initialization */ pcmasterInit(); /* ITCN initialization */ ioctl(ITCN, ITCN_INIT_GPRS, NULL); ioctl(ITCN, ITCN_INIT_IPR, NULL); /* SCI initialization */ ioctl(SCI_0, SCI_INIT, NULL); archEnableInt(); /* initialization */ __fixed2int(0.001 10 __fixed2int(0.5 __fixed2int(0.4); d_omg1 = __fixed2int(0.06); d_omg2 = __fixed2int(0.09); while( recorder routine call -> simulate periodical call of pcmasterRecorder routine e.g. in timer interrupt */ pcmasterRecorder() ...

Page 25

... Freescale Semiconductor, Inc. /* LMS adaptive algorithm */ /* ---------------------- */ /* FIR filter processing */ for (i=0 ; i< __mult(w[i],x[i]); } /* result error */ filter coefficients update */ for (i=0 ; i< w[i] = w[i] + 2*__mult(__mult(mi,e),x[i]); } } } MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product, Go to: www.freescale.com AN2263/D Appendix A 25 ...

Page 26

... Freescale Semiconductor, Inc. AN2263/D Appendix B <!****************************************************************************> <! <! Motorola Inc. <! (c) Copyright 2001 Motorola, Inc. <! ALL RIGHTS RESERVED. <! <!****************************************************************************> <! <! File Name: control_panel.xls <! <! Description: control tables to adjust application parameters <! <! Modules Included: <! <!****************************************************************************> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> ...

Page 27

... Dim succ,retMsg succ = pcm.WriteVariable(Window.Event.SrcElement.Name,Window.Event.SrcElement.Value,... retMsg) If succ then txtError.InnerText = "" else txtError.InnerText = retMsg End If End Sub Sub WriteValueOnEnter If chr(Window.Event.KeyCode) = VBCR Then WriteValue End If End Sub MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product, Go to: www.freescale.com AN2263/D Appendix B 27 ...

Page 28

... Freescale Semiconductor, Inc. AN2263/D </script> <object classid=clsid:48A185F1-FFDB-11D3-80E3-00C04F176153 height=1 id=MCB_PC_Master_Services1 name=pcm width=1></object> <table border="0" cellpadding="5" cellspacing="0"> <tr> <td valign="top"> <table bgcolor="#00aacc" border="8" bordercolordark="#006688" bordercolorlight="#00ddff" cellpadding="4" cellspacing="0" width="100%"> ...

Page 29

... ReadSettings </script> </body></html> MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product, onkeydown="WriteValueOnEnter"> samples</td> onkeydown="WriteValueOnEnter"></td> Go to: www.freescale.com AN2263/D Appendix B 29 ...

Page 30

... Freescale Semiconductor, Inc. AN2263/D Appendix C í***************************************************************************** í Motorola Inc. í (c) Copyright 2001 Motorola, Inc. í ALL RIGHTS RESERVED. í***************************************************************************** í File Name: lms.xls í Description: capture of application data to third worksheet í Modules Included: ThisWorkbook, Module1 í***************************************************************************** '******************* '* ThisWorkbook: * '******************* Private Sub Workbook_Open() Set pcm = CreateObject("MCB.PCM") ScheduleTime = Now + TimeValue(" ...

Page 31

... For valCnt sht.Cells 6).Value = data(s, i) Next i Next s End If ScheduleTime = Now + TimeValue("00:00:05") Application.OnTime ScheduleTime, "RecordAndAnalyze" End Sub MOTOROLA PC Master Software: Creation of Advanced Control Pages For More Information On This Product, Go to: www.freescale.com AN2263/D Appendix C 31 ...

Page 32

... Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. digital dna is a trademark of Motorola, Inc. All other product or service names are the property of their respective owners. Motorola, Inc Equal Opportunity/Affirmative Action Employer. © Motorola, Inc. 2002 AN2263/D Rev. 0 12/2002 Go to: www.freescale.com ...

Related keywords