Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
resources:tools-software:sigmastudio:usingsigmastudio:scripting:iscripted [03 Nov 2022 14:52] ananthakalyani Sankarresources:tools-software:sigmastudio:usingsigmastudio:scripting:iscripted [30 Dec 2022 13:55] ananthakalyani Sankar
Line 1715: Line 1715:
 ==== Pause and Resume Options ==== ==== Pause and Resume Options ====
 \\ \\
-=====USBiReset API=====+=====USBiReset=====
 <code csharp> <code csharp>
 HResult ResetUSBInterface(); HResult ResetUSBInterface();
Line 1724: Line 1724:
 \\ \\
 \\ \\
-=====GetIcNames API=====+=====GetIcNames=====
 <code csharp> <code csharp>
 ArrayList GetIcNames(); ArrayList GetIcNames();
Line 1733: Line 1733:
 \\ \\
 \\ \\
-===== E2PROM Options ===== +===== Selfboot Options ===== 
-===Write to E2PROM ===+===Selfboot Port settings===
 <code csharp> <code csharp>
-HResult WriteLatestCompilationthroughDSP();+SELFBOOT_PORT_SETTINGS(string cellName, int[] values);
 </code> </code>
 <fc #6495ed>//Description//</fc> <fc #6495ed>//Description//</fc>
 \\ \\
-The method is used to load schematic to E2PROM through DSP +The method is used to settings the E2prom port through server/script
-Note: Call the compilation is required before using this. +
 \\ \\
 +<fc #6495ed>//Parameters//</fc>
 +\\
 +Name:       Cellname
 +\\
 +Type:       String
 \\ \\
-<code csharp> 
-HResult WriteLatestCompilationUSB(); 
-</code> 
 <fc #6495ed>//Description//</fc> <fc #6495ed>//Description//</fc>
 \\ \\
-The method is used to load schematic to E2PROM through USB +Cell name of SigmaDSP IC example"IC 1"
-NoteCall the compilation is required before using this. +
 \\ \\
 +Name:    PORT_SETTINGS
 \\ \\
-===Erase ===+Type:       int 
 +\\ 
 + 
 +==Example for Python :=
 +\\ 
 +PORT_SETTINGS = VARIANT(pythoncom.VT_ARRAY| pythoncom.VT_I4, [1048576,0x03,0x02,0x03,0x06,0xc7,10,10000,256,1,0]) 
 +\\ 
 +==Example for .sss:== 
 +\\ 
 +System.Collections.Generic.List<int> PORT_SETTINGS = new System.Collections.Generic.List<int>(); 
 +\\ 
 +\\ 
 +PORT_SETTINGS.Add(1048576);\\ 
 +PORT_SETTINGS.Add(0x03);\\ 
 +PORT_SETTINGS.Add(0x02);\\ 
 +PORT_SETTINGS.Add(0x03);\\ 
 +PORT_SETTINGS.Add(0x06);\\ 
 +PORT_SETTINGS.Add(0xc7);\\ 
 +PORT_SETTINGS.Add(10);\\ 
 +PORT_SETTINGS.Add(10000);\\ 
 +PORT_SETTINGS.Add(256);\\ 
 +PORT_SETTINGS.Add(1);\\ 
 +PORT_SETTINGS.Add(0);\\ 
 +\\ 
 + 
 +===Selfboot write ===
 <code csharp> <code csharp>
-HResult EraseMemorythroughDSP ();+SELFBOOTWRITE(string cellName, string writeThrough);
 </code> </code>
 <fc #6495ed>//Description//</fc> <fc #6495ed>//Description//</fc>
 \\ \\
-The method is used to Erase the E2PROM. +The method is used to write through "DSP" or "USB" (USB currently not supported)
-\\+
 \\ \\
-===Export Data from E2PROM===+ 
 +===Selfboot Export===
 <code csharp> <code csharp>
-HResult ProjectExportSelfbootFiles(string path);+EXPORT_SELFBOOT_DATA(bool readThroughDSP, string fullyQualifiedFileName);
 </code> </code>
 <fc #6495ed>//Description//</fc> <fc #6495ed>//Description//</fc>
Line 1772: Line 1798:
 <fc #6495ed>//Parameters//</fc> <fc #6495ed>//Parameters//</fc>
 \\ \\
-Name:       path+Name:       projectexportFile
 \\ \\
 Type:       String Type:       String
Line 1780: Line 1806:
 stored the .Hex file on this path stored the .Hex file on this path
 \\ \\
 +\\
 +
 +===Selfboot Erase===
 +<code csharp>
 +SELFBOOTERASE(string cellName);
 +</code>
 +<fc #6495ed>//Description//</fc>
 +\\
 +The method is used to Erase the E2PROM.
 +\\
 +====Examples====
 +
 +
 +"""
 +/***************************
 + * [0]  -> EEPROM_MEMORY_SIZE
 + * [1]  -> EEPROM_SPI_ADDRESS_BYTES
 + * [2]  -> EEPROM_SPI_WRITE
 + * [3]  -> EEPROM_SPI_READ
 + * [4]  -> EEPROM_SPI_WRITE_ENABLE
 + * [5]  -> EEPROM_SPI_ERASE
 + * [6]  -> EEPROM_SPI_ERASE_TIME
 + * [7]  -> EEPROM_WRITE_SPEED
 + * [8]  -> EEPROM_PAGE_SIZE
 + * [9]  -> EEPROM_SPI_MODE   ////SPI mode0==0 or mode3==1
 + * [10] -> EEPROM_PROTOCOL  ////SPI=0, I2C=1
 + *
 +  <fc #008000>Note</fc>: The settings are reference to the EEPROM data sheet
 + * *************************/
 +   <fc #008000> Note:</fc> Register the SigmaStudioServer before executing this script using commad prompt
 +
 +    cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
 +    RegAsm “C:\Program Files\Analog Devices\SigmaStudio 4.7\Analog.SigmaStudioServer.dll” /codebase
 +
 +    cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
 +    RegAsm “C:\Program Files\Analog Devices\SigmaStudio 4.7\Analog.SigmaStudioServer.dll” /codebase
 +
 +"""
 +
 +
 +The following shows an example of how to using Selfboot . 
 +
 +<code csharp>
 +rom  win32com.client.dynamic import Dispatch
 +from win32com.client import VARIANT
 +import pythoncom
 +import sys
 +
 +try:
 + import clr
 +except:
 + import pip
 + pip.main(['install', 'pythonnet'])
 + import clr
 +
 +clr.AddReference('System.Collections')
 +from System.Collections.Generic import List
 +
 +PORT_SETTINGS = VARIANT(pythoncom.VT_ARRAY| pythoncom.VT_I4, [1048576,0x03,0x02,0x03,0x06,0xc7,10,10000,256,1,0])
 +
 +## This program is designed to test SigmaStudio scripting from Python. 
 +if __name__ == "__main__":     
 +    
 +    server = Dispatch('Analog.SigmaStudioServer.SigmaStudioServer')
 +    print('Running')
 +
 +    projectexportFile= "C:\Work\Test\Python1\SelfBootWrite_export" # Needs update
 +    projectexporteraseFile= "C:\Work\Test\Python1\SelfBootErase_export"  # Needs update 
 +    Cellname = 'IC 1'
 +    SelfbootThrough = 'DSP'
 +    
 +    status = server.SET_TIMEOUT(120) # 2 Min Needs update if erase or export of complete EEPROM
 +    print('set_timeout..')
 +    server.COMPILE_PROJECT
 +    
 +    print('Selfboot Port settings')
 +    # Arg1 - Cell name of SigmaDSP IC example: "IC 1"
 +    # Arg2 - EEPROM port settings
 +    server.SELFBOOT_PORT_SETTINGS(Cellname, PORT_SETTINGS)
 +    
 +    print('Selfboot write')
 +    # Arg1 - Cell name of SigmaDSP IC example: "IC 1"
 +    # Arg2 - write through "DSP" or "USB" (USB currently not supported)
 +    server.SELFBOOTWRITE(Cellname, SelfbootThrough)
 +    
 +    print('Selfboot Export')
 +    # Arg1 - True for DSP, False for USB (USB currently not supported)
 +    # Arg2 - Export file path
 +    server.EXPORT_SELFBOOT_DATA(True, projectexportFile)
 +    
 +    print('Selfboot Erase')
 +    # Arg1 - Cell name of SigmaDSP IC example: "IC 1"
 +    server.SELFBOOTERASE(Cellname);
 +    
 +    server.EXPORT_SELFBOOT_DATA(True, projectexporteraseFile)
 +    
 +    server.SAVE_PROJECT
 +    
 +
 +</code>
 +
 +
 +
 +
 +===== IPAT Options =====
 +===Write===
 +<code csharp>
 +HResult IPATParamWrite(int numOfBytesToWrite, byte[] dataToWrite, int ipatWriteAddress, int _numOfLoadsAndTriggers, int protocol, int chipAddress, int addressOfStartAddress, int addressWidth, int registerByteLength, int communicationChannel, int ICType);
 +</code>
 +===Read===
 +<code csharp>
 +HResult IPATParamRead(int numberBytesToRead, out byte[] dataRead, int protocol, int chipAddress, int ipatReadAddress, int AddressWidth, int RegisterByteLength, int communicationChannel, int ICType);
 +
 +</code>
 +<fc #6495ed>//Description//</fc>
 +\\
 +The method is used to Write / from Read the values of the parameter to/from IPAT Address.
 +\\
 +\\
 +<fc #6495ed>//<fc #6495ed>Parameters</fc>//</fc>
 +\\
 +Type & Name:       int numOfBytesToWrite 
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +Number of bytes in 'dataToWrite' to write to the dsp 
 +\\
 +\\
 +Type & Name:       int writeToData
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +The data to write
 +\\
 +Type & Name:       int ipatWriteAddress
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +Indirect address of the parameter to be load
 +\\
 +Type & Name:       int _numOfLoadsAndTriggers
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +Number of consecutive loads
 +\\
 +Type & Name:       int protocol
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +Serial prorotcol to transfer the data
 +\\
 +Type & Name:       int chipAddress
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +I2C - Load Address, SPI - Address is zero
 +\\
 +Type & Name:       int addressOfStartAddress
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +Address of the IPAT StartAddress
 +\\
 +Type & Name:       int addressWidth
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +The width of address
 +\\
 +Type & Name:       int registerByteLength
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +address increment
 +\\
 +Type & Name:       int communicationChannel
 +\\
 +<fc #6495ed>//Description//</fc>
 +\\
 +The commumnication channel USBi/AARDVARK
 +\\
 +Type & Name:       int ICType
 +\\
 +
resources/tools-software/sigmastudio/usingsigmastudio/scripting/iscripted.txt · Last modified: 30 Dec 2022 13:56 by ananthakalyani Sankar