Home
SR-Mk3 User`s manual
Contents
1. Amplitude V Dc Signal output Int x input Codec 35 830 ACestimate Vrms 16334 Block size Out f0mtpet Codec 39 670 DC V 6500 00 Amplitude max 2 15V cont on i Offset 132 1500 00 tz Compensation 2 41528E 6 Figure 2 SR2_SignalTracker application Time Signal tab To start the application simply click on the white arrow at the top left of the window The application sends blocks of samples of the selected length and waveform to the selected output and records blocks of samples of the same length on the selected input The recorded input samples are synchronous to the output samples 5 6 1 Time Signal Tab 5 6 1 1 Time Indicator The time signal tab presents a time plot of the signal sampled on the selected input The amplitude scale takes into account the gain of the analog chain and PGA gain so that the signal amplitude is represented in Volts at the connector Signal Ranger mk3 User s Manual 15 Soft PI 5 6 1 2 AC estimate Vrms Indicator This indicator presents the RMS value of the input signal any DC offset is removed before RMS calculation 5 6 1 3 DC V Indicator This indicator presents the average DC value of the time signal 5 6 1 4 Signal Output Control The Signal output control selects a type of waveform from a list of predefined waveforms The No Output selection sends zero samples to the output 5 6 1 5 Block Size Control The Block size co
2. e f necessary the function transfers the required bytes to or from the Data area of the mailbox The number of bytes to transfer is the smaller of the NbBytes field of the mailbox and the USBTransferSize result just computed e Finally the number of bytes transferred must be subtracted from the NbBytes value and the NbBytes field must be updated with the new value in the mailbox e The TransferAdaress field may need to be incremented depending on how the function uses this information Typically K_Read and K_Write kernel functions increment TransferAddress so that the next segment is transferred to from the subsequent memory address However some user functions may use this field in a different way For instance it may be used as an arbitrary FIFO buffer number in some implementations For K_Read and K_Write TransferAddress represents a number of bytes e After the execution of the requested function the DSP asserts the HINT signal to signal the USB controller that the operation has completed This operation has been conveniently defined in a macro Acknowledge in the example codes and can be inserted at the end of any user function Note that from the PC s point of view the command seems to hang until the Acknowledge is issued by the DSP User code should not take too long before issuing the Acknowledge For more information see section on kernel operation Note On SignalRanger_mk2_Next_Generation if TransferAddress is used to t
3. out or rbt extension The firmware containers must be stored in the same hierarchy as the top application VI The following figure shows the front panel of the Create Firmware Container vi This VI is used to create a container for a out file for DSP code as well as a rbt file for FPGA logic R Create_Firmware_Container vi Signal_Ranger_mk3 lvli TBR Figure 14 Create_Firmware_Container vi To use this VI follow the steps below 1 Run the VI 2 Atthe prompt select the out or rbt file containing the data 3 The VI creates a container VI with the same name as the input file and adds the vi extension at the end 4 Atthe prompt save the container VI in the proper directory see Firmware Container VI Locations below Signal Ranger mk3 User s Manual 37 Soft PI 9 5 4 1 2 Firmware Container VI Locations The firmware container VIs must be located in the same directory as the top level VI of the application that uses them 9 5 4 2 Firmware Stored as Binary files The firmware files are stored on the host as original out and rbt files The firmware files are loaded by the LabVIEW interface library when required 9 5 4 2 1 Firmware File Locations The out and rbt files must be located in the directory one level above the top level application VI Note that this is one level up from where container VIs would be located The files mu
4. 10 4 8 4 Outputs e EntryPoint Entry point where the code was started EntryPoint is found in the COFF file 10 4 9 SR3_DLL_Load_User 10 4 9 1 Prototype int32_t SR3 DLL Load User int32 t BoardRef char Complete File Path char File Namef uint32_t EntryPoint 10 4 9 2 Description This function loads a user DSP code into DSP memory but does not run it It may be used when initializations have to be performed before execution If Complete File_ Path and File _ Name are empty a dialog box is used The DSP is reset prior to beginning the load After loading the code the symbol table is updated in the Global Board Information Structure Signal Ranger mk3 User s Manual 66 Soft PI The function checks if the type of COFF file is right for the target DSP If not an error is generated 10 4 9 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3 Base Open Next Avail Board e Complete File Path This string represents the file path leading to the COFF out file of the DSP user code A dialog box is presented if both Complete File_ Path and Firmware _ File are empty e File Name This is the file name of the firmware file If Firmware File is not empty the function resolves the path using the standard rules for firmware locations If Firmware_Files is empty the VI looks at the Complete_File_Path argument If Comp
5. Read functions are performed asynchronously and are very fast Writes are sequential and are performed under GPIO_0 interrupt linked to the INT6 DSP interrupt The typical write time is 60 us per word Erasure is asynchronous and may be quite long typ 0 5 s sector max 3 5 s per sector Erasure functions wait until all writes are completed before beginning They are blocking which means that execution is blocked within the erasure function as long as the erasure is not completed Read write and erase addresses are 32 bits Note All addresses passed to and from the driver are byte addresses This is true even though the Flash memory is composed of 16 bits words only At the lowest level all operations are performed and counted in 16 bit words The numbers of operations to perform read write and erase are specified to the driver in number of 16 bit words Nonetheless all addresses are byte addresses Signal Ranger mk3 User s Manual 84 Soft PI Reads are very simple They are performed asynchronously using the SR3FB_Read function This function returns the content of any 32 bit address Writes are performed sequentially using the SR3FB_ Write function Writes are performed at addresses defined in the FB_WriteAddress register This register is not user accessible It must be initialized before the first write of a sequence and is automatically incremented after each write The FB_WriteAddress register can be initiali
6. e DSP Firmware Name Size A string of sufficient length must be allocated for the function to return the name of the DSP file present in Flash DSP_Firmware_Name_Size must be set to the actual size allocated for the string e FPGA_Logic_Name_Size A string of sufficient length must be allocated for the function to return the name of the FPGA file present in Flash FPGA_Logic_Name_Size must be set to the actual size allocated for the string 10 4 1 4 Outputs e BoardRef This is a number pointing to the entry corresponding to the board in the in Global Board Information Structure The interface can manage a multitude of boards connected to the same PC Each one has a corresponding BoardRef number allocated to it when it is opened All other interface functions use this number to access the proper board Signal Ranger mk3 User s Manual 59 Soft PI e DSP _Firmware_Name This string contains the name of the DSP firmware file that is present in Flash The string is empty if the Flash does not contain any firmware The string is also empty if the ForceReset control is true e FPGA_Logic_Name This string contains the name of the FPGA logic file that is present in Flash The string is empty if the Flash does not contain any FPGA logic The string is also empty if the ForceReset control is true Note The handle that the interface provides to access the board is exclusive This means that only one application at a time can open
7. function places the register contents in i2c_data 1 void User_I2C_WriteReg This function initiates a write sequence of one register at the CODEC control port Before calling User_l2C_WriteReg the PC or DSP code must initialized i2c_data 0 with the register number to write and i2c_data 1 with the register contents 12 2 5 LabVIEW Support VI The SA3_DetermineRegister_CS42436 LabVIEW VI is provided to facilitate the setting of the CODEC registers and configuration variables The output cluster of this Vi contains the values for the CODEC driver variables Div_osc DSM_SSM and AICRegf17 AIC CFG 12 2 5 1 Controls and Indicators 12 2 5 1 1 AIC CFG Signal Ranger mk3 User s Manual 92 Soft Ble Figure 15 AIC Cfg Controls 12 2 5 1 2 Sampling Rate The sampling rate can be selected with this control The sampling rate can be chosen in a set of values between 4 kHz and 96 kHz Note that the control only exposes the most frequent sampling frequencies others are possible The Preferred Mode is used whenever the chosen sampling frequency allows the choice Some choices of sampling frequency are only compatible with the DSM mode 12 2 5 1 3 Preferred Mode This control indicates if the sampling mode should be DSM Double Rate Sampling or SSM Single Rate Sampling Some sampling frequencies only allow the DSM mode In this case the preferred mode is ignored At low level this control acts on the Div_osc and
8. Boolean indicating the direction of transfer true gt read false gt write Atomic Boolean indicating if the transfer is made atomic or not The transfer is always atomic by default Error in LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3 Base Open Next Avail_ Board vi Use this output to propagate the reference number to other Vis DataOut Data read from DSP memory Real DSPAddress Actual address where the transfer took place This address takes into account the resolution of Symbol if used and the effect of Offset ErrorCode This is the error code returned by the kernel function that is executed The value of this indicator is irrelevant in this interface Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 6 SR3 Base User Move Offset This VI is similar to SR3_Base_Bulk_Move_Offset except that it allows a user defined DSP function to replace the intrinsic kernel function that SR3_Base_Bulk_Move_Offset uses The operation of the USB controller and the kernel allows a user defined DSP function to override the intrinsic kernel functions See kernel documentation below For this the user defined DSP function must perform the same actions with the mailbox as the
9. even in situations where the DSP code has crashed Whenever the DSP is reset the symbol table that might have been in effect previously is flushed A new symbol table may be implemented in the future is new code is loaded 11 10 4 Resources Used By The Kernel To function properly the kernel uses the following resources on the DSP After the user code is launched those resources should not be used or modified in order to avoid interfering with the operation of the kernel and retain its full functionality The kernel resides between byte addresses 0x10E08000 and 0x10E08FFF in the L1PRAM of the DSP The user should avoid loading code into or modifying memory below byte address 0x10E09000 in the L1PRAM The mailbox of the kernel resides between byte addresses 0x10F04000 and 0x10F0420B in L1DRAM This section is reserved and new data cannot be loaded into this section However a user function can use the mailbox to develop a level 3 kernel function The kernel locates the interrupt vector table at byte address 0x10E08000 inL1PRAM The user code should not relocate the interrupt vectors anywhere else The interrupt vectors from address 0x10E08000 to 0x10E0809F cannot be modified All new vectors must be defined at address 0x10E080A0 and above The PC via the USB controller uses the HPI_Int interrupt from the HPI to request an access to the DSP The event from the HPI is linked to the INT4 maskable interrupt If necessary the user code can t
10. is guaranteed 10 4 7 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3 Base Open Next Avail Board e ReadWrite 1 gt Read 0 gt Write e Symbol Character string of the symbol to be accessed If Symbol is empty DSPAddress and MemSpace are used e DSPAddress Physical base DSP address for the exchange DSPAddress is only used if Symbol is empty e MemSpace Memory space for the exchange data program or IO MemSpace is only used if Symbol is empty or left unwired e Offset Represents the offset of the data to be accessed from the base address indicated by Symbol or DSPAddress The actual access address is calculated as the sum of the base address and the offset Offsetis useful to access individual members of a structure or an array e Data Array of bytes to be written to DSP memory Signal Ranger mk3 User s Manual 65 Soft PI e Size Represents the number of bytes to transfer For a read or a write the Data array allocated must be larger or equal to Size 10 4 7 4 Outputs e Data Array of bytes read from DSP memory The Data array passed in argument to the function must be larger or equal to Size 10 4 8 SR3_DLL_LoadExec_User 10 4 8 1 Prototype int32_t SR3_DLL_LoadExec_User int32_t BoardRef char Complete_File_Path char File Namef uint32_t EntryPoint 10 4 8 2 Descripti
11. 1 Prototype int32_t SR3 DLL Load UserSymbols int32 t BoardRef char Complete File Path char File_Namef 10 4 11 2 Description This function loads the symbol table of a user DSP code in the Global Board Information Structure f Complete_File_Path and File_Name are empty a dialog box is used In previous versions of the SignalRanger platform this function was used to gain symbolic control of DSP code that had been Signal Ranger mk3 User s Manual 67 Soft PI running from power up In the new architecture this is less useful since in this case the symbol table is found in Flash The function checks if the type of COFF file is right for the target DSP If not an error is generated 10 4 11 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3 Base Open Next Avail Board e Complete File Path This string represents the file path leading to the COFF out file of the DSP user code A dialog box is presented if both Complete File_ Path and Firmware _File are empty File Name This is the file name of the firmware file If Firmware File is not empty the function resolves the path using the standard rules for firmware locations If Firmware_Files is empty the VI looks at the Complete_File_Path argument If Complete_File_Path is empty a dialog is presented 10 4 11 4 Outputs None 10 4 12 SR3 DLL Read Erro
12. 10 SR3_DLL_K_Exec 67 10 4 11 SR3_DLL_Load_UserSymbols 67 10 4 12 SR3_DLL_Read_Error_Count 68 10 4 13 SR3_DLL_Clear_Error_Count 68 10 4 14 SR3_DLL_Flash_InitFlash 69 10 4 15 SR3_DLL_Flash_EraseFlash 69 10 4 16 SR3_DLL_Flash_FlashMove_U8 70 11 DSP CODE DEVELOPMENT 70 11 1 Code Composer Studio Setup 71 11 2 Project Requirements 71 113 C Code Requirements 71 11 4 Assembly Requirements 71 11 5 Build Options 72 11 5 1 Compiler 72 11 5 2 Linker 72 11 6 Required Modules 72 11 6 1 Interrupt Vectors 72 11 7 Link Requirements 73 11 7 1 Memory Description File 73 11 7 2 Stack Avoidance 73 11 8 Global Symbols 73 11 9 Preparing Code For Self Boot 73 11 10 Under the Hood 74 11 10 1 Startup Process 74 11 10 2 PC Connection 75 11 10 3 PC Reset 75 11 10 4 Resources Used By The Kernel 75 11 10 5 USB Communications 76 11 10 6 SR3 DSP Communication Kernel 79 12 DSP SUPPORT CODE 84 12 1 Flash Driver And Flash Programming Support Code 84 Signal Ranger mk3 User s Manual 5 Soft PI 12 1 1 Overview of the flash driver 84 12 1 2 Used Resources 85 12 1 3 Setup of the Driver 85 12 14 Data Structures 86 12 1 5 User Functions 87 12 2 CODEC Driver and Example Code 90 12 2 1 Overview 90 12 2 2 Used Resources 90 12 2 3 Restrictions 91 12 24 User Accessible Variables and Functions 91 12 2 5 LabVIEW Support VI 92 Signal Ranger mk3 User s Manual 6 Soft PI 1
13. DSP board and its interface to a PC application The examples directory contains examples of DSP code written in C as well as written in assembly All DSP code developed for the SignalRanger_mk3 board must comply with the following requirements 11 1 Code Composer Studio Setup All examples and codes for Signal Ranger Mk3 have been developed with version 4 0 1 01000 of Code Composer Studio 11 2 Project Requirements In Code Composer Studio the project should be created for a C64x little endian platform 11 3 C Code Requirements e When developing a function in C that will be launched by the K_Exec kernel process the function must include an acknowledge To do that add the following line in function HPI_HPIC Acknowledge The SR3_Reg h file must be included with the C file The acknowledge should be executed as soon as possible after the function entry The LabVIEW VI that launched the function exits as soon as the acknowledge is transmitted These two files are part of the SA3_SignalTracker example project Note Contrary to the SR1 and SR2 kernels the SR3 kernel does not support a function declared as an interrupt A function defined in C as an interrupt cannot be launched via the K_Exec process Note The Acknowledge is normally sent at the end of the function to signal its completion However when the function takes a long time to execute or when it does not return at all such as in the case of the main for instan
14. K_Read and K_Write TransferAddress represents a number of bytes e After the execution of the requested function the DSP asserts the HINT signal to signal the USB controller that the operation has completed This operation has been conveniently defined in a macro Acknowledge in the example codes and can be inserted at the end of any user function Note that from the PC s point of view the command seems to hang until the Acknowledge is issued by the DSP User code should not take too long before issuing the Acknowledge For more information see section on kernel operation Note On SignalRanger_mk2_Next_Generation if TransferAddress is used to transport information other than a real transfer address the following restrictions apply e The total size of the transfer must be smaller or equal to 32768 words This is because transfers are segmented into 32768 word transfers at a higher level The information in TransferAddress is only preserved during the first of these higher level segments At the next one TransferAddress is updated as if it were an address to point to the next block e The transfer must not cross a 64 kWord boundary Transfers that cross a 64 kWord boundary are split into two consecutive transfers The information in TransferAddress is only preserved during the first of these higher level segments At the next one TransferAddress is updated as if it were an address to point to the next block e TransferAddress must
15. SE bit of the FB_WriteEraseError status and returns The function returns the current FB_WriteEraseError status The function does not return until the erasure is completed The time is dependant on the length of the segment to be prepared It typically takes 0 5s per sector to erase Note The behaviour of the function is undefined if the requested FB_WSize is zero Input unsigned int FB_Waddress This is the starting byte address of the segment to prepare unsigned int FB_Wsize This is the size in byte of the segment to prepare Output no output Return The current FB_WriteEraseError 12 1 5 7 unsigned short SR3FB_Write short Data The function places the value of Data in the write FIFO It normally returns without waiting for the write to be completed The writes are performed under INT6 interrupts However if the FIFO is full when the function is called the function does wait for a slot to be available in the FIFO before placing the next value in the FIFO and returning It typically takes 60us per 16 bit word to program so if the function is called while the FIFO is full it may not return before 60us have elapsed Signal Ranger mk3 User s Manual 89 Soft PI The requested write begins as soon as the previous writes in the FIFO are completed The data is written at the current value of FB_WriteAddress The function does not check to make sure that the write is attempted inside the range of useable addr
16. This 32 bit integer selects the CLKS frequency for the McBSPO This value along with DSM_SSM adjust the sampling frequency You can use the LabVIEW VI SR3_ Junior _ DetermineRegister_ CS42436 vi to generate all CODEC configuration variables including Div_osc int DSM_SSM This 32 bit integer selects the DSM or SSM mode Zero selects the DSM mode and 1 selects the SSM mode unsigned char AlCReg 17 This 8 bit vector contains the CODEC registers 5 to 13 and 16 to 23 You can use the LabVIEW VI SR3 Junior DetermineRegister CS42436 vi to generate all CODEC configuration variables including this vector See the data sheet of the CS42436 from Cirrus Logic to get more details about register functions In addition the SR3_SignalTracker application is a good starting point to get familiar with the CODEC int lOBuf 12 This 32 bit integer vector is designed to contain the input and output samples to from the CODEC The first 6 elements of the vector are the input samples and next 6 elements are the outputs The user code reads and writes the samples in the OBuf vector at each call of the dataprocess function The user DSP code has one complete sampling period to execute the dataprocess function If the function is not completed within a sampling period input samples are overwritten by the new samples and the same output samples are sent to the CODEC The samples are left justified unsigned char i2c_data 2 Signal Ranger mk3 Use
17. Whenever the board is connected to a PC the PC may reset the board and load a simpler Host Download Kernel into memory at any time This Host Download Kernel does not check in Flash memory for FPGA logic or DSP code It only waits for and responds to K_Read K_Write and K_Exec commands from the host This gives the host PC a way to take control of the DSP without interference from on board code and reload FPGA logic and DSP code different than what is described in the Flash memory In particular this is required to reprogram the Flash memory with new FPGA logic and or DSP code After either of these kernels is on line the host PC may send K_Read K_Write and K_Exec commands Each command launches a DSP operation Data move or code branch and waits for the DSP to acknowledge completion of the operation The intrinsic kernel functions supporting the K_Read and K_Write commands do include this acknowledge User DSP code that is launched through the K_Exec command must absolutely include the acknowledge For user DSP functions invoked by the K_Exec command it is possible that by design or not the acknowledge take a long time to be returned The function on the PC that initiates the requests waits for the acknowledge to exit For this reason the acknowledge should be returned within a reasonable time 5s is suggested Normally the acknowledge is used to signal the completion of the function but for functions which take a long time to complete the ac
18. after and or before the invocation of any user function This provides another less efficient but more conventional way to transfer arguments to from DSP functions 12 DSP Support Code 12 1 Flash Driver And Flash Programming Support Code Two levels of Flash support code are provided to the developers e A DSP driver library for the developers who wish to include Flash programming functions into their DSP code This driver is described below e Flash programming DSP code is provided to support the Flash programming functionality that is part of the interface libraries LabVIEW and C C as well as the mini debugger interface This code is not described below It is provided as an executable file named SR3 Flash Supportout This DSP code is loaded and executed by the interface functions that require its presence This code is based on the Flash driver described below 12 1 1 Overview of the flash driver A DSP driver is provided to help the user develop DSP code that includes Flash programming functions This driver takes the form of a library named SAR3_FB_Driver lib The driver is found in the C Program Files SR3_Applications DSP_Code The driver is composed of C callable functions as well as appropriate data structures The functions allow read erasure and sequential write accesses to the Flash memory The driver uses a software write FIFO buffer so that the write functions do not have to wait for each write operation to be completed
19. current that may be drawn from this pin is 40 mA 6 2 1 1 4 Other Pins All other pins of J6 are DSP pins See DSP documentation for function 6 2 2 J 7 Pinout No Function No Function GP 22 BOOTMODE0 GP 23 BOOTMODE1 GP 24 BOOTMODE2 30 28 GP 26 FASTBOOT 26 GP 53 o i O 2 2 2 _8 RMRXDO EMCS4 GP 32 7 Gnd 6 AD4 GP 3 LS Gnd 4 Table 2 Connector J7 6 2 2 1 1 DSP Pins All pins of J7 are DSP pins See DSP documentation for function 30 28 26 24 18 116 14 12 4 18 16 14 12 10 Signal Ranger mk3 User s Manual 21 Soft PI 6 3 Analog Connectors J 4 andj 5 Figure 7 Analog Connectors J4 and J5 6 3 1 J4 Pinout No Function No Function 10 OUT 3 9 Gnd 8 OUT 4 7 Gnd 6 OUT 5 5 Gnd Table 3 Connector J4 6 3 2 J5 Pinout No Function No Function 10 N3 9 Gnd 8 IN4 7 MIC_IN6 8 INS f5 Gnd_ Table 4 Connector J5 Note ADCs 5 and 6 can be configured to support an electret microhone The microphone must be connected between pins 11 and ground ADC 5 and between pins 7 and ground ADC 6 To support this microphone input the ADC must be configured with the corresponding AINx_MUX bit of register 5 ADC_Control set to 1 6 4 System Frequencies The DSP crystal has a frequency of 24 576 MHz Immediately after reset the various system frequencies are as follows e CPU C
20. end of any user function Signal Ranger mk3 User s Manual 63 Soft PI Note that from the PC s point of view the command seems to hang until the Acknowledge is issued by the DSP User code should not take too long before issuing the Acknowledge 10 4 6 2 2 SR3 Platform e fa transfer is involved the function must read the ControlCode mailbox address 0x10F0400A mask the two lower bits that represent the type of operation The result called USBTransferSize represents the maximum number of bytes that must be transferred in this segment Note that the contents of the ControlCode field of the mailbox must not be modified e f necessary the function transfers the required bytes to or from the Data area of the mailbox The number of bytes to transfer is the smaller of the NbBytes field of the mailbox and the USBTransferSize result just computed e Finally the number of bytes transferred must be subtracted from the NbBytes value and the NbBytes field must be updated with the new value in the mailbox e The TransferAdaress field may need to be incremented depending on how the function uses this information Typically K_Read and K_Write kernel functions increment TransferAddress so that the next segment is transferred to from the subsequent memory address However some user functions may use this field in a different way For instance it may be used as an arbitrary FIFO buffer number in some implementations For
21. for CS2 contents of the A1CR register With these settings the Flash access cycles are as follows e Read time 132ns 13 cycles e Write time 122ns 12 cycles Signal Ranger mk3 User s Manual 23 Soft PI e Turn aroundtime 20 3ns 2 cycles between read and write or between write and read 6 5 2 DDR2 RAM 6 5 2 1 Memory Map The 128 MByte DDR2 RAM is mapped at addresses 80000000 to 87FFFFFF4 6 5 2 2 Clock Speed The DDR2 RAM is clocked at 165 85 MHz 331 7 MHz double rate frequency 6 5 2 3 Bus Interface The DDR2 RAM to DSP interface is 32 bit wide 6 5 2 4 Access Speed 6 5 2 4 1 Read and Write Using DMA e 8 16 or 32 bit read 9 3 ns e 8 16 or 32 bit write 6 4 ns 6 5 2 4 2 Read and Write To From CPU e 8 16 or 32 bit read 125 ns e 8 16 or 32 bit write 30 5 ns 6 5 2 4 3 Code Execution from DDR2 RAM e The timing depends on many factors Because of the IDMA and the software pipeline execution from DDR2 can sometimes be as fast as from L1P In usual situations it takes several times the execution from L1P 6 5 3 Codec The Codec provides 6 high performance analog inputs and 6 high performance analog outputs Each input has a dynamic range of 3V It includes a gain that is adjustable from 64 dB to 24 dB in 0 5 dB steps Note In practice gains above 6dB do not present any advantages They do not improve the noise figure and limit the dynamic range Gains below 6 dB do not impro
22. int32_t BoardRef double FlashSize 10 4 14 2 Description This function downloads and runs the Flash support DSP code The DSP is reset as part of the download process All DSP code is aborted The Flash support code must be running to support Flash programming functions The function also detects the Flash and if it finds one it returns its size in kWords If no Flash is detected the size indicator is set to 0 10 4 14 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3 Base Open Next Avail Board 10 4 14 4 Outputs e FlashSize This argument returns the size of the Flash detected If no Flash is detected it returns zero 10 4 15 SR3_DLL Flash EraseFlash 10 4 15 1 Prototype int32 t SR3_ DLL Flash _EraseFlash int32_t BoardRef uint32_t StartingAddress uint32_t Size 10 4 15 2 Description This function erases the required number of 16 bit words from the Flash starting at the selected address The erasure proceeds in sectors therefore more words may be erased that are actually selected For instance if the starting address is not the first word of a sector words in the same sector before the starting address will be erased Similarly if the last word selected for erasure is not the last word of a sector additional words will be erased up to the end of the last selected sector The erasure is such that the selected words includ
23. interface has been designed in a mirror image of the LabVIEW interface The documentation of the LabVIEW interface to a large extent also applies to the C C interface This interface has been designed with C C development in mind and has only been tested on version 2005 of Microsoft s Visual Studio However it may be possible to use it with other development environments allowing the use of DLLs To work at run time this DLL requires that the following file be in the same directory as the user application that uses it e SRm3_HL dlil The main interface DLL Furthermore the LabView 2009 run time engine must be installed on the computer that needs to use the DLL If the user wants to deploy an application using the C C interface which is Signal Ranger mk3 User s Manual 57 Soft PI required to run on computers other than those on which it was developed the LabView 2009 run time engine should be installed separately on those computers A run time engine installer is available for free from the National Instruments web site www ni com Two examples are provided which cover the development of code in Visual Studio e The first example is found in C ProgramFiles SR3_Applications Visual_Studio_Code_Example SRm3_HL_DLL_VS_Example Zip It covers the use of the USB interface on the SA3 platform e The second example is found in C ProgramFiles SR3_Applications Visual_Studio_Code_Example GRm3PRO_HL_DLL_VS_Exa mpl
24. is the value contained in the counter between 0 and 15 Signal Ranger mk3 User s Manual 50 Soft PI e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 12 SR3_Base_Clear_Error_Count This VI is provided to clear the 4 bit USB error counter BoardRef Error dupBoardRef error in no error BES error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board vi e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 13 SR3_Base_Error Message This VI may be used to provide a text description of an error generated by a VI of the interface It is similar to a traditional LabVIEW Error Message VI except that it contains all the error codes that may be generated by the interface in addition to normal LabVIEW error codes PEPEE itis Status BoardRef dupBoardRef Type of Dialog 1 OK Msg lt 7 Error Code 0 error in n
25. the FPGA If no new FPGA file is specified the FPGA is wiped out after the Vl s execution BoardRef ody dupBoardRef FPGA File aa EntryPoint DSP File error out error in no error Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi e FPGA File This is the file name of the FPGA file If FPGA_File is connected and not empty the VI resolves the path using the standard rules for firmware and container VI locations If FPGA_Files is empty the VI does not load any FPGA logic The FPGA is reset by the VI so any previous logic is wiped out From the FPGA e DSP File This is the file name of the DSP file If DSP_File is connected and not empty the VI resolves the path using the standard rules for firmware and container VI locations If DSP_File is empty the VI does not load any DSP code The DSP is reset by the VI e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 10 SR3_Base_K_Exec This V
26. this number to access the proper board e Firmware_Names Cluster containing the names of the DSP and FPGA firmware files that are found in Flash The fields are empty if the Flash does not contain any firmware The fields are also empty if the ForceReset control is true e Latest Revision This indicator is true if the pair of firmware file names found in Flash corresponds to the last element provided in the Restrict array In some implementations the Restrict array contains the name pairs of different firmware revisions of a given product in ascending order When this is the case the Latest_ Revision indicator is true when the firmware detected in the Flash of the board is indeed the latest firmware known to the controlling application e Error out LabVIEW instrument style error cluster Contains error number and description Note The handle that the interface provides to access the board is exclusive This means that only one application at a time can open and manage a board A consequence of this is that a board cannot be opened twice A board that has already been opened using the SR3_Base_Open_Next_Avail_Board VI cannot be opened again until it is properly closed using the SR3_Base_Close_BoardNb VI This is especially a concern when the application managing the board is closed under abnormal conditions If the application is closed without properly closing the board the next execution of the application may fail to find and open t
27. to branch to the intrinsic or user function 11 10 6 3 1 2 Step 2 e ifthe DSP is not interruptible because the DSPint interrupt is temporarily masked or because the DSP is already serving another interrupt the DSPint interrupt is latched until the DSP becomes interruptible again at which time it will serve the PC access request e f or when the DSP is interruptible it branches to the BranchAddress At this point the DSP code performs the required function e If atransfer is involved the function must read the ControlCode mailbox address 0x10F0400A mask the two lower bits that represent the type of operation The result called USBTransferSize represents the maximum number of bytes that must be transferred in this segment Note that the contents of the ControlCode field of the mailbox must not be modified e f necessary the function transfers the required bytes to or from the Data area of the mailbox The number of bytes to transfer is the smaller of the NbBytes field of the mailbox and the USBTransferSize result just computed e Finally the number of bytes transferred must be subtracted from the NbBytes value and the NbBytes field must be updated with the new value in the mailbox e ForaK_Reador a K_Write the TransferAddress field is incremented so that the next segment is transferred to from the memory addresses subsequent to the present segment TransferAddress represents a number of bytes e After the execution of the request
28. 2_NG the VIs in this library requires a special DSP support firmware to be loaded into RAM and require the DSP to be reset On SRG this is not the case On SR2_NG the DSP reset and the load of special FPGA support firmware is normally incompatible with the execution of any other user DSP code These VIs cannot be used to reconfigure the FPGA as part of an application specific DSP code without interfering with an already running DSP code To reload both DSP code and FPGA logic use the SA3_Base_LoadExec_User or SR3_Base_Load_User VIs 9 6 3 1 SR3 FPGA LoadConfiguration All_Platforms This Vi downloads a rbt logic configuration file into the FPGA On SR2_NG the DSP is reset prior to the download All DSP code is aborted The rbt file must be valid and must be correct for the specified FPGA Loading an invalid rbt file into an FPGA may damage the part The FPGA file can be contained in a firmware container VI as well as an actual rbt file Signal Ranger mk3 User s Manual 56 Soft PI Tools Version Design name Architecture BoardRef dupBoardRef File path dialog if empty New file path NotAPath if Progress Build date error in no error Device error out feecoossscccoosssecooosssseooe FPGA_Present Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure t is created by SR3 Base Open Next Avail Board vi e File path This is the file path leadi
29. Address is used e Offset Represents the offset of the data to be accessed from the base address indicated by Symbol or DSPAddress The actual access address is calculated as the sum of the base address and the offset Offsetis useful to access individual members of a structure or an array e R W Boolean indicating the direction of transfer true gt read false gt write Signal Ranger mk3 User s Manual 47 Soft PI e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running VI Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3 Base Open Next Avail_ Board vi Use this output to propagate the reference number to other Vis e DataOut Data read from DSP memory e Real DSPAddress Actual address where the transfer took place This address takes into account the resolution of Symbol if used and the effect of Offset e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 8 SR3_Base_LoadExec_User This VI loads a new user FPGA logic and or DSP code and runs the DSP code from the address of the entry point found in its COFF file Only the names of the files need to be given The files themselves need to be stored according to the rules described in section 8 5 4 If either FPGA_File or DSP_File is empty the VI
30. Applications Directory containing all the executables e DSP Code Directory containing directories of the various DSP projects e SRm3_ HL DLL Directory containing the SRm3_HL DLL used for C C development e Visual Studio Code Example Directory containing an example of an application for SignalRanger_mk3 developed in Visual Studio This application uses the SAm3_HL DLL In addition all the applications and the documentation can be accessed using the Start menu under the SignalRanger_mk3 index 5 2 Hardware Installation Note Only power the board using the provided power supply or using a 5V 1A 5 power supply When using a custom power supply make sure the positive side of the supply is in the center of the plug Failure to use the proper power supply may damage the board e Power up the board from the 5V adapter e The Led should light up red for 1 2s to indicate that the board is properly powered then orange to indicate that the DSP section is functional e Connect the Signa Ranger_mk3 board into the USB port of the PC e If the driver is properly installed the LED turns green to indicate that the PC has taken control of the board e At any time after the board has been connected to the PC and the PC has taken control of it the LED should be green The LED must be green before attempting to run any PC application that communicates with the board 5 3 What to Do In Case the Driver Installation Fails To perf
31. CPU registers Read and write DSP memory with or without symbolic access Clear program and verify the Flash memory Interactively download an FPGA logic file into the FPGA The mini debugger can be used to explore the DSP s features or to test DSP code during development The mini debugger is simply a user interface application that leverages the capabilities of the PC interface libraries to allow the developer to observe and modify DSP code and variables in real time while the DSP code is running Since these are the very same libraries that are provided to develop PC applications that use the board the transition between debugging and field deployment is completely seamless At startup the mini debugger asks the user if the DSP should be reset Resetting the DSP can solve connection problems such as a DSP crash but it will abort code that may already be executing Signal Ranger mk3 User s Manual 26 Soft PI Signal_Ranger_mk3 Ivlib SR E Figure 8 User Interface of the Mini Debugger 8 1 Description of the User Interface e VID PID The developer should type the specific Vendor ID and Product ID of the target board The mini debugger actually supports several related DSP boards This field is used to indicate the type of board that the mini debugger should take control of The figure shows the VID and PID of the SignalRanger_mk3 board e Rev This field indicates the firmware revision number of the bo
32. DSM_SSM driver variables 12 2 5 1 4 DAC Volume This cluster contains the volume of each output The volume can be adjusted from 127 5 dB to 0 dB in 0 5 dB steps 12 2 5 1 5 ADC Volume This cluster contains the volume of each input The volume can be adjusted from 64 0 dB to 24 0 dB in 0 5 dB steps Signal Ranger mk3 User s Manual 93 Soft PI 12 2 5 1 6 DAC Mute This control allows mutes each output individually 12 2 5 1 7 DAC Polarity This control selects the output polarity 12 2 5 1 8 ADC Polarity This control selects the input polarity 12 2 5 1 9 ADC_x y HP Filter This control engages the ADC high pass filters or freezes them to the last value Briefly engaging the filter and freezing it effectively cancels out the DC offset present on the ADC input This is done at the level of the ADC while the offset compensation is done at the software level 12 2 5 1 10 AIN5_MUX and AIN6_MUX These controls select the input path for the analog input 5 and 6 either Line In or Electret Microphone Input CFG For AlCDriver _Div_osc p fo _AICReg 4 Jo 2 Figure 16 CODEC configuration registers This indicator contains the drivers configuration variables Before starting the CODEC with the driver function startAIC the PC or the DSP code must load the driver variables _Div_osc DSM_SSM and _AICReg Signal Ranger mk3 User s Manual 94 Soft Ble AIC CFG out Figur
33. Foreword Beginning with the original Signal_Ranger series of DSP boards we adopted a policy of providing the user with all the information necessary to operate our DSP boards but also to understand their operation to the finest possible detail For instance we provide all the board schematics we explain the operation of the DSP kernels in detail etc In contrast with competing products this approach results in a larger more detailed documentation that may give the impression of an overly complex system Our systems tools and architectures are in fact easier to use than many competing products Through the years we have learned that many of our customers some of them OEMs appreciate this level of detail and transparency in our documentation Therefore we have decided to continue with this policy and we hope that you will take the time to go through the documentation to understand what our tools and architectures can bring to your developments 2 Main Features SignalRanger_mk3 is a fixed point DSP board featuring a TMS320C6424 DSP running at 590 MHz a 6 input 6 output 96 kHz 24 bit analog interface designed for pro audio and high performance control applications and a high speed USB 2 interface providing fast communications to the board The USB Windows driver allows the connection of any number of boards to a PC The DSP board may be used while connected to a PC providing a means of exchanging data and control between the PC and DSP in r
34. I forces execution of the DSP code to branch to a specified address passed in argument If Symbol is wired and not empty the Vi searches in the symbol table for the address corresponding to the symbolic label If the symbol is not found an error is generated If Symbol is not wired or is an empty string the value passed in DSPAddress is used as the entry point Signal Ranger mk3 User s Manual 49 Soft PI After completing the branch to the entry point the USB controller and the VI wait for an acknowledge from the DSP to resume their execution If this signal does not occur within the specified timeout the VI will hang indefinitely Normally the DSP code that is launched by this VI should acknowledge the branch by asserting the HINT signal see section about the DSP Communication Kernel Symbol BoardRef DSPAddress 0 error in no error Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi e DSPAddress Physical branch address It is used if for the branch if Symbol is empty or left unwired e Symbol Character string of the symbol to be accessed If Symbol is empty DSPAddress is used instead e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing t
35. R2 kernels a function to be launched by the K_Exec process should not be built as an interrupt function 11 5 Build Options Note Use the examples provided as a guide 11 5 1 Compiler e Basic e Use the target Version C64x e Runtime Model Options e Do not set the Generate big endian code option 11 5 2 Linker e Basic Options e Set the stack size to 0x1000 at least e Runtime Environment e Use the Link using RAM autoinitialization model It is more space efficient 11 6 Required Modules 11 6 1 Interrupt Vectors e The interrupt vector section is always located at the address 0x10E08000 the beginning of the L1P RAM e The INT4 vector at the address 0x10E08080 is reserved for the HPlint interrupt and the kernel e All vectors must be 32 bytes long The code snippet below shows a typical way to define a vector global _SR3AIC sect vectors nocmp _ISRINTS STW D2T2_ B10 B15 2 IMVKL S2 _SR3AIC B10 MVKH S2 _SR3AIC B10 B S2 B10 LDW D2T2 B15 2 B10 NOP 4 NOP NOP Signal Ranger mk3 User s Manual 72 Soft PI end The nocmp directive is used to avoid the compact instruction of the 64x This vector section must be linked at the address 0x10E080A0 and the size is exactly 32 bytes For the ISR a C function must be declared with the interrupt qualifier and with the name SR3AIC e Ifthe INTC_INTMUX7 register must be modified the event numbers for INT4 must be p
36. SP is uninterruptible and cannot do any operation in the middle of a block of the PC transfer Therefore the DSP cannot interfere in the middle of any single 32 or 256 block access by the PC This alone does not guarantee the integrity of the transferred values because the PC can still transfer a complete block of data in the middle of another concurrent DSP operation on this same data To avoid this situation it is sufficient to also make atomic any DSP operation on 32 bit data that could be modified by the PC This can easily be done by disabling DSPint interrupts for the length of the operation Then the PC accesses are atomic on both sides and data can safely be transferred 32 bits at a time On this platform transfers are always atomic on the PC side The Atomic control is present for compatibility but has no effect On the SignalRanger_mk3 platform the user has the choice of using atomic transfers or non atomic transfers Using an atomic transfer presents the advantage that from the DSP s perspective all the parts of the block are transferred simultaneously This behaviour is compatible with the behaviour of the SignalRanger_mk2_Next_Generation platform Non atomic transfers present the advantage that critical DSP tasks can interrupt the transfer and therefore take precedence over the USB transfer The only way to use a non atomic transfer on SignalRanger_mk2_Next_Generation is to use a custom user function and the SR3_Base_User_Move_Offse
37. Signal Ranger mk3 User s Manual Signal Ranger mk3 ex by Soft RE In association with e ET Convergence Instruments September 5 2011 1040 avenue Belv d re suite 215 Qu bec Qu bec G1S 3G3 Canada T l 418 686 0993 Fax 418 686 2043 Soft PI 1 FOREWORD 7 2 MAIN FEATURES 7 2 1 Boot Modes and Modes of Operation 7 3 TECHNICAL DATA 8 3 1 Power Supply 8 3 2 USB 8 3 3 DSP 8 3 4 Memory 8 3 5 Analog Inputs 8 3 6 Analog Outputs 9 4 SOFTWARE 9 41 SignalRanger DDCI Interface 9 4 2 Other Software Tools 11 5 INSTALLATION AND TESTS 11 5 1 Software Installation 11 5 1 1 LabVIEW Developer s Package SR3_DDCI_Library_Distribution zip 11 5 1 2 C C Developer s Package SR3_Applications_Installer zip 12 5 2 Hardware Installation 12 5 3 What to Do In Case the Driver Installation Fails 12 54 LED Indicator 13 5 5 Testing the Board 13 5 6 Evaluating the Analog Performance 14 5 6 1 Time Signal Tab 15 5 6 2 Sxx Tab 16 5 6 3 AIC Set Up Tab 18 6 HARDWARE DESCRIPTION 19 6 1 Connector Map 19 Signal Ranger mk3 User s Manual 3 Soft PI 6 2 Expansion Connectors J6 and J7 20 6 2 1 J6 Pinout 20 6 2 2 J7 Pinout 21 6 3 Analog Connectors J4 and J5 22 6 3 1 J4 Pinout 22 6 3 2 J5 Pinout 22 6 4 System Frequenc
38. Signal Ranger mk3 User s Manual 16 Soft PI 2 Signal_Ranger_mk3 lvlib SR3_SignalTracker vi Time Signal Sox AIC Set up 2000 0 4000 0 6000 0 8000 0 10000 0 12000 0 14000 0 16000 0 18000 0 20000 0 22000 0 24000 0 Frequency B Frequency lui Average Average fame Window Input amp famoitude d alfy en a cK O E AWeigth Vrms of the Spectrum cursor off 53 200 Plot 0 963 9 129 1 gt OFF 53 29u S BE Cursor 1 Plot 0 9999 0 124 7 Figure 3 SR2_SignalTracker application Sxx tab The vertical scale is in dB A value of 0 dB represents an amplitude of 1Vrms 5 6 2 2 Average Control To average the power spectrum simply place the Average control in the ON position Otherwise the display shows instantaneous spectra 5 6 2 3 Reset Average Button The Reset Average button resets the average 5 6 2 4 Time Window selector An optional analysis window can be chosen from the Time Window list 5 6 2 5 A Weight Control The noise spectrum can be displayed with optional A weighting Use the control to enable or disable A weighting 5 6 2 6 Vrms Indicator This indicator presents the RMS value of the input signal The calculation is performed in the frequency domain Two factors can explain a difference between this value and the value displayed in the time domain e The DC component is not subtracted from the signal prior to the calculation e The effect of the A weighting filter is
39. Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis Signal Ranger mk3 User s Manual 55 Soft PI e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 2 6 SR3_Flash_Check_Dialog This VI checks the Flash against a DSP file and or an FPGA file The VI is interactive It prompts the user for the input files and the action Check or Cancel The VI presents error and or completion dialogs New in SignalRanger_mk3 The DSP and FPGA files can be contained in firmware container VIs as well as actual out or rbt files BoardRef EL dupBoardRef error in no error error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running VI Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 3 FPGA Support VIs These Vis are provided to support FPGA configuration operations On SR
40. T label This interrupt vector resides at address 0x10E080C0 See below for a code example global _SR3FBINT sect vectors nocmp _ISRINT6 STW D2T2_ B10 B15 2 IMVKL S2 _SR3FBINT B10 MVKH S2 _SR3FBINT B10 B S2 B10 LDW D2T2 B15 2 B10 NOP 4 NOP NOP end 12 1 3 Setup of the Driver Signal Ranger mk3 User s Manual 85 Soft PI Note This driver requires the C environment to work properly This means that driver functions should only be called from code written in C or from assembly code that has setup the C environment prior to calling any of the functions see Texas Instruments documentation for more details e All the functions of the driver that are defined below are contained in the SR3_FB_Driver lib library The user code must be linked with this library to function properly the library must be added to the project source files e When linking the library with a C project the project must use the Far memory model This is required to be able to access all sectors of the flash which span multiple pages of 32k the direct addressing mode using B14 or B15 accept offsets of 32k bytes only e Since the writes are performed under INT6 GPIO_0 interrupt the INT6 interrupt vector must be initialized to the _SR3FBINT label and must be linked at address 0x10E080CO This label is the entry point of the INT6 interrupt routine The INT6 interrupt routine is defined in the SR3_FB_Driv
41. The handle provided by the SA3_Base_Open_Next_Avail_Board vi is exclusive Once a target is opened no other application can take control of it until it is closed by the current application A particular target can only have one connection with a host application A host application on the other hand can have connections with and manage multiple target boards The SAR3_Base_Open_Next_Avail_Board vi uses a VID PID pair to open the target This V D PID pair points to a database within the LabVIEW interface that contains the hardware characteristics of the board such as its board model DSP type Flash addresses etc When the target is opened this information is stored in a global variable array There is one array element representing one target for every target opened by the host After opening the board the SR3_Base_Open_Next_Avail_Board vi reads the DSP code and FPGA file names in Flash if any as well as their checksums If a DSP firmware was present in Flash the SR3_Base_Open_Next_Avail_Board vi then loads the symbol table that follows the code in Flash This symbol table is used to provide symbolic access to the DSP code This information is then also stored in the global variable array so that every VI in the interface can use it Optionally the SR3 Base Open Next Avail Board vi can selectively open only the targets that have a DSP FPGA file name pair that is part of a provided list This provides the basis to selectively o
42. This means for instance that the low part of a word may be transferred at one CPU cycle while the high part is transferred at a different cycle Non atomic transfers present the advantage that critical DSP tasks can interrupt the transfer itself and therefore take precedence over the USB transfer Non atomic Signal Ranger mk3 User s Manual 83 Soft PI transfers are useful in situations when extremely fast timings must be insured on the DSP and even the very short transfer time is enough to disrupt those critical tasks 11 10 6 3 2 Use of The K_Read And K_Write Requests for User Functions In principle the K_Read and K_Write commands are used only to invoke the intrinsic kernel functions However nothing bars the developer from using these commands to invoke a user function This may be useful to implement user functions that need to receive or send data from to the PC because it gives them a way to efficiently use the mailbox and the on board USB controller transfer process To achieve this the user function should behave in exactly the same manner as the intrinsic functions do for Read resp Write transfers The BranchAddress field of the mailbox should contain the entry point of a user function rather than the address of an intrinsic kernel function It should be noted that arguments data and parameters can alternately be passed to from the PC into static DSP structures by regular kernel K_Read or K_Write commands
43. _Firmware_Name_Size char FPGA_Logic_NamelJ int32_t FPGA Logic Name Size 10 4 1 2 Description This function performs the following operations e Tries to find a free DSP board with the selected VID PID and optionally that has the firmware indicated in the Restrict control e __ If it finds one creates an entry in the Global Board Information Structure e Waits for the Power Up kernel to be loaded on the board e Ifa DSP firmware is detected in Flash code has been loaded and started as part of the power up sequence loads the corresponding file name and symbol table from Flash e f ForceReset is true forces DSP reset then reloads the Host Download kernel In this case all code present in Flash and executed at power up is aborted and the corresponding symbol table found in Flash is not loaded e Places the symbol table of the present kernel in the Global Board Information Structure 10 4 1 3 Inputs e idVendor_Restrict Must be set to the Vendor ID for the specified board For instance the VID for Soft dB is 0x1612 e idProduct_Restrict Must be set to the Product ID for the specified board For instance the PID for SignalRanger_mk3 is 0x102 e ForceReset If set to 1 the DSP is reset and the host download kernel is loaded All previously running DSP code is aborted Use this setting to dynamically reload new DSP code on the board Reset to zero to take control of DSP code that is already running from Flash without interrupting it
44. _NG and SR3 The SR2_NG platform is identical to the SR2 platform in hardware and DSP firmware See the SR2 documentation for details about the operation of its kernel There are several differences between the kernels used in the SR3 and the SR2_NG platforms Signal Ranger mk3 User s Manual 79 Soft PI 11 10 6 1 1 Location of the Mailbox In SR3 the MailBox is located at address 10F04000 11 10 6 1 2 Contents of the Mailbox In SR3 the NbBytes parameter replaces the NbWords parameter It now represents the number of bytes to be transferred In SR3 the ControlCode replaces the ErrorCode parameter and has increased significance It now indicates the total block size of the transfer in addition to the type of operation K_Read K_Write or K_Exec See below for precise encoding 11 10 6 2 Overview of the SR3 kernel The kernel that is used to support PC communications is extremely versatile yet uses minimal DSP resources in terms of memory and processing time Accesses from the PC wait for the completion of time critical processes running on the DSP therefore minimizing interference between PC accesses and real time DSP processes Three commands K_Read K_Write and K_Exec are used to trigger all kernel operations The exchange of data and commands between the PC and the DSP is done through a 524 byte mailbox area in the on chip DSP RAM The DSP interface works on 3 separate levels e Level1 Atlevel 1 the
45. a function which may not return to the kernel or to previously executing user code or in any case when the user does not want the host command which initiated the access to hang until the end of the DSP function the acknowledge can be placed at the beginning of the user function In this case it signals only that the branch has been taken Another means of signaling the completion of the DSP function must then be used For instance the PC can poll a completion flag in DSP memory During the execution of the command the DSP is only un interruptible during a very short period of time between the taking of the DSPInt interrupt and the branch to the beginning of the user or intrinsic function Therefore the execution of the command code on the DSP does not block critical tasks that might be executing under interrupts managing analog I Os for instance The kernel includes functions to perform atomic transfers and non atomic transfers For atomic transfers the DSP is also uninterruptible during the actual transfer of each 64 byte block or 512 byte block for a HighSpeed USB connection The actual transfer time depends on the target peripheral with on chip RAM being the fastest Making the transfer uninterruptible presents the advantage that from the DSP s perspective all the parts of the block are transferred simultaneously For a non atomic transfers different parts of the block may be transferred at different times from the DSP s perspective
46. ab 5 6 3 1 AIC Setup Array Control This tab provides individual control over all the CODEC parameters 5 6 3 1 1 Sampling Rate The sampling rate can be selected with this control The sampling rate can be chosen in a set of values between 4 kHz and 96 kHz Note that the control only exposes the most frequent sampling frequencies others are possible The Preferred Mode is used whenever the chosen sampling frequency allows the choice Some choices of sampling frequency are only compatible with the DSM mode Signal Ranger mk3 User s Manual 18 Soft PI 5 6 3 1 2 Preferred Mode This control indicates if the sampling mode should be DSM Double Rate Sampling or SSM Single Rate Sampling Some sampling frequencies only allow the DSM mode In this case the preferred mode is ignored At low level this control acts on the Div_osc and DSM_SSM driver variables 5 6 3 1 3 DAC Volume This cluster contains the volume of each output The volume can be adjusted from 127 5 dB to 0 dB in 0 5 dB steps 5 6 3 1 4 ADC Volume This cluster contains the volume of each input The volume can be adjusted from 64 0 dB to 24 0 dB in 0 5 dB steps 5 6 3 1 5 DAC Mute This control allows mutes each output individually 5 6 3 1 6 DAC Polarity This control selects the output polarity positive or negative 5 6 3 1 7 ADC Polarity This control selects the input polarity positive or negative 5 6 3 1 8 ADC_x y HP Filter This control en
47. abVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e DataOut Data read from DSP memory Signal Ranger mk3 User s Manual 46 Soft PI e Real DSPAddress Actual address where the transfer took place This address takes into account the resolution of Symbol if used and the effect of Offset e ErrorCode This is the error code returned by the kernel function that is executed The value of this indicator is irrelevant in this interface e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 7 SR3 Base HPI Move Offset This VI is similar to SR3 Base Bulk Move Offset except that is relies on the hardware of the HPI rather than the kernel to perform the transfer Transfers are limited to the RAM locations that are directly accessible via the HPI The MemSpace control is not used This VI will perform transfers into and out of the data and program space This VI will transfer to any address accessible via the HPI regardless of memory space Note The kernel does not need to be loaded or functional for this VI to execute properly This VI will complete the tran
48. ables and labels The code is not executed After the FPGA file has been successfully loaded into the FPGA the logic is functional e LoadSym Loads the symbol table corresponding to a specified DSP code into the PC memory to allow symbolic access to variables and labels Nothing is loaded into DSP memory This is useful to gain symbolic access to a DSP code that may already be running such as code loaded from Flash by the bootload process The application presents a file browser to allow the user to select the file The file must be a legitimate COFF file for the target DSP e Exec Forces execution to branch to the specified label or address The DSP code that is activated this way should contain an Acknowledge in the form of a Host Interrupt Request HINT Otherwise the USB controller will time out and an error will be detected by the PC after 5s The simplest way to do this is to include the acknowledge macro at the beginning of the selected code This macro is described in the two demo applications e Symbol or Addressis used to specify the entry point of the DSP code to execute Symbol can be used if a COFF file containing the symbol has been loaded previously Otherwise Address allows the specification of an absolute branch address Address is used only if Symbol is set to the Force Address No Symbol position When a new COFF file is loaded the mini debugger tries to find the _c_int00 symbol in the symbol table If it is found and its
49. ace as well as launch the execution of user DSP code This mechanism uses the functions of the resident DSP kernel Operations performed using control pipe zero are slow and limited in scope but very reliable They allow the PC to take control of the DSP at a very low level In particular the memory transfers do not rely on the execution of a kernel code on the DSP All these operations can be performed even after the DSP code has crashed Operations performed using high speed bulk pipes 2 and 6 are supported by the resident DSP kernel They provide access to any location in any memory space on the DSP Transfers are much faster than that using control pipe 0 However they rely on the execution of the kernel This kernel must be loaded and running before any of these operations may be attempted These operations may not work properly when the DSP code has crashed Signal Ranger mk3 User s Manual 76 Soft PI Operations performed on the DSP through the kernel must follow a protocol described in the following sections 11 10 5 1 Communications Via Control Pipe 0 The following Vendor Requests support the operations that the PC can perform on the DSP board via control pipe 0 All these operations are encapsulated into library functions in the PC software interfaces Request Direction Code Action DSPReset Out 104 Assert or release the DSP reset NOTE Asserting the reset of the DSP also resets the KPresent and K_State
50. ad new target code into container Vis No dynamic VI needs to be included in the application builder The installer builder will simply reload to the firmware files which reflects the latest changes A common approach is to use the original out and rbt files during development because it facilitates the tests of new firmware and FPGA logic and encapsulate the files into firmware containers when the application is deployed The firmware load process follows the logic below The interface function that needs the firmware will first attempt to find a out and or rbt file with the specified name The interface function looks for the file in the directory one level above the top level VI of the application If it does not succeed the interface then tries to find a firmware container VI with the same name after removing the vi extension in the same directory as the top level VI of the application If it does not it returns with an error In practice these rules provide natural locations in the two conditions below When using firmware container VIs the firmware files are located in the same directory as the top level VI during development For a built executable the firmware container VIs are naturally located at the same level as the top level VI within the actual executable file When using standard out and rbt files the firmware files should be located one level above the top level VI during development For a built exec
51. address for the exchange DSPAddress is only used if Symbol is empty e Data Array of bytes to be read from or written to Flash e Size Represents the number of bytes to transfer For a read or a write the Data array allocated must be larger or equal to Size 10 4 16 4 Outputs e Data Array of bytes read from or written to Flash The Data array passed in argument to the function must be larger or equal to Size 11 DSP Code Development When developing DSP code two situations may arise Signal Ranger mk3 User s Manual 70 Soft PI e The DSP code is a complete application that is not intended to return to the previously executing DSP code This is usually the case when developing a complete DSP application in C In this case the main of the DSP application is launched by a function called c_int00 that is created by the compiler When if the main returns it goes back to a never ending loop within c_int0o It never returns to the code that was executing previously e The DSP code is a simple function intended to run once then return to the previously executing DSP code kernel or user code This process may be used to force the DSP to execute short functions asynchronously from other code running on the DSP in the background The other code running in the background may either be the kernel or user code that has been launched previously Several examples are provided to gain experience into the programming of the
52. ally incompatible with any other user DSP code This library cannot be used to read write the Flash as part of an application specific DSP code In such a case a custom solution must be designed 9 6 2 1 SR3 Flash InitFlash This VI downloads and runs the Flash support DSP code The DSP is reset as part of the download process All DSP code is aborted the FPGA is wiped out The Flash support code must be running in addition to the kernel to support Flash programming VIs The VI also detects the Flash and if it finds one it returns its size in kWords If no Flash is detected the size indicator is set to 0 The Flash support DSP code can be either a COFF out file or a firmware container VI The file must be located according to firmware file location rules described in previous sections BoardRef dupBoardRef FlashSize kW error in no error error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi e Error in LabVIEW instrument style error cluster Contains error number and description of the previously running VI Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e FlashSize This indicator re
53. and manage a board A consequence of this is that a board cannot be opened twice A board that has already been opened using the SR3 Base Open Next Avail_ Board function cannot be opened again until it is properly closed using the SR3 Base Close BoardNb function This is especially a concern when the application managing the board is closed under abnormal conditions If the application is closed without properly closing the board The next execution of the application may fail to find and open the board simply because the corresponding driver instance is still open In such a case simply disconnect and reconnect the board to force the PC to re enumerate the board 10 4 2 SR3_DLL_Close_BoardNb 10 4 2 1 Prototype int32_t SR3_DLL_Close_BoardNb int32_t BoardRef 10 4 2 2 Description This function closes the instance of the driver used to access the board and deletes the corresponding entry in the Global Board Information Structure Use it after the last access to the board has been made to release resources that are not used anymore 10 4 2 3 Inputs e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board 10 4 2 4 Outputs None 10 4 3 SR3_DLL_Complete_DSP_Reset 10 4 3 1 Prototype int32_t SR3_DLL_Complete_DSP_Reset int32_t BoardRef 10 4 3 2 Description This function performs the following operations e Temporarily f
54. anner after taking control of it It is also useful in situations where special functions not normally available need to be implemented on an ad hoc basis For instance this can be diagnostic functions that need special DSP code and or FPGA logic Whenever DSP code is loaded dynamically the corresponding symbol table is loaded directly from the same COFF file where the code is stored To be able to load DSP code and or FPGA logic dynamically from the PC the corresponding files must conform to the following storage and location rules 9 5 4 Firmware Storage and Locations Rules Access to the firmware files is required to support dynamic loading There are two methods for storing the firmware files Within a firmware container VI The advantages of this method are e Once the host application is built into a exe file the target firmware file is not disclosed to the user It is hidden within the binary of the application code e The host application executable is self contained It does not require any additional files stored on the host system to be functional As an original out file for the DSP code and rbt file for the FPGA The advantages of this method are e No firmware container VI needs to be built To be effective the file can simply be placed in the directory hierarchy of the application providing a better modularization of the code e When rebuilding the application no extra step needs to be taken to lo
55. ard e Err This indicator shows the number of USB errors in real time It may be used to monitor the health of the USB connection This indicator is a 4 bit wrap around counter that is located within the hardware of the on board USB controller Note that USB is a bus therefore many of the errors detected may in fact be from other devices on the USB bus Also USB errors are corrected within the USB protocol Therefore a large number of errors does not necessary mean that the connection is not reliable e Reset Forces a reset of the board and reloads the Host Download kernel All previously executing DSP code is aborted This may be necessary to take control of a DSP that has crashed Note that the DSP is not reset by default when the mini debugger connects to the board This allows code that may have been loaded and run by the Power Up kernel to continue uninterrupted Signal Ranger mk3 User s Manual 27 Soft PI e LoadFPGA DSP Loads a DSP COFF file and or an FPGA file The DSP is automatically reset prior to the load The application presents a file browser to allow the user to select the DSP and FPGA files The user can opt to not load the DSP file or the FPGA file or both The files must be legitimate COFF and rbt files for the target DSP and FPGA respectively After the COFF file has been successfully loaded into DSP memory the corresponding symbol table is loaded into the PC memory to allow symbolic access to vari
56. art of the built executable The installer has nothing else to do e The latest NI VISA run time engine must be included in the installer 9 5 7 Required Support Firmware A few firmware files are required to support any VI or built executable These files must be stored according to the Firmware Storage and Location Rules discussed above They must be included in the build of an executable or an installer depending on the type of storage original firmware or container Vi 9 5 7 1 SR2_NG Platform e SR2Kernel HostDownload out Always required e SR2Kernel PowerUp out Always required e SR2 Flash Support out Required to use the Flash Support VIs e SR2_FPGA_Support out Required to use the FPGA Support VIs Application specific out or rbt files may be needed as well 9 5 7 2 SR3 Platform e SR3Kernel_HostDownload out Always required Signal Ranger mk3 User s Manual 38 Soft PI e SR3Kernel_PowerUp out Always required e SR3_Flash_Support out Required to use the Flash Support VIs Application specific out or rbt files may be needed as well 9 6 LabVIEW Interface Vis The LabVIEW interface is organized as several folders in the Signal_Ranger_mk3 Ivlib library All the libraries with names ending in _U contain support Vis and it is not expected that the developer will have to use individual Vis in these libraries Altogether the LabVIEW interface allows the developer to leverage Signal_Ranger_mk3 s real time
57. at was not previously erased and the data written implies a return of one or more bits into ones the usual behaviour is that the process locks up indefinitely The WP bit stays one indefinitely There is no timeout to unlock the write process The next writes to the write FIFO may be accepted but the FIFO is not being emptied therefore at some point the FIFO gets full and the SR3FB_Write function blocks 12 1 5 User Functions 12 1 5 1 unsigned int SR3FB_Init Initializes the driver and resets the Flash memory It detects the Flash ROM and returns the memory size in bytes or zero if the circuit is not present This function must be called at least once before any other function of the driver is called This function may be called to reinitialize the driver Note that the GPIO _0 intterrupt is enabled and INT6 of the DSP is used Input no input Output no output Return The size of the flash ROM in bytes 12 1 5 2 unsigned short SR3FB_SetAddress unsigned int FB_WAddress This function waits for all pending writes to complete Then it sets the FB_WriteAddress pointer to the 32 bit value passed in argument The function does not check to make sure that the address passed in argument is inside the allowable address range If it is not the subsequent writes will simply fail The function returns the current FB_WriteEraseError status Input unsigned int FB_WAddress This is the 32 bits byte address for the next write Output no ou
58. be even It is considered to be a byte transfer address consequently its bit 0 is masked at high level 10 4 6 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3 Base Open Next Avail Board e ReadWrite 1 gt Read 0 gt Write e Symbol Character string of the symbol to be accessed If Symbol is empty DSPAddress and MemSpace are used e DSPAddress Physical base DSP address for the exchange DSPAddress is only used if Symbol is empty e Offset Represents the offset of the data to be accessed from the base address indicated by Symbol or DSPAddress The actual access address is calculated as the sum of the base address and the offset Offset is useful to access individual members of a structure or an array Signal Ranger mk3 User s Manual 64 Soft PI e BranchLabel Character string representing the name of the DSP function that must be called as part of the operation If BranchLabelis empty BranchAddress is used e BranchAddress Entry point of the DSP function that must be called as part of the operation BranchAadress is only used if BranchLabel is empty e Data Array of bytes to be written to DSP memory e Size Represents the number of bytes to transfer For a read or a write the Data array allocated must be larger or equal to Size 10 4 6 4 Outputs e Data Array of bytes read from DSP memory The Da
59. cation specific LabVIEW executable to control the embedded SignalRanger device e C C libraries For developers who prefer to work in a C C environment we provide libraries in the form of DLLs These libraries have functionality similar to the LabVIEW libraries e Mini Debugger The Mini Debugger is a general purpose interface application that supports programming and real time symbolic debugging of generic DSP embedded code It includes features such as real time graphical data plotting symbolic read write access to variables dynamic execution Flash Signal Ranger mk3 User s Manual 10 Soft PI programming etc At its core the mini debugger uses the same interface libraries that a developer uses to design a stand alone DSP application This insures a seamless transition from the development debugging environment to the deployed application 4 2 Other Software Tools Also included in the software package are e Self Test Application This application tests all the hardware on the DSP board e Code Examples Several LabVIEW demo applications demonstrate the development of DSP code They also show how to interface this code to a PC application written in LabVIEW e Flash Driver and Example Code This driver includes all the code to configure and use the on board 32 MB Flash ROM from within user DSP code e CODEC Driver And Example Code This driver includes all the code to configure and use the on board CODEC f
60. ce the Acknowledge should be sent at the beginning of the function so that the LabVIEW VI that launched the function can exit as soon as possible 11 4 Assembly Requirements e All functions developed in assembly must include an acknowledge The Acknowledge is sent by writing the constant value acknow_asm to the register HP _HPIC There are several ways to do that One is described below MVKL 82 HPI_HPIC BO MVKH 82 HPI_HPIC BO MVK S2 acknow_asm Bl STW D2 Bl BO Signal Ranger mk3 User s Manual 71 Soft PI The file ASM_Definition_SR3 inc resolves the symbols HPI_HPIC and acknow_asm lt must be included in the assembly file e To be Kernel launch compatible a function does not need any particular features All the required context protection is done by the kernel prior to the launch By default the function cannot be interrupted But the global interrupt enable bit GEI bit of the CSR register can be set to 1 to allow the function to be interruptible e When developing a code section in assembly the align 32 directive must be used at the beginning of the section This insures that code sections always begin on a 32 bytes address This is not required when developing code in C because the C Compiler manages the alignment This requirement only applies to code sections e The kernel uses B15 as a software stack Assembly code must not use B15 for any other purpose Note Contrary to the SR1 and S
61. completely take control of a DSP that is executing other code or has crashed The complete operation takes 500ms BoardRef dupBoardRef error in no error error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi e Error in LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 4 SR3_Base_WriteLeds This Vi allows the selective activation of each element of the bi color Led e Off e Red e Green e Orange BoardRef dupBoardRef LedState e error in no error error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure t is created by SR3 Base Open Next Avail Board vi Signal Ranger mk3 User s Manual 41 Soft PI e LedState This enum control specifies the state of the LEDs Red Green Orange or Off e Errorin LabVIEW instrument style error cluster Contains error number and description of th
62. de has stopped running just that the PC cannot communicate with the board e The LED may also turn orange and back to green temporarily when the board is being reinitialized by a PC application e Finally the LED can be changed at any time by a user application However none of the applications provided exhibit this behaviour 5 5 Testing the Board At any point after the board has been powered up and is connected to a PC after the LED has turned green the SR3_SelfTest application can be run For users who have installed the C C developer s package the SR3_SelfTest application is found in the start menu under Start SignalRanger_mk3 SR3_Applications SR3_Selffest For users who installed the LabVIEW developer s package the equivalent VI is found in the Signal_Ranger_mk3 Ivlib library in the SelfTest folder The user interface of the SR3_SelfTest application is shown below Signal Ranger mk3 User s Manual 13 Soft PI Signal_Ranger_mk3 lvlib SR3_SelfTest vi Figure 1 Front panel of the SR3_SelfTest application e Before running the application connect the input output test harness that connects every input to the corresponding output e To run the application simply click on the white arrow that appears at the top left of the window e The application initializes the board then loads the kernel on the DSP and then proceeds to test e DSP e On chip RAM e DDR2RAM e Flash e Analog lOs e After each t
63. does not load the FPGA resp DSP The kernel has to be loaded prior to the execution of this VI The DSP is reset prior to beginning the load After loading a new DSP code the corresponding symbol table is updated in the Global Board Information Structure The VI checks if the type of COFF file and or FPGA logic file is right for the target If not an error is generated The VI always resets the DSP which also resets the FPGA If no new FPGA file is specified the FPGA is wiped out after the Vl s execution After completing the branch to the entry point the USB controller and the VI wait for an acknowledge from the DSP to resume their execution If this signal does not occur the VI will hang Normally the DSP code that is launched by this VI should acknowledge the branch by asserting the HINT signal see section about the DSP Communication Kernel BoardRef ode dupBoardRef See DSP File error out error in no error Controls e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi e FPGA File This is the file name of the FPGA file If FPGA File is connected and not empty the VI resolves the path using the standard rules for firmware and container VI locations If FPGA_Files is empty the VI does not load any FPGA logic The FPGA is reset by the VI so any previous logic is wiped out From the FPGA e DSP File This
64. dvance the index to the next value and adjust the parameters for the new block to display To completely empty the array right click on the index and choose the Empty Array menu To insert or remove a block in the array advance the index to the correct position right click on the Symbol field and choose the Insert Item Before or Delete Item menu For each block e Symbol or Address is used to specify the beginning of the memory block to display Symbol can be used if a COFF file containing the symbol has been loaded previously If Symbol is set to a position other than Force Address No Symbol Address and MemSpace are forced to the value specified in the COFF file for this symbol Note Specified addresses are byte addresses e MemSpace indicates the memory space used for the access The position Unknown defaults to an access in the Data space If Symbol is set to a specific symbol MemSpace is forced to the value specified in the COFF file for this symbol MemSpace may not be significant for some architectures e Number specifies the number of elements to display e Type specifies the data type to display Three basic widths can be used 8 bits 16 bits and 32 bits All widths can be interpreted as signed 8 116 132 unsigned U8 U16 U32 or floating point data e Format specifies the data presentation format Hexadecimal Decimal or Binary e Scale specifies a scaling factor for the graph re
65. e COFF file e DSP_Load Address Indicates the load address of the boot table in Flash memory e DSP_Last Addressindicates the last address of the boot table in Flash memory e FPGA file Indicates the path chosen for the FPGA logic file e Tools version The version of the ISE tools that were used to generate the rbt file e Design name The name of the design as it appears in the rbt file e Architecture The type of FPGA for which the rbt file is built e Device The model number of the FPGA for which the rbt file is built e Date The build date of the rbt file e FPGA_Load_Address This is the address of the beginning of the FPGA boot table in Flash memory e FPGA_Last_Address This is the last address of the FPGA boot table in Flash memory It is normally 1FFFFy e Write DSP Press this button to select the DSP code and burn it into Flash The required sectors of Flash are erased prior to programming Because the Flash is erased sector by sector rather than word by word the erasure will usually erase more words than what is strictly necessary to contain the DSP code e Write FPGA Press this button to select the FPGA logic and burn it into Flash The required sectors of Flash are erased prior to programming Because the Flash is erased sector by sector rather than word by word the Signal Ranger mk3 User s Manual 31 Soft PI erasure will usually erase more words than what is strictly necessary to contain t
66. e 17 Real Configuration This indicator contains the real configuration The user can look at this indicator to see if the real sampling mode is DSM or SSM mode preferred has been accepted Also the real output and input volumes are presented in this indicator Signal Ranger mk3 User s Manual 95
67. e as follows e COFF Management Libraries Directory containing all the Vis of the COFF Management library e SRanger mk3 Base Library Directory containing all the Vis of the SignalRanger_mk3 library e Firmware Containers Directory containing VIs to create firmware containers Signal Ranger mk3 User s Manual 11 Soft PI e Miscellaneous Directory containing a few support Vis e Documentation Directory containing all the user s manuals e DSP Code Directory containing directories of the various DSP projects e Drivers Directory containing the USB drivers for all the supported platforms e COFF_Management lvlib LabVIEW library of the COFF management VIs e Firmware_Containers lvlib LabVIEW library of the VIs used to create firmware container Vis e SignalRanger_mk3 lvlib LabVIEW library of the interface VIs e Various DSP out files Note The Drivers directory should be stored at a fixed location In some Windows versions when the computer needs to reload the drivers it looks for them in the location where they were first found 5 1 2 C C Developer s Package SR3 Applications Installer zip To install the C C package run SR3_Applications_Installer_Vxyy exe This installs the following items in the directory C Program Files SR3_Applications e Documentation Directory containing all the user s manuals e Drivers Directory containing the USB drivers for all the supported platforms e
68. e previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 5 SR3_Base_Bulk_Move_Offset This VI reads or writes an unlimited number of data words to from the program data or I O space of the DSP using the kernel This transfer uses bulk pipes This translates to a high bandwidth The VI is polymorphic and allows transfers of the following types Signed 8 bit bytes 18 or arrays of this type Unsigned 8 bit bytes U8 or arrays of this type Signed 16 bit words 116 or arrays of this type Unsigned 16 bit words U16 or arrays of this type Signed 32 bit words 132 or arrays of this type Unsigned 32 bit words U32 or arrays of this type 32 bit floating point numbers float or arrays of this type e Strings These represent all the basic data types used by the C compiler for the DSP To transfer any other type structures for instance the simplest method is to use a cast to allow this type to be represented as an array of U8 on the DSP side cast the required type to an array of U8 to write it to the DSP read an array of U8 and cast it back to the required type for a read The DSP addr
69. e software interface variables declared in C should be declared global outside all blocks and functions and without the static keyword Variables and labels declared in assembly function entry points for instance should be declared with the assembly directive global 11 9 Preparing Code For Self Boot The on board Flash circuit may be programmed to load DSP code and or FPGA logic at power up and to launch the execution of the specified DSP code More information about DSP and FPGA Flash boot tables is located in the following sections Signal Ranger mk3 User s Manual 73 Soft PI Once DSP code and or FPGA logic have been developed and tested under control of the PC possibly using the mini debugger they may be programmed into Flash using the appropriate functions of the mini debugger The DSP code loaded in Flash must contain an acknowledge see examples at its beginning even when the code is launched from Flash Usually when developing in C this acknowledge is placed in the first lines of the main function Failure to include the acknowledge does not cause the DSP code to crash However it does cause the USB controller to fail to recognize that the Power Up kernel has been loaded In this circumstance it is necessary to reset the board in order to gain access from the PC This reset in turn would cause the boot loaded DSP code to abort Note The Acknowledge is also required for code that is written to be l
70. e the processing is going on In many cases this approach can advantageously replace simulation passes providing better data that comes from a real life test Because of its extensive signal processing analysis and display libraries LabVIEW facilitates such tasks tremendously e Step by step these small test applications usually grow into the full fledged end user applications that are ultimately deployed with the end product Because the PC DSP code interaction is based on the same communication channels and software libraries there are no surprises during the migration from the test applications towards the deployed applications e In the end the DSP code and FPGA logic for boards that include an FPGA can be flashed into the on board ROM From the DSP s perspective the boot process is exactly the same when the code is downloaded from the PC as when it is copied from the on board FLASH ROM This Signal Ranger mk3 User s Manual 25 Soft PI insures that the developer has no surprises at the time of deployment The burning of the DSP code into the on board Flash is done using the Mini Debugger 8 Mini Debugger The mini debugger allows the developer to interactively e Reset the DSP board e Download a DSP executable file to DSP memory or use the symbols of a DSP code already in memory e Launch the execution of code simple function or entire code from a specified address or from a symbolic label Read and write
71. e zip lt covers the use of the Ethernet interface on the SR3_Pro platform 10 1 Execution Timing and Thread Management Two functions of the SAm3_HL DLL accessing the same SignalRanger_mk3 DSP board cannot execute concurrently The first function must complete before the second one can be called Care should be taken in multi threaded environments to ensure that separate functions of the DLL do not run at the same time in separate threads The simplest method is to ensure that all calls to the DLL functions are done in the same thread However functions of the interface accessing different boards can be called concurrently All the functions of SAm3_HL DLL are blocking They do not return until the requested action has been performed on the board 10 2 Calling Conventions The functions are called using the C calling conventions All the functions return a USB_Error_Code in the form of a 32 bit signed integer This error code is zero if no error occurred Whenever a function must return an array or string the corresponding space of sufficient size must be allocated by the caller and a pointer to this space is passed to the function In addition the size of the element that has been allocated by the caller is passed to the function The size argument associated with the array or string normally follows the array or string in the argument line 10 3 Building a Project Using Visual Studio To build a project using Visual Studio the following
72. eal time It may also be used in stand alone mode executing embedded DSP code The ADCs and DACs have a mode of operation default where the bandwidth goes down to DC This allows the board to be used in high performance control applications Given its high quality analog IOs its programmability and the fact that it can work as a stand alone board the SignalRanger_mk3 board may be used in many applications Multi channel speech and audio acquisition and processing Multi channel control Measurement and Instrumentation Vibro acoustic analysis Acoustic Array processing Beamforming DSP software development 2 1 Boot Modes and Modes of Operation SignalRanger_mk3 includes a 32MB Flash ROM from which the DSP can boot There are two ways the DSP can boot e Stand Alone Boot At Power Up if firmware is present in Flash it is loaded and executed By pre programming the Flash memory with DSP code the board can work in stand alone mode executing an embedded DSP application directly from power up e PC Boot When the board is connected to a PC the PC can force the DSP to reboot In this mode the PC can force the reloading of new DSP code This mode may be used to take control of the DSP at any time In particular it may be used to reprogram the Flash memory in acompletely transparent manner Signal Ranger mk3 User s Manual 7 Soft PI Even after the DSP board has booted in stand alone mode a PC can be co
73. ed by its pair of DSP code and FPGA file names This name pair completely defines the product and optionally its revision If revision information is required in the file names a _ Vxyy suffix in the file name is a good approach Note lf either DSP code or FPGA logic is not programmed into Flash for a particular product the corresponding file name recorded in Flash is an empty string If both files are absent this may cause the product to lack a proper definition To avoid this situation we suggest loading in Flash at least a minimal DSP code that does nothing except return to the kernel The file name of this code will be chosen to provide the proper product definition 9 4 Suggested Fimmware Upgrade Strategy When deploying a new firmware revision of the same product two operations must be performed e Reflash the embedded target with the new firmware files This is done either by a manual tool or by an automated tool that recognizes the target and reprograms its Flash This new firmware is contained in new DSP and or FPGA files possibly having unique names if they need to be distinguished by the host application e Install a new host application to manage the new target This new application is aware of the new firmware version It usually performs new functions that are enabled by the new firmware One practical method that can be employed to do both operations efficiently is to design a host application that is able to e Reco
74. ed function the DSP asserts the HINT signal to signal the USB controller that the operation has completed This operation has been conveniently defined in a Signal Ranger mk3 User s Manual 82 Soft PI macro Acknowledge in the example codes and can be inserted at the end of any user function Note that from the PC s point of view the command seems to hang until the Acknowledge is issued by the DSP User code should not take too long before issuing the Acknowledge In the case of a function that does not return K_Exec to the entry point of a never ending loop for instance the Acknowledge may be issued at the beginning of the function to indicate that the branch has been taken The Acknowledge is simply the signal to the USB controller to advance to step 3 11 10 6 3 1 3 Step 3 e Inthe case of a K_Read command the USB controller reads all the required bytes from the mailbox and sends them back to the PC via the current USB packet e Inthe case of a K_Exec or a K_Write the USB controller then sends a small Completion Packet of 4 bytes to the PC to signal the completion of the command Since a PC access is requested through the use of the DSPint interrupt from the HPI it can be obtained even while user code is already executing Therefore it is not necessary to return to the kernel to be able to launch a new DSP function This way user functions can be re entered Usually the kernel is used at level 2 to download and la
75. eft unwired DSPAddress is written to the TransferAdaress field of the mailbox before the first call of the user defined DSP function the call corresponding to the first segment DSPAddress is not required to represent a valid address It may be used to transmit an application specific code a FIFO number for instance e Size Only used for reads of array types Represents the size in number of items of the requested data type of the array to be read from DSP memory For Writes the whole contents of Dataln are sent to DSP memory regardless of Size When Size is wired the data can only be transferred as arrays not scalars e Symbol Character string of the symbol to be accessed If Symbolis empty or unwired DSPAddress and MemSpace are used e Offset Represents the offset of the data to be accessed from the base address indicated by Symbol or DSPAddress The actual access address is calculated as the sum of the base address and the offset Offset is useful to access individual members of a structure or an array lf DSPAddress is used to transport application specific data Offset should not be connected e 6R W Boolean indicating the direction of transfer true gt read false gt write e BranchLabel Character string corresponding to the label of the user defined function If BranchLabel is empty or unwired BranchAddress is used instead e BranchAddress Physical base DSP address for the user defined function e Errorin L
76. el function that SR3_Base_Bulk_Move_Offset uses This function only transfers arrays of bytes To transfer any other type the simplest method is to use a cast to allow that type to be represented as an array of U8 on the DSP side cast the required type to an array of U8 to write it to the DSP read an array of U8 and cast it back to the required type for a read The operation of the USB controller and the kernel allows a user defined DSP function to override the intrinsic kernel functions See kernel documentation below For this the user defined DSP function must perform the same actions with the mailbox as the intrinsic kernel function would kernel read or kernel write This may be useful to define new transfer functions with application specific functionality For example a function to read or write a FIFO could be defined this way In addition to the data transfer functionality a FIFO read or write function would also include the required pointer management that is not present in intrinsic kernel functions Accordingly SR3_Base_User_Move_Offset includes two input arguments to define the entry point of the function that should be used to replace the intrinsic kernel function A transfer of a number of words greater than 32 greater than 256 for a High Speed USB connection is segmented into as many 32 word 256 word transfers as required The user defined function is called at every new segment If the total number of wo
77. emporarily disable the HPI_Int or INT4 interrupt through its mask or the global interrupt mask GEI by of the CSR register During the time this interrupt is disabled all PC access requests are latched but are held until the interrupt is re enabled Once the interrupt is re enabled the access request resumes normally Signal Ranger mk3 User s Manual 75 Soft PI e The kernel initializes the stack at byte address 0x10F17FF8 The kernel uses less than 128 bytes of stack between addresses 0x10F17F78 and address 0x10F17FF8 The user code can relocate the stack pointer temporarily but should replace it before the last return to the kernel if this last return is intended Examples where a last return to the kernel is not intended include situations where the user code is a never ending loop that will be terminated by a board reset or a power shutdown In these cases the stack can be relocated freely without concern Note When branching to the entry point of a program that has been developed in C the DSP first executes a function called c_int00 which establishes new stacks as well as the C environment This function then calls the user defined main When main stops executing assuming it is not a never ending loop it returns to a never ending loop within the c_int00 function It does not return to the kernel e To manage the data transfers the kernel uses the EDMA channel 63 Queue No2 Both the event and
78. epending on DSP activity 3 2 USB The high Speed USB 2 0 PC connection provides a throughput in excess of 35 Mb s in the read and write directions A stand alone USB controller relieves the DSP of all USB management tasks 3 3 DSP TMS320C6424 fixed point DSP running at 590 MHz 3 4 Memory e 0e y 208 Kbytes on chip DSP RAM 128 Mbytes DDR2 RAM 32 Mbytes Flash Rom Analog Inputs Number of inputs 6 Resolution 24 bits Noise 25 uV RMS Sampling rate up to 96 kHz Analog input bandwidth up to 48 kHz Anti aliasing filter Integrated High Pass filter Bypassable Input type Single Ended Two inputs can be configured to support an electret microphone Dynamic range 3V Group delay 11 or 14 samples depending on sampling mode including software buffering Signal Ranger mk3 User s Manual 8 Soft PI 3 6 Analog Outputs e Number of outputs 6 e Resolution 24 bits e Noise 11 uV RMS e Sampling rate up to 96 kHz e Analog output bandwidth up to 48 kHz e Anti aliasing filter Integrated e Output type Single Ended e Dynamic range 2 1 V e Source Sink ability 2 mA 25 degC 1 mA 100 degC e Group delay 11 or 14 samples depending on sampling mode including software buffering 4 Software 4 1 SignalRanger DDCI Interface The centerpiece of the SignalRanger architecture is its DDCI interface DDCI Development to Deployment Code Instrumentation allows a controlling ap
79. equires that this type be wired at the Datain input This simply forces the type for the read operation Note When reading or writing scalars Size must be left unwired 9 6 1 5 1 Notes on Transfer Atomicity When reading or writing types larger than the native type for the platform the PC performs several separate accesses for every transferred long type In principle the potential exists for the DSP or the host to access one word in the middle of the exchange thereby corrupting the data For instance during a read on a platform where the native type is U16 the host could upload a floating point value just after the DSP has updated one 16 bit word constituting the float but before it has updated the other one Obviously the value read by the host would be completely erroneous Symmetrically during a write the host could modify both 16 bit words constituting a float in DSP memory just after the DSP has read the first one but before it has read the second one In this situation the DSP is working with an old version of one half of the float and a new version of the other half These problems can be avoided if the following facts are understood On the SignalRanger_mk2_Next_Generation platform when the PC accesses a group of values it always does so in blocks of up to 32 16 bit words at a time up to 256 words if the board has enumerated on a high speed capable USB hub or root Each of these block accesses is atomic The D
80. er lib library We suggest using the file vectors asm provided in the folder C Program Files SR3_Applications DSP_Code when using the SR3_FB_Driver lib library The linker command file provided in the flash driver folder can also be used to assure the correct link for the INT6 vector e Aheader file named SR3_FB_Driver his provided that declares all the functions of the driver e Before any other function of the driver is called the driver must be initialized using the SR3FB_Init function All the files described above can be found in the SR3_Flash_Support DSP code example 12 1 4 Data Structures 12 1 4 1 FB_WriteFIFO FB_WriteFIFO is a buffer of 32 16 bits word accessed with FIFO access logic The FIFO itself is not user accessible It may only be written using the SR2FB_Write function It is only emptied under INT6 interrupt service routine 12 1 4 2 FB_WriteAddress FB_WriteAddress is a 32 bit unsigned variable that always contains the address of the next 16 bit word to be written FB_WriteAddress can be initialized by the SR3FB SetAddress function or the SR3FB_WritePrepare function After each write completes the FB_WriteAddress register is automatically incremented This increment happens in the INT6 interrupt routine Therefore to the user code the value always indicates the address for the next write never the value of the write that is in progress The current value of the FB_WriteAddress register can be read with the SR3FB_FIFOS
81. ess and memory space of the transfer are specified as follows e f Symbol is wired and the symbol is represented in the symbol table then the transfer occurs at the address and memory space corresponding to Symbol Note that Symbol must represent a valid address Also the DSP COFF file must be linked with the usual page number convention e Program space page number 0 e Data space page number 1 e O space page number 2 e All other page numbers are accessed as data space e f Symbolis unwired then DSPAddress is used as the byte address for the transfer and MemSpace is used as the memory space e Note that DSPAddress may be required to be aligned to the proper width depending on the architecture e The value of Offset is added to DSPAddress This functionality is useful to access individual members of structures or arrays on the DSP Note that the value of Offsetis always counted in bytes not in elements of the specified type This is required to access an individual member of an heterogeneous structure e In case of a write of a data type narrower than the native type for the platform then additional elements are appended to complete the write to the next boundary of the native type The appended values are set to all FFy This does not occur on Signa Ranger_mk3 since the native type is byte Signal Ranger mk3 User s Manual 42 Soft PI Note Since the VI is polymorphic to read a specific type r
82. esses If it is not then the write will simply fail The failure will not be detected until the data is actually written from the FIFO to the Flash however The function returns the current FB_WriteEraseError status However this error word does not reflect the status of the requested write because the function does not wait for this write to actually begin Input short Data this is the 16 bits data to place in the FIFO Output no output Return The current FB_WriteEraseError 12 2 CODEC Driver and Example Code 12 2 1 Overview A driver for the analog I Os CODEC is provided together with the DSP code of a demo application that uses this driver as well as an empty shell project Source code for the CODEC driver resides in the folder SR3 AlCDriver Source code for the demo application resides in the folder SR3_SignalTracker This folder contains the DSP code of the SignalTracker demo application discussed in the section Source code for the shell project resides in the SR3_10_ Shell folder The shell project constitutes an excellent starting point for developing DSP code that uses the CODEC The driver has been optimized in assembly and C but can be used either in C or in assembly language It takes the form of a DSP object librarie A CDriverSr3Jr lib The driver contains C callable functions to configure and use the CODEC A function called dataprocess is provided in C where developers can conveniently place their own a
83. est completes the corresponding indicator lights up A green indicator indicates a pass A red indicator indicates a fail Note Due to their very large size the tests of the DDR2 RAM and the Flash take a very long time to complete The Flash test in particular can take up to 30 minutes to complete Note The Flash test erases the Flash contents To avoid losing the Flash contents this test can be skipped 5 6 Evaluating the Analog Performance The SR3_SignalTracker demo application has been designed to allow the test and evaluation of the analog input output channels The application allows the user to send test signals to a selected channel output and monitor the sampled signal on a selected input Inputs are displayed both in terms of time Signal Ranger mk3 User s Manual 14 Soft PI signals as well as instantaneous or averaged energy spectra Averaged energy spectra are useful to evaluate the input noise as a function of frequency For users who have installed the C C developers package the SR3_SignalTracker application is found in the start menu under Start SignalRanger_mk3 SR3_Applications SR3_SignalTracker For users who installed the LabVIEW developer s package the equivalent VI is found in the Signal_Ranger_mk3 Ivlib library in the SignalTracker folder The front panel of the application is divided into several tabs one for each function group Signal_Ranger_mk3 lvlib SR3_SignalTracker vi HBO Em
84. gages the ADC high pass filters or freezes them to the last value Briefly engaging the filter and freezing it effectively cancels out the DC offset present on the ADC input This is done at the level of the ADC while the offset compensation is done at the software level 5 6 3 1 9 AIN5 MUX and AIN6 MUX These controls select the input path for the analog input 5 and 6 either Line In or Electret Microphone Input 6 Hardware Description 6 1 Connector Map Ranger mk3 Junior Gr Figure 5 SignalRanger_mk3 DSP board Signal Ranger mk3 User s Manual 19 Soft PI Legend 5V PowerSupply J3 USB Connector Mini B Expansion Connector J7 Expansion Connector J6 Analog Inputs J5 Analog Outputs J4 6 2 Expansion Connectors J 6 and J 7 Figure 6 J6 and J7 Connector Pinouts 6 2 1 J 6 Pinout No Function No Function Gnd 18 16 14 12 10 4 AXRO O FSR1 GP 105 AFSX0 DX1 GP 107 Table 1 Connector J6 Signal Ranger mk3 User s Manual 20 Soft PI 6 2 1 1 Power Supply Pins 6 2 1 1 1 5V This is the same supply that is brought to the 5V power connector J3 The maximum current that may be drawn from this pin is 500 mA It may be further limited by the capacity of the power supply that is used 6 2 1 1 2 3 3V This is the main logic supply The maximum current that may be drawn from this pin is 400 mA 6 2 1 1 3 3 3V This is a small polarization supply The maximum
85. gnize that the firmware revision number of the connected target is lower than the highest revision number that it is able to manage e Re flash the target with the highest revision number that it has on file for this target Using this approach the procedure for upgrading would be e First install the latest version of the new managing application on the host PC Signal Ranger mk3 User s Manual 34 Soft PI e Then rely on this application to recognize that the target is not up to the latest revision and suggest a re flashing of the firmware To facilitate this the SA3_Base_Open_Next_Avail_Board vi provides the firmware file names and corresponding checksums 9 5 Development of a Product Specific Application Based on the provided LabVIEW interface libraries the product developer must design and organize a host application that is product specific To do that properly it is useful to understand the following features of the new LabVIEW interface 9 5 1 Opening the Target The LabVIEW interface can manage multiple simultaneous target connections Each time a target connection is opened the SR3_Base_Open_Next_Avail_Board vi Vi creates a data structure that represents the target board and returns a BoardRef_Out indicator This BoardRef_Out indicator is used as a handle on the specific target It represents the specific target and its associated data structure All the VIs in the interface use this handle as an input
86. guidelines should be followed An example is provided to accelerate the learning curve see last section of the current chapter e If the project is linked statically to the SAm3_HL Iib library it must be loaded using the DELAYLOAD function of Visual C To use DELAYLOAD add delayimp lib to the project in Visual Studio 2005 it can be found in Program Files Microsoft Visual Studio 8 VC lib in Project Properties under Linker Command Line Additional Options add the command DELAYLOAD SRm3_HL dll e Alternately the DLL may be loaded dynamically using LoadLibrary and DLL functions must be called using GetProcAddress Do not link statically with the SRm3_HL lib library without using the DELAYLOAD function e Add include SRm3_HL h in the main e f using the DELAYLOAD function to link statically to the SAm3_HL lib library add SRm3_HL lib to the project e The following files must be placed in the folder containing the project sources e cvilvsb h e extcode h e fundtypes h Signal Ranger mk3 User s Manual 58 Soft PI hosttype h ILVDatalnterface h ILVTypelnterface h platdefines h SRm3_HL h All these files are part of the provided example 10 4 Exported Interface Functions 10 4 1 SR3_DLL_Open_Next_Avail_Board 10 4 1 1 Prototype int32_t SR3_DLL_Open_Next_Avail_ Board uint16_t idVendor Restrict uint16_t idProduct_Restrict uint16_t ForceReset int32_t BoardRef char DSP_Firmware Namelf int32_t DSP
87. he user function be loaded in DSP memory prior to the branch The mailbox is an area in the HPl accessible RAM of the DSP The function of each field in the mailbox is described below Address Name Function 10F04000 BranchAddress 32 bit branch address intrinsic read and write functions or user function 10F04004 TransferAddress 32 bit transfer address for K_Read and K_Write commands 10F04008 NbBytes 16 bit number of words to transfer 10FO400A ControlCode This code contains the command K_Read K_Write or K_Exec in bits O and 1 00 gt K_Exec 01 gt K_Read 10 gt K Write It also contains the block size in bytes for the transfer K_Read K_Write The block size is stored in unsigned binary notation in bits 2 to 15 aligned on bit 0 on the right This means that simply masking bit 0 and 1 in ControlCode yields the block size The block size is normally 512 bytes for a high speed connection and 64 bytes for a full speed connection 10F0400C Data 512 data bytes used for transfers between the PC and the DSP Only the first 64 bytes are used when the board is connected as a Full Speed USB device Table 7 Mailbox To launch a DSP function intrinsic or user code the PC via the USB controller initiates a K_Read K_Write or K Exec command This command contains information about the DSP address of the function to execute user or intrinsic For K_Read and K_Write it also contains information about the tra
88. he FPGA logic e Clear DSP Press this button to erase the DSP code from Flash e Clear FPGA Press this button to erase the FPGA logic from Flash e Flash Size If the Flash is detected this field indicates its size in kwords Signal_Ranger_mk3 lvlib SR3_Flash_Config_Dialog_Select vi Figure 12 e Chk Flash This button brings a panel that is very similar to the W_Flash button The only difference is that this utility verifies the contents of the Flash against the user specified files rather than program it If no file is selected for the DSP and or FPGA the corresponding verification is cancelled and always indicates a positive result Signal_Ranger_mk3 lvlib SR3_Flash_Check_Dialog vi DSP FPGA Jason i sue Apa Figure 13 Signal Ranger mk3 User s Manual 32 Soft PI e DSP_File This field indicates if DSP code is present in the on board Flash When this field indicates a DSP code the associated symbols are usually loaded from Flash as well and can be used to interact with the code that is running e FPGA File This field indicates if FPGA logic is present in the on board Flash and is active This field is empty when the board is reset 9 USB LabVIEW Interface 9 1 Preliminary Remarks This new LabVIEW USB interface has been completely reworked to support two architectures e The old Signa Ranger_mk2 boards To be under the control of the new interface the old boards must have a new PID that al
89. he SignalRanger series do provide a JTAG emulator connection So the developers who absolutely need to use this approach can do it However the DDC approach generally provides better visibility and control over the DSP code and fewer restrictions Therefore it is generally the preferred choice The DDCI interface relies on a set of libraries either LabVIEW libraries or DLLs to communicate with the board in real time while the DSP code is running Because the same communication paths and libraries are used during the development and after the deployment the code does not have to be adjusted or redeveloped to account for different communication channels between the two development phases Also compared to emulator based debugging techniques the DDCI approach allows the instrumentation of the code in real time without stopping the CPU This real time code instrumentation capability in turn allows the implementation of tests with hardware in the loop Compared to the more traditional simulation approach the hardware in the loop approach provides better results that take everything into account and it is generally easier to setup and implement The DDC development strategy usually follows the pattern below e The DSP code is developed and built into an executable using Code Composer studio Early in the development this task is facilitated by the examples libraries and code shells that we provide e Early in the development
90. he board simply because the corresponding driver instance is still open In such a case simply disconnect and reconnect the board to force the PC to re enumerate the board 9 6 1 2 SR3 Base Close BoardNb This Vi closes the instance of the driver used to access the board and deletes the corresponding entry in the Global Board Information Structure Use it after the last access to the board has been made to release resources that are not used anymore BoardRef FA dupBoardRef error in no error error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators Signal Ranger mk3 User s Manual 40 Soft PI e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 3 SR3_Base_Complete_DSP_Reset This VI performs the following operations e Temporarily flashes the LED orange e Resets the DSP e Reinitializes HPIC e Loads the Host Download kernel These operations are required to
91. he flash driver for examples and functions to time DSP code using this counter e Check for the presence of a user DSP code in the flash memory e f a DSP code is present the user code is loaded and launched The kernel is still resident and ready to respond to requests from the PC e f no user code is detected the kernel enters in a simple waiting loop ready to respond to requests from the PC 11 10 2 PC Connection Whenever the board is connected to the PC the USB controller enumerates the board to the PC which launches the board driver and allows the PC to take control of the board This step does not disrupt or even interact in any way with the DSP code that may already be executing However from this moment on the PC can make kernel requests which can read and write DSP memory or execute functions in DSP memory When a PC application opens the board it reads the Flash to detect if a DSP code is resident If so it loads its symbol table from FLASH The application then has symbolic access to the DSP code 11 10 3 PC Reset After the board has been connected to the PC the PC can reset the DSP at any time From this point it loads the Host Download_Kernel The Host Download_Kernel performs exactly the same operations as the Power Up Kernel see above except that it does not look for DSP code in Flash It simply waits for kernel requests from the PC This simple scheme allows the PC to positively take control of the DSP at any time
92. he function simply returns the contents of the on chip RAM rather than the contents of the Flash Input unsigned int FB_Radress This is the 32 bits read byte address Output Signal Ranger mk3 User s Manual 88 Soft PI no output Return The 16 bits word read at the specified byte address 12 1 5 6 unsigned short SR3FB_WritePrepare unsigned int FB_WAddress unsigned int FB_WSize The function pre erases all the sectors of the Flash circuit required to write a segment FB_WSize long from the FB WAddress address It then initializes the FB_WriteAddress register to the value of FB_WaAddress so that the next call to FB_Write will effectively write at the beginning of the prepared segment Because erasure is performed sector by sector only this function may erase more 16 bits words that are actually specified This is the case if FB_Waddress is not an address corresponding to the beginning of a sector or if FB_Waddress FB_WSize 1 is not an address corresponding to the end of a sector The sectors are 131 072 0x20000 bytes long and the first flash address is 0x42000000 The function waits for all pending writes to complete before starting the erasure The function does not check to make sure that the erasure does not include any addresses outside the useable address range If during the preparation a sector erase is attempted outside the range of useable addresses the function simply fails It sets the
93. ies 22 65 Peripheral Interfaces 23 6 5 1 Flash ROM 23 6 5 2 DDR2 RAM 24 6 5 3 Codec 24 7 CODE DEVELOPMENT STRATEGY 24 8 MINI DEBUGGER 26 8 1 Description of the User Interface 27 9 USB LABVIEW INTERFACE 33 9 1 Preliminary Remarks 33 9 2 Product Development Support 33 9 3 Implicit Revision Information 34 9 4 Suggested Firmware Upgrade Strategy 34 9 5 Development of a Product Specific Application 35 9 5 1 Opening the Target 35 9 5 2 Execution Sequencing 35 9 5 3 Loading and Executing Code Dynamically 36 9 5 4 Firmware Storage and Locations Rules 36 9 5 5 Building a LabVIEW Executable 38 9 5 6 Creating an Installer 38 9 5 7 Required Support Firmware 38 9 6 LabVIEW Interface Vis 39 9 6 1 Core Interface VIs 39 9 6 2 Flash Support VIs 52 9 6 3 FPGA Support VIs 56 10 USB C C INTERFACE 57 10 1 Execution Timing and Thread Management 58 10 2 Calling Conventions 58 10 3 Building a Project Using Visual Studio 58 Signal Ranger mk3 User s Manual 4 Soft PI 10 4 Exported Interface Functions 59 10 4 1 SR3_DLL_Open_Next_Avail_Board 59 10 42 SR3_DLL_Close_BoardNb 60 10 4 3 SR3_DLL_Complete_DSP_Reset 60 10 4 4 SR3_DLL_WriteLeds 61 10 45 SR3_DLL_Bulk_Move_Offset_U8 61 10 4 6 SR3_DLL_ User Move_Offset_U8 63 10 4 7 SR3_DLL_HPI_Move_Offset_U8 65 10 4 8 SR3_ DLL LoadExec_User 66 10 49 SR3_ DLL _ Load_User 66 10 4
94. ill transfer a complete block of data in the middle of another concurrent DSP operation on this same data To avoid this situation it is sufficient to also make atomic any DSP operation on 32 bit data that could be modified by the PC This can easily be done by disabling DSPInt interrupts for the length of the operation Then the PC accesses are atomic on both sides and data can safely be transferred 32 bits at a time On this platform transfers are always atomic on the PC side The Atomic control is present for compatibility but has no effect On the SignalRanger_mk3 platform the user has the choice of using atomic transfers or non atomic transfers Using an atomic transfer presents the advantage that from the DSP s perspective all the parts of the block are transferred simultaneously This behaviour is compatible with the behaviour of the SignalRanger_mk2_Next_Generation platform Non atomic transfers present the advantage that critical DSP tasks can interrupt the transfer and therefore take precedence over the USB transfer The only way to use a non atomic transfer on SignalRanger_mk2_Next_Generation is to use a custom user function and the SR3_Base_User_Move_Offset function 10 4 5 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3 Base Open Next Avail Board e ReadWrite 1 gt Read 0 gt Write e Symbol Character string of the symbol t
95. included in the calculation Signal Ranger mk3 User s Manual 17 Soft PI 5 6 2 7 Graph and Zoom Controls Graph controls can be used to change the zoom factor By default the plot is auto scaled in X and Y which is indicated by the closed locks beside each scale name To disable auto scale simply press the lock button 5 6 2 8 Cursors Two cursors can be moved on the graph The frequency and amplitude value at the cursor are displayed in the cursor window 5 6 3 AIC Set Up Tab The AIC Set Up tab presents the various controls for the acquisition set up E Signal_Ranger_mk3 lvlib SR3_SignalTracker vi i Time Signal Sxx AIC Set up AIC CFG Sampling Rate 48 kHz ADC_5_MUX 5A Line In 5 ADC_6_MUX Preferred Mode DAC Volume Vol dB DAC2 oo Vol dB DAC3 oo Vol dapace 00 Vol dB DACS oo Vol dB DAC6 oo DAC Mute Mute DAC1 Mute DAC2 Mute DAC3 Mute DAC4 Mute DACS Mute DAC DAC Polarity DAC1 Invert DAC2 Invert DAC3 Invert DAC4 Invert DACS Invert DACS Invert Single Vol Output OFF T Volume change output Immediate 6A Line In 6 ADC Volume Vol dBADCI Jo Vol dB ADC2 so Vol dB ADC3 Tso Vol dB ADC4 so Vol dB ADCS so Vol dB ADCS joo ADC_1 4 HP Filter ADC_5 6 HP Filter Single Vol Input OFF T Volume change input Immediate x Figure 4 SR2_SignalTracker application AIC Set Up t
96. ing the starting address are always erased Note On SignalRanger_mk2_Next_Generation the sector size is 32 kwords On SignalRanger_mk3 the sector size is 64 kwords 128 kBytes Note Erasure should only be attempted in the sections of the memory map that contain Flash Erasure attempts outside the Flash will fail 10 4 15 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3 Base Open Next Avail_ Board e Starting Address Address of the first word to be erased e Size Number of words to be erased 10 4 15 4 Outputs None Signal Ranger mk3 User s Manual 69 Soft PI 10 4 16 SR3_DLL Flash FlashMove U8 10 4 16 1 Prototype int32 t SR3 DLL Flash FlashMove U8 int32 t BoardRef uinti6_t ReadWrite char Symboll uint32_t DSPAddress uint8_t Datal int82_t Size 10 4 16 2 Description This function reads or writes an unlimited number of bytes to from the Flash memory Note that if only Flash memory reads are required the function SR3_Base_Bulk_Move_Offset should be used instead since it does not require the presence of the DSP Flash support code This function only transfers arrays of bytes To transfer any other type the simplest method is to use a cast to allow that type to be represented as an array of U8 on the DSP side cast the required type to an array of U8 to write it to the DSP read an a
97. intrinsic kernel function would kernel read or kernel write This may be useful to define new transfer functions with application specific functionality For example a function to read or write a FIFO could be defined this way In addition to the data transfer functionality a FIFO read or write function would also include the required pointer management that is not present in intrinsic kernel functions Accordingly SR3_Base_User_Move_Offset includes two controls to define the entry point of the function that should be used to replace the intrinsic kernel function Signal Ranger mk3 User s Manual 44 Soft PI A transfer of a number of words greater than 32 greater than 256 for a High Speed USB connection is segmented into as many 32 word 256 word transfers as required The user defined function is called at every new segment If the total number of words to transfer is not a multiple of 32 256 the last segment contains the remainder The user defined function should be created to operate the same way as the kernel read and write functions That is it should perform the same transfers mailbox housekeeping and handshaking as the kernel functions do 9 6 1 6 1 SR2_NG Platform e fa transfer is involved the function transfers the required words to or from the Data area of the mailbox The number of words to transfer is the value of the NbWords field of the mailbox In SR2_NG this field represents the number of words t
98. is type to be represented as an array of U8 on the DSP side cast the required type to an array of U8 to write it to the DSP read an array of U8 and cast it back to the required type for a read An attempt to write outside of the Flash memory will result in failure The writing process can change ones into zeros but not change zeros back into ones If a write operation is attempted that should result in a zero turning back into a one then it results in failure Signal Ranger mk3 User s Manual 53 Soft PI Normally an erasure should be performed prior to the write so that all the bits of the selected write zone are turned back into ones Note Contrary to the SignalRanger_mk2 generation incremental programming programming the same address multiple times is allowed Each programming operation cannot set individual bits from O to 1 This can only be done by an erasure cycle on a whole sector However the programming operations can reset individual bits from 1 to 0 at any time without intervening erasure In case of a write of a data type narrower than the native type for the platform then additional elements are appended to complete the write to the next boundary of the native type The appended values are set to all FFy Since the VI is polymorphic to read a specific type requires that this type be wired to the Dataln input This simply forces the type for the read operation Note When reading or w
99. is the file name of the DSP file If DSP_File is connected and not empty the VI resolves the path using the standard rules for firmware and container VI locations If DSP_File is empty the VI does not load any DSP code The DSP is reset by the VI e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators Signal Ranger mk3 User s Manual 48 Soft PI e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 9 SR3_Base_Load_User This VI loads a new user FPGA logic and or DSP code Only the names of the files need to be given The files themselves need to be stored according to the rules described in section 8 5 4 If either FPGA_File or DSP_File is empty the VI does not load the FPGA resp DSP The kernel has to be loaded prior to the execution of this VI The DSP is reset prior to beginning the load After loading a new DSP code the corresponding symbol table is updated in the Global Board Information Structure The VI checks if the type of COFF file and or FPGA logic file is right for the target If not an error is generated The VI always resets the DSP which also resets
100. is translates to a high bandwidth This function only transfers arrays of bytes To transfer any other type the simplest method is to use a cast to allow that type to be represented as an array of U8 on the DSP side cast the required type to an array of U8 to write it to the DSP read an array of U8 and cast it back to the required type for a read The DSP address and memory space of the transfer are specified as follows e f Symbol is not empty and the symbol is represented in the symbol table then the transfer occurs at the address and memory space corresponding to Symbol Note that Symbo must represent a valid address Also the DSP COFF file must be linked with the usual page number convention e Program space page number 0 e Data space page number 1 e O space page number 2 e All other page numbers are accessed as data space e f Symbol is empty then DSPAddress is used as the byte address for the transfer and MemSpace is used as the memory space e Note that DSPAddress may be required to be aligned to the proper width depending on the specific platform e The value of Offset is added to DSPAddress This functionality is useful to access individual members of structures or arrays on the DSP Note that the value of Offsetis always counted in bytes Signal Ranger mk3 User s Manual 61 Soft PI 10 4 5 2 1 Notes on Transfer Atomicity When reading or writing types larger than the native type for the pla
101. ith user code running the K_Exec Level 2 command can still be invoked to force DSP execution to branch to a new address 11 10 6 3 Functional Description of the Kernel After the Power Up Kernel finishes initializing the DSP if it finds DSP code in Flash memory it loads and runs it This DSP code is normally running when the user takes control of the DSP board After the Host Download Kernel finishes initializing the DSP or after the Power Up Kernel finishes initializing the DSP and did not find DSP code in Flash memory the kernel is normally running when the user takes control of the DSP The kernel is simply a never ending loop that waits for the next access request from the PC PC access requests are triggered by the DSPInt interrupt from the HPI Signal Ranger mk3 User s Manual 80 Soft PI 11 10 6 3 1 Launching A DSP Function At levels 2 and 3 the kernel protocol defines only one type of action which is used to read and write DSP memory as well as to launch a simple function a function which includes a return to the kernel or to the previously running code or a complete program a never ending function that is not intended to return to the kernel or to the previously running code In fact a memory read or write is carried out by launching a ReadMem or WriteMem function which belongs to the kernel intrinsic function and is resident in DSP memory Launching a user function uses the same basic process but requires that t
102. kernel has not yet been loaded onto the DSP The PC relies on the hardware of the DSP HPI and DMA as well as the USB controller to exchange code and or data with DSP RAM At this level the PC has only a limited access to the DSP RAM This level is used among other things to download the kernel into DSP RAM and launch its execution Functions at this level are also useful in tough debugging situations because they do not rely on the execution of code on the DSP e Level2 Atlevel 2 the kernel is loaded and running on the DSP Through intrinsic functions of the kernel the PC can access any location in any memory space of the DSP and can launch DSP code from an entry point anywhere in memory This level is used to load user code in DSP memory and launch it Level 1 functions are still functional at level 2 but rarely used because Level 2 functions provide more access However one possible advantage of Level 1 function is that they do not rely on DSP software Therefore they always succeed even when the DSP code is crashed e Level3 Level 3 is defined when user code is loaded and running on the DSP There is no functional difference between levels 2 and 3 The level 1 and 2 functions are still available to support the exchange of data between the PC and the DSP and to redirect execution of the user DSP code The main difference is that at level 3 user functions are available too in addition to intrinsic functions of the kernel At Level 3 w
103. knowledge should be returned at the beginning of the function to signal the branch and another means of signaling completion should be considered polling a completion flag in DSP memory for instance 11 10 5 3 DSP and FPGA Boot Tables For a detailed description of the DSP and FPGA boot tables see the document Signal_Ranger_mk3_Boot_Tables paf 11 10 5 4 HPI Signaling Speed On Signal Ranger_mk3 the signaling speed of the HPI must be slow immediately after the DSP is taken out of reset This includes after a power up reset and after reception of the DSPReset vendor command This is because in these circumstances the DSP and the HPI is running at slow speed It is only after the power up or host download kernel has been loaded and has had time to adjust the CPU and HPI speed to the maximum for the DSP that the USB controller may use the fast HPI signaling This command is normally used to set the HPI speed to the maximum after the power up kernel has been detected or after the host download kernel has been downloaded Note that it may take up to 500us after the kernel has adjusted the PLL until the DSP and HPI are clocked using the fast rate Therefore the PC software should wait for at least that amount before sending the command The switch to high HPI signaling speed is automatically performed by the board initialization functions of the LabVIEW and C C interfaces 11 10 6 SR3 DSP Communication Kernel 11 10 6 1 Differences between SR2
104. l_Board vi Use this output to propagate the reference number to other Vis e DataOut Data read from Flash memory e Real DSPAddress Actual address where the transfer took place This address takes into account the effect of Offset e Error out LabVIEW instrument style error cluster Contains error number and description Signal Ranger mk3 User s Manual 54 Soft PI 9 6 2 4 SR3_Flash_Config_NoDialog This VI automatically programs a DSP file and or an FPGA file into Flash It does not require user interaction but presents its front panel to the user during the programming so that the operation can be monitored The VI presents error and or completion dialogs BoardRef DSP File In FPGA File In error in no error Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3 Base Open Next Avail Board vi e DSP File in File path of the DSP file to be programmed in Flash No file is programmed if the path is empty New in SignalRanger_mk3 File Path can point to a firmware container VI as well as an actual COFF out file e FPGA File In File path of the FPGA file to be programmed in Flash No file is programmed if the path is empty New in SignalRanger_mk3 File Path can point to a firmware container VI as well as an actual FPGA rbt file e Errorin LabVIEW instrument style error cluster Contains error n
105. lashes the LED orange e Resets the DSP e Reinitializes HPIC e Loads the Host Download kernel These operations are required to completely take control of a DSP that is executing other code or has crashed The complete operation takes 500ms 10 4 3 3 Inputs e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board Signal Ranger mk3 User s Manual 60 Soft PI 10 4 4 SR3 DLL_WriteLeds 10 4 4 1 Prototype int32_t SR3 DLL WriteLeds int32 t BoardRef uint16_t LedState 10 4 4 2 Description This Vi allows the selective activation of each element of the bi color Led Off 0 Red 1 Green 2 Orange 3 10 4 4 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3 Base Open Next Avail Board e LedState The value sets the color 0 Off 1 Red 2 Green 3 Orange 10 4 4 4 Outputs None 10 4 5 SR3 DLL _ Bulk Move Offset_U8 10 4 5 1 Prototype int32_t SR3_DLL_Bulk_Move_Offset_U8 int32_t BoardRef uinti6_t ReadWrite char Symboll uint32_t DSPAddress uint16 t MemSpace uint32_t Offset uint8_t Datal int82_t Size uint16 t Atomic 10 4 5 2 Description This function reads or writes an unlimited number of bytes to from the program data or I O space of the DSP using the kernel This transfer uses bulk pipes Th
106. lete_File_Path is empty a dialog is presented 10 4 9 4 Outputs e EntryPoint Entry point of the code EntryPoint is found in the COFF file 10 4 10 SR3_DLL_K_Exec 10 4 10 1 Prototype int32_t SR3_DLL_K_Exec int32_t BoardRef char Symbolf uint32_t DSPAddress 10 4 10 2 Description This function forces execution of the DSP code to branch to a specified address passed in argument If Symbol is not empty the function searches in the symbol table for the address corresponding to the symbolic label If the symbol is not found an error is generated If Symbol is an empty string the value passed in DSPAdaress is used as the entry point After completing the branch to the entry point the function waits for an acknowledge from the DSP to resume its execution If this signal does not occur the function will hang indefinitely Normally the DSP code that is launched by this function should acknowledge the branch by asserting the HINT signal see section about the DSP Communication Kernel 10 4 10 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board e Symbol Character string of the symbol to be accessed If Symbol is empty DSPAddress is used e DSPAddress Entry point of the function to be executed DSPAddress is only used if Symbol is empty 10 4 10 4 Outputs None 10 4 11 SR3 _ DLL Load UserSymbols 10 4 11
107. lows them to be bound to the new x86 x64 driver These boards are designated Signa Ranger_mk2_Next_Generation or SR2_NG e The new SignalRanger_mk3 boards designated SR3 Since it manages both architectures some of its features may not apply to the target board For instance the concept of Program Data and IO spaces does not apply to the SignalRanger_mk3 architecture The corresponding parameters are simply ignored Also only the SignalRanger_mk3 Pro board has an FPGA 9 2 Product Development Support The LabVIEW interface is designed to support the designer through the development and deployment of products A product usually includes a hardware device based on one of the boards in the SignalRanger series as well as a product specific host application designed to manage and support the hardware Any product specific application must be aware of the particular hardware product it is accessing including its exact hardware characteristics firmware and other details Failure to recognize the specific firmware revision for instance may lead to an inconsistency between functions at the host application level and functions at the DSP level Also because different OEMs use the SignalRanger series as the hardware basis of different products a situation arises where the same target board may represent a number of different products in the field These different products can possibly be simultaneously connected to the same PC and managed by different p
108. mory space directly accessible from the HPI and the accesses are limited to 32 bit words Redirection of DSP execution is limited to the boot load of code at a fixed address immediately after reset The kernel allows Reads and Writes to from any location in the system s memory map and allows redirection of execution at any time from any location even in a re entrant manner Actually two kernels may be used at different times in the life of a DSP application e Immediately after power up the USB controller loads a Power Up Kernel in DSP memory and executes it The USB controller performs this function on its own whether a host PC is connected to the board or not The kernel being functional is indicated by the LED turning orange After this the READ_DSPState Vendor command will return a KPresent value of 1 see Vendor Commands above Note the host should only invoke kernel commands after the KPresent variable reaches a non zero value Signal Ranger mk3 User s Manual 78 Soft PI This Power Up Kernel performs the following functions e It checks in Flash memory if an FPGA descriptor file is present and if it is loads the FPGA with the corresponding logic e It then checks in Flash memory if an executable DSP file is present and if it is it loads and executes it e It stays resident to respond to kernel commands from the host K_Read K_Write and K_Exec see below once the board has been connected to a PC e
109. n of the DDCI interface requires no DSP code addition or adaptation and only requires minimal CPU time or memory overhead e The physical USB interface can be connected and disconnected in operation without any disruption of the DSP code running on the SignalRanger platform The main result of using the interface is to condense the two stages of the application life cycle into a single shorter step In effect the application is generally deployed as is right after the debugging phase Signal Ranger mk3 User s Manual 9 Soft PI Another strong advantage of using the interface is that it provides with very little effort much greater real time visibility into the operation of the embedded code This greater visibility during development directly translates into more reliable embedded code In many applications where it is necessary to run simulations of the signal processing algorithm to validate its operation the real time instrumentation provided by the DDCI interface makes it possible to analyze the high level behaviour of the signal processing code with ease and with real life conditions and data Often the simulation step can be bypassed completely with better results based on real data When using the LabVIEW interface as opposed to the C C interface a third advantage of the interface is that the extensive LabVIEW libraries are available to add powerful real time signal processing analysis and display capabili
110. nalog I O processing code 12 2 2 Used Resources The CODEC driver uses the following hardware resources Neither of these resources should be used for another purpose in the user code e The McBSP0 is used by the driver e EDMA channels 2 and 3 are used by the driver The configuration parameters PaRAM for the EDMA channels 2 3 66 67 68 and 69 are used by the driver e The EDMA region 0 interrupt is used by the driver and linked to the DSP INT5 interrupt vector Note If the EDMA global interrupt is used by the user code the interrupt pending register EDMA_IPR must be checked to avoid servicing an interrupt triggered by the EDMA channel 2 or 3 e Care must be taken when using another DMA at higher or equal priority than the channels used by the driver Other DMAs should use a priority strictly lower than 0 Otherwise the competing DMAs can slow down the DMAs used by the driver enough that it will loose samples The GPIO_1 is used to manage the reset of the CODEC The DSP 12C port is used to configure the CODEC The driver uses 3040 bytes of code and 225 bytes of data The DSP CLKOUTO output and the oscillator divider PLL1_OSCDIV1 are used to generate the master clock of the McBSPO and CODEC Signal Ranger mk3 User s Manual 90 Soft PI Care must be taken when using another DMA at higher or equal priority than the channels used by the driver Other DMAs should use a priority strictly lower than 0 Otherwise
111. ng to the rbt file describing the FPGA logic A dialog box is presented if the path is empty New in SignalRanger_mk3 The FPGA file can be contained in a firmware container VI as well as an actual rbt file e Progress This is a refnum on the progress bar that is updated by the VI This way a progress bar may be displayed on the front panel of the calling VI e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e New file path This is the file path where the rbt file or container VI describing the FPGA logic was found e Tools Version ASCII chain indicating the version of the tools that were used to generate the bt file e Design Name ASCII chain indicating the name of the logic design e Architecture ASCII chain indicating the type of device targeted by the rbt file e Device ASCII chain indicating the device number targeted by the rbt file e Build Date ASCII chain indicating the build date for the rbt file e Error out LabVIEW instrument style error cluster Contains error number and description 10 USB C C Interface The C C interface is provided in the form of a DLL named SRm3 HL dil This
112. nnected at any time to read write DSP memory without interrupting the already executing DSP code This behaviour provides real time visibility into and control of the already executing embedded DSP code The flexibility offered by these boot modes support the following modes of operation 3 SignalRanger_mk3 can be used in applications where it is always connected to a PC Such configurations include signal analysis and signal processing applications where the PC is used for display control SignalRanger_mk3 can be used in applications where it is working in a stand alone configuration Such applications include embedded control applications where the board provides a dedicated control loop between inputs and outputs SignalRanger_mk3 can be used in applications where it is working in a stand alone configuration but may be connected to a PC for advanced features or features that include display control Such applications include data logging applications where the board performs the data logging autonomously but can be connected to a PC to download the data or configure the data logging In such applications the real time DSP algorithm does not need to be interrupted to support the connection to the PC This connection can be seamless Technical Data 3 1 Power Supply SignalRanger_mk3 is Self Powered using an external 5V 5 power pack It can work without any connection to a PC Typical power consumption is between 400 mA and 600 mA d
113. nsfer address and in the case of a Write transfer it contains the data bytes to be written to the DSP Execution of such a command is done in 3 steps 11 10 6 3 1 1 Step 1 e The PC sends a Setup Packetto the DSP board This setup packet contains information that defines the command Signal Ranger mk3 User s Manual 81 Soft PI Byte Nb Data BranchAddress byte 2 BranchAddress byte 3 MSB BranchAddress byte 0 LSB BranchAddress byte 1 TransferAddress byte 2 TransferAddress byte 3 MSB TransferAddress byte 0 LSB TransferAddress byte 1 NbBytes LSB NbBytes MSB ControlCode LSB ControlCode MSB 0 ON OO BIO Ni Note The ControlCode only needs to include the command in bits 0 and 1 at this stage The on board USB controller adds the block size which is connection dependent e The USB controller receives the Setup Packet and writes the relevant information to the header area of the mailbox This header consists of e BranchAddress e TransferAddress e NbBytes e ControlCode Note The USB controller adds the block size to the ControlCode sent by the PC e Inthe case of a K_Write the USB Controller writes the bytes received in the current USB packet into the Data field of the mailbox e Then the USB controller clears the HINT host interrupt signal which serves as the DSP function acknowledge e The USB controller then sends a DSPint interrupt to the DSP which in turn forces the DSP
114. ntrol sets the number of samples that are sent to the output and synchronously recorded from the input 5 6 1 6 Amplitude Control The Amplitude control adjusts the amplitude of the output waveform The output samples are calculated according to the selected amplitude as well as the selected output gain PGA 5 6 1 7 Frequency Control The Frequency control is only used for periodic waveforms It adjusts the fundamental frequency of the waveform 5 6 1 8 Input Codec Control The Input Codec control selects the input channel between 0 and 6 5 6 1 9 Output Codec Control The Output Codec selects the output channel between 0 and 6 5 6 1 10 Offset Compensation Control The Offset Compensation button performs an offset compensation This procedure reads a block of input samples from the selected input while sending zero samples The average of the recorded samples is then subtracted from the input samples Therefore if any offset is present on the selected input it is brought to zero The average is displayed in the Offset 132 indicator This indicator is scaled in bits The offset compensation is software 5 6 1 11 Offset 132 Control The Offset 132 indicator can also act as a control Simply changing the content of this field imposes a new software offset to the recorded input samples 5 6 2 Sxx Tab 5 6 2 1 Spectrum Indicator The Spectrum indicator presents the instantaneous or averaged power spectrum of the input sampled block
115. o be accessed If Symbol is empty DSPAddress and MemSpace are used e DSPAddress Physical base DSP address for the exchange DSPAddress is only used if Symbol is empty e MemSpace Memory space for the exchange data program or IO MemSpace is only used if Symbol is empty e Offset Represents the offset of the data to be accessed from the base address indicated by Symbol or DSPAddress The actual access address is calculated as the sum of the base address and the offset Offsetis useful to access individual members of a structure or an array e Data Array of bytes to be written to or read from DSP memory e Size Represents the number of bytes to transfer For a read or a write the Data array allocated must be larger or equal to Size e Atomic 1 gt Atomic transfer 0 gt non atomic transfer Signal Ranger mk3 User s Manual 62 Soft PI 10 4 5 4 Outputs e Data Array of bytes written to or read from DSP memory The Data array passed in argument to the function must be larger or equal to Size 10 4 6 SR3_DLL_User Move_Offset_U8 10 4 6 1 Prototype int32_t SR3 DLL User Move Offset_U8 int32 t BoardRef uinti6 t ReadWrite char Symbolf uint32_t DSPAddress uint32 t Offset char BranchLabell uint32_t BranchAddress uint8_t Dataf int32_t Size 10 4 6 2 Description This function is similar to SR3_Base_Bulk_Move_Offset except that it allows a user defined DSP function to replace the intrinsic kern
116. o error gl Bror Message empty ji out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi e Type of Dialog Selects one of 3 standard behaviours for error management e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running VI Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error Code Provides the Error Code e Error Message Provides a text explanation of the error if one exists e Status Boolean indicates if there is an error True or not False Signal Ranger mk3 User s Manual 51 Soft PI e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 2 Flash Support VIs These Vis are provided to support Flash programming operations The Vis equally support Flash reading operations and Flash programming operations for symmetry However reading the Flash does not require the presence of any DSP support code and can be carried out by SR3_Base_Bulk_Move_Offset Note The Vis in this library require a special DSP support firmware to be loaded in RAM and running This is norm
117. o the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 1 11 SR3 Base Read Error Count The hardware of the USB controller contains an error counter This 4 bit circular counter is incremented each time the controller detects a USB error because of noise or other reason The contents of this counter may be read periodically to monitor the health of the USB connection Note that a USB error usually does not lead to a failed transaction The USB protocol will retry packets that contain errors up to three times in any single transaction before failing the transaction BoardRef Error dupBoardRef m9 Error_Count error in no error al error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board vi e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error Count This
118. o transfer in this segment alone not the total number of words to transfer for the whole USB request This is different from the SR3 case e The TransferAdaress field may need to be incremented depending on how the function uses this information Typically K_Read and K_Write kernel functions increment TransferAddress so that the next segment is transferred to from the subsequent memory address However some user functions may use this field in a different way For instance it may be used as an arbitrary FIFO buffer number in some implementations For K_Read and K_Write TransferAddress represents a number of bytes e After the execution of the requested function the DSP asserts the HINT signal to signal the USB controller that the operation has completed This operation has been conveniently defined in a macro Acknowledge in the example codes and can be inserted at the end of any user function Note that from the PC s point of view the command seems to hang until the Acknowledge is issued by the DSP User code should not take too long before issuing the Acknowledge 9 6 1 6 2 SR3 Platform e Ifa transfer is involved the function must read the ControlCode mailbox address 0x10F0400A mask the two lower bits that represent the type of operation The result called USBTransferSize represents the maximum number of bytes that must be transferred in this segment Note that the contents of the ControlCode field of the mailbox must not be modified
119. oaded directly from the PC and executed using the SR3_K_Exec vi interface VI or using the Exec button of the mini debugger Therefore DSP code that has been developed and tested using the mini debugger or code that is usually downloaded and executed from the PC should normally be ready to be programmed into the boot table as is To allow the DSP code programmed into Flash to boot properly its entry point must be properly defined in the link This is not an absolute requirement for code that is loaded from the PC Indeed Code loaded from the PC may be launched from any existing label or even an arbitrary address using either the mini debugger or the LabVIEW or C C interfaces However the boot loader that executes from the kernel only launches code from the defined entry point If none is defined the DSP code will most likely crash at power up 11 10 Under the Hood This section provides detailed information on the operation of the USB controller and the communication kernel It is intended for the rare developers who need to go down to this level of detail or those who would like to better understand the operation of the system A good understanding of this section is required for the developers who want to implement SR3_Base_User_Move_Offset functions 11 10 1 Startup Process At power up the startup process performs the following operations e The USB controller powers up It loads the Power Up_Kernelin DSP memory and starts it
120. on This function loads a user DSP code into DSP memory and runs it from the address of the entry point found in the COFF file If Complete_File_Path and File Name are empty a dialog box is used The DSP is reset prior to beginning the load After loading the code the symbol table is updated in the Global Board Information Structure The function checks if the type of COFF file is right for the target DSP If not an error is generated After completing the branch to the entry point the function waits for an acknowledge from the DSP to resume its execution If this signal does not occur the function will hang Normally the DSP code that is launched by this function should acknowledge the branch by asserting the H NT signal see section about the DSP Communication Kernel 10 4 8 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3 Base Open Next Avail_ Board e Complete File Path This string represents the file path leading to the COFF out file of the DSP user code A dialog box is presented if both Complete File_ Path and Firmware _File are empty e File Name This is the file name of the firmware file If Firmware_File is not empty the function resolves the path using the standard rules for firmware locations If Firmware_Files is empty the VI looks at the Complete_File_Path argument If Complete_File_Path is empty a dialog is presented
121. ore Clock SYSCLK1 1 24 576 MHz e SYSCLK2 3 8 192 MHz Signal Ranger mk3 User s Manual 22 Soft PI e SYSCLK3 6 4 096 MHz However the above configuration is short lived Just after reset the kernel is loaded automatically into DSP memory and executed The kernel configures the clock generator as follows e CPU Core Clock SYSCLK1 1 589 824 MHz e SYSCLK2 3 196 608 MHz e SYSCLK3 6 98 304 MHz 6 5 Peripheral Interfaces 6 5 1 Flash ROM 6 5 1 1 Memory Map The 32 MByte Flash ROM is mapped on chip select 2 CS2 at addresses 42000000 to 43FFFFFFy 6 5 1 2 Sectors The Flash ROM device is divided into 256 equal length sectors of 128 KB each 6 5 1 3 Incremental Programming Incremental programming programming the same address multiple times is allowed Each programming operation can only reset individual bits from 1 to 0 Setting bits from O to 1 can only be done by an erasure cycle on a whole sector However the programming operations can reset individual bits at any time without intervening erasure 6 5 1 4 Bus Interface The Flash ROM to DSP interface is 16 bit wide 6 5 1 5 Access Speed e 8or 16 bit read 132 2 ns e 32 bit read 264 5 ns takes 2 cycles 6 5 1 6 EMIF Configuration The following table describes the contents of the A1CR register which sets the parameters for Flash accesses Bit Field Function Setting 0 normal mode 1 16 bit Table 5 EMIF configuration
122. orm a manual driver installation follow these steps Signal Ranger mk3 User s Manual 12 Soft PI e _ Power up the board and connect it to the PC e Open the device manager for instance from the Control Panel menu e There should be a device in the tree either marked Unknown Device or SignalRanger_mk3 with an exclamation point beside it e Right click on the device s icon and select Properties e In the properties page press on Update Driver e Indicate that you want to select the driver manually and browse to the C Program Files SR3_Applications Drivers SRm3cd directory 5 4 LED Indicator The LED of the SignalRanger_mk3 board has the following behaviour e __ It lights up red when the 5V power first applied to the board This indicates that the board is properly powered e __ It turns orange on its own 1 2s after power up This indicates that the board went through its proper reset and initialization sequence If DSP code was present in Flash this code has started when the LED is orange e It turns green whenever the board is connected to the PC through its USB port and the PC has taken control of it The LED must be green before any PC application can communicate with the board e The LED turns back to orange whenever the USB connection is interrupted This is the case when the PC is turned off or goes into standby or if the USB cable is disconnected The LED turning orange does not mean that the DSP co
123. oth LSB and MSB bytes must be identical windex N A Signal Ranger mk3 User s Manual 77 Soft PI qe er EE wLength N A Set_HPI_ Speed Sets the HPI speed to slow or fast Note The HPI speed is automatically set to slow at power up and whenever the DSP is reset via the DSPReset command Use this command to set the HPI to fast after either event wValue 1 Fast 0 Slow windex N A wLength NA Move_DSPState In Out Reads or writes the state of the DSP wValue N A windex N A wLength N A DataBlock 2 bytes representing the state of the DSP bKpresent byte Kernel not Loaded gt 0 Power Up Kernel Loaded gt 1 Host Download Kernel Loaded gt 2 The Kpresent variable is O at power up It takes a few seconds after power up for the USB controller to load and launch the kernel The host should poll this variable after opening the driver and defer kernel accesses until after the kernel is loaded bKstate byte Kernel_ Idle gt 0 R_ErrCount In 224 Returns the USB error count wValue N A windex N A wLength N A DataBlock 1 word is transported in the data block This word represents the present USB error count between 0 and 15 Reset_ErrCount Resets the USB Error Count register to zero Table 6 Vendor Requests 11 10 5 2 Communications Via the DSP Kernel The communication kernel enhances communications with the PC Memory exchanges without the kernel are limited to the me
124. pen the products and revision numbers provided in the list Practically the SR3_Base_Open_Next_Avail_Board vi briefly opens the target reads the file names from Flash and closes the target back if the file names are not part of the provided list 9 5 2 Execution Sequencing Two Vis of the LabVIEW interface that access the same SignalRanger mk3 DSP board cannot execute concurrently The first VI must complete before the second one can be called Because LabVIEW will execute in parallel sections of code that do not depend on each other care should be taken to ensure that Vis accessing the board cannot run at the same time The VIs that access the board are the ones that have a BoardRef control The simplest technique is to ensure that all such VIs are chained in the diagram using the BoardRef and dupBoardRef connectors However functions of the interface accessing different boards with different BoardRef values can be called concurrently if desired All the VIs that access the board are blocking They do not return until the requested action has been performed on the board Signal Ranger mk3 User s Manual 35 Soft PI 9 5 3 Loading and Executing Code Dynamically The interface libraries provide functions to load DSP code and FPGA logic dynamically This is useful for applications in which the hardware is multi function In this case the host application re configures the hardware platform in an application specific m
125. plication running on a PC to communicate with and control an embedded device based on the SignalRanger platform Contrary to traditional debugging and emulation techniques the DDCI interface does not rely on an emulator pod or the Code Composer Studio development environment to communicate with the SignalRanger_mk3 board Instead it relies on the existing USB connection and deployable software libraries Because of this the developer works in the same conditions during development and after application deployment The interface in effect provides real time visibility and control into the code running in the embedded device Its usefulness is at two stages in the application life cycle e During development it is used to provide real time debugging at an application level that is usually not achievable using standard debugging and emulation techniques In particular reading writing and code control functions do not require CPU halt The interface allows the code to be instrumented in real time and in the real operating conditions e After application deployment where the same interface is used to support user control and communications with the embedded device via an application specific PC application developed for that purpose Three essential features of the DDC interface are e The same physical USB interface and host libraries and functions are used to support the interface at both stages of the application life cycle e The operatio
126. presentation e Xor1 X specifies if the data is to be multiplied or divided by the scaling factor Signal Ranger mk3 User s Manual 29 Soft PI b Signal_Ranger_mk3 lvlib SR3_MD_Data_Presentation vi Text Graph Address Data 10800000 108000 10 10800020 10800030 10800040 10800050 10800060 10800070 10F00000 10F000 10 10F00020 10F00030 10F00040 10F00050 10F00060 10F00070 Figure 10 Data presentation Text mode p Signal_Ranger_mk3 Ivlib SR3_MD_Data_Presentation vi Nt ine i N nani i iit Figure 11 Data presentation Graph mode The user can choose between Text mode Figure 10 and Graph mode Figure 11 for the presentation of memory data In Text mode each requested memory block is presented in Signal Ranger mk3 User s Manual 30 Soft PI sequence The addresses are indicated in the first column In Graph mode each memory block is scaled and represented by a separate line of a graph e W Mem Allows the memory contents to be read and modified The function first reads the memory using the View_parameters and presents a Text panel similar to the one presented for the R_mem function The user can then modify any value in the panel and press the Write button to write the data back to memory Several points should be observed e Even though data entr
127. processing and digital I O capabilities with the ease of use high level processing power and graphical user interface of LabVIEW 9 6 1 Core Interface Vis 9 6 1 1 SR3 Base Open Next Avail_ Board This Vi performs the following operations e Tries to find a free DSP board with the selected VID PID and optionally that has the firmware indicated in the Restrict control e If it finds one creates an entry in the Global Board Information Structure e Waits for the Power Up kernel to be loaded on the board e Ifa DSP firmware is detected in Flash code has been loaded and started as part of the power up sequence loads the corresponding file name and symbol table from Flash e f ForceReset is true forces DSP reset then reloads the Host Download kernel In this case all code present in Flash and executed at power up is aborted and the corresponding symbol table found in Flash is not loaded e Places the symbol table of the present kernel in the Global Board Information Structure Restrict eee BoardRef VID PID penne A be Firmware _ ForceReset T Reset ion Latest_Revisi error in no error error out Controls e Restrict This is a structure used to restrict the access by firmware names If this control is not empty the access is restricted to the boards having a pair of DSP and FPGA file names in the list provided Each element of the array is a pair of file names The firmware in Flash must match both names in an element of
128. r s Manual 91 Soft PI This 2 element 8 bit vector is used to pass parameters to the functions User_l2C_ReadReg and User_I2C_WriteReg functions Both functions can be called by the PC or the DSP user code to read or to write the CODEC registers See below for more details about these functions and the way the i2c_data vector is used when calling these functions void startAIC This function configures the CODEC and starts the CODEC conversion process It has no arguments It uses the register configuration values found in the configuration variables and configures the CODEC accordingly These values must be initialized prior to calling startAIC They set CODEC parameters such as sampling frequency input and output gain etc After the execution of this function the user defined processing function dataprocess starts being triggered at each sampling period The LabVIEW CODEC interface library includes a VI to generate the register contents automatically void stopAIC This function stops the CODEC conversion process After the execution of this function the user defined dataprocess function stops being triggered and the CODEC continuously outputs the last sample values void User_I2C_ReadReg This function initiates a read sequence of one byte at the CODEC control port Before calling the User_I2C_ReadReg function the PC or DSP code must initialize 2c_data 0 with the register number to read The User_l2C_ReadReg
129. r Count 10 4 12 1 Prototype int32 t SR3 DLL Read Error Count int32_t BoardRef uint8_t Error Count 10 4 12 2 Description The hardware of the USB controller contains an error counter This 4 bit circular counter is incremented each time the controller detects a USB error because of noise or other reason The contents of this counter may be read periodically to monitor the health of the USB connection Note that a USB error usually does not lead to a failed transaction The USB protocol will retry packets that contain errors up to three times in any single transaction before failing the transaction 10 4 12 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board 10 4 12 4 Outputs e Error Count This is the value contained in the counter between 0 and 15 10 4 13 SR3_DLL_Clear_Error_Count 10 4 13 1 Prototype int32_t SR3_DLL_Clear_Error_Count int32_t BoardRef 10 4 13 2 Description This function is provided to clear the 4 bit USB error counter 10 4 13 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board 10 4 13 4 Outputs None Signal Ranger mk3 User s Manual 68 Soft PI 10 4 14 SR3 DLL Flash _InitFlash 10 4 14 1 Prototype int32_t SR3_ DLL Flash _InitFlash
130. ransport information other than a real transfer address the following restrictions apply e The total size of the transfer must be smaller or equal to 32768 words This is because transfers are segmented into 32768 word transfers at a higher level The information in TransferAddress is Signal Ranger mk3 User s Manual 45 Soft PI only preserved during the first of these higher level segments At the next one TransferAddress is updated as if it were an address to point to the next block e The transfer must not cross a 64 kWord boundary Transfers that cross a 64 KWord boundary are split into two consecutive transfers The information in TransferAddress is only preserved during the first of these higher level segments At the next one TransferAddress is updated as if it were an address to point to the next block e TransferAddress must be even It is considered to be a byte transfer address consequently its bit 0 is masked at high level error in no error Size 0 R w F gt W BranchAddress Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure t is created by SR3 Base Open Next Avail Board vi e Datain Data words to be written to DSP memory Dataln must be wired even for a read to specify the data type to be transferred e DSPAddress Physical base DSP address for the exchange DSPAddress is only used if Symbol is empty or l
131. rds to transfer is not a multiple of 32 256 the last segment contains the remainder The user defined function should be created to operate the same way as the kernel read and write functions That is it should perform the same transfers mailbox housekeeping and handshaking as the kernel functions do 10 4 6 2 1 SR2_NG Platform e If a transfer is involved the function transfers the required words to or from the Data area of the mailbox The number of words to transfer is the value of the NbWords field of the mailbox In SR2_NG this field represents the number of words to transfer in this segment alone not the total number of words to transfer for the whole USB request This is different from the SR3 case e The TransferAdadress field may need to be incremented depending on how the DSP function uses this information Typically K_Read and K_Write kernel functions increment TransferAddress so that the next segment is transferred to from the subsequent memory addresses However some user functions may use this field in a different way For instance it may be used as an arbitrary FIFO buffer number in some implementations For K_Read and K_Write TransferAddress represents a number of bytes e After the execution of the requested function the DSP asserts the HINT signal to signal the USB controller that the operation has completed This operation has been conveniently defined in a macro Acknowledge in the example codes and can be inserted at the
132. reserved The content of INTC_INTMUX1 must be of the form xxxxxx2Fh e If no interrupts other than the interrupt used by the kernel is used in the project it would normally not be required to provide a vectors section However we suggest to include an simple empty vector see below to make sure the Run Time Support RTS will not include its own vectors section that may not be compatible with the kernel This simple vector section must be linked at address 0x10E080C0 sect vectors nocmp _SimpleISR B IRP NOP NOP NOP NOP NOP NOP NOP end 11 7 Link Requirements 11 7 1 Memory Description File The CMD _SRS3 cmd linker description command file can be used as a starting point This file describes the memory map of the Signal Ranger_mk3 board It includes the address ranges that are reserved and should not be modified This file is part of the SR3_SignalTracker DSP code example 11 7 2 Stack Avoidance The kernel initializes the stack at address 0x10F17FF8 in L1DRAM and uses 128 bytes If initialized data is defined within this zone it will corrupt the stack during the load process The load will not be able to complete properly To avoid this situation make sure that the linker command file does not define any initialized data between addresses 0x10F17F78 and 0x10F17FF8 11 8 Global Symbols Only the global symbols found in the DSP executable file are retained in the symbol table This means that to allow symbolic access to th
133. riting scalars Size must be left unwired The Flashs internal representation is 16 bit words When reading or writing 8 bit data the bytes represent the high and low parts of 16 bit memory registers They are presented MSB first and LSB next BoardRef dupBoardRef Dataln DataOut DSPAddress Real DSPAddress error in no error error out Size 0 i R W F gt W orn Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avail_Board vi e Datain Data words to be written to Flash memory Dataln must be wired even for a read to specify the data type to be transferred e DSPAddress Physical base DSP address for the transfer e Size Only used for reads of array types represents the size in number of items of the requested data type of the array to be read from DSP memory For Writes the whole contents of Dataln are written to DSP memory regardless of Size When Size is wired the data can only be transferred as arrays not scalars e 6R W Boolean indicating the direction of transfer true gt read false gt write e Error in LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure ft is created by SR3_Base_Open_Next_Avai
134. roduct specific applications designed by different OEMs To the host application knowledge of the target and its parameters is based on the following information embedded in the target board e A USB VID PID pair This VID PID pair is present at the level of the USB protocol It is used to open the target board Therefore the information it carries is implicit Only boards with the correct VID PID pair can be opened by the host application This information defines the particular type of board being opened and implicitly its hardware characteristics This VID PID pair cannot be modified by the developer Every board of a given model in the SignalRanger series has the same VID PID pair that is decided when the board is designed A database included in the LabVIEW interface contains information for all the standard and custom boards that have been designed New information is added to this database on an ongoing basis as new boards are designed If a particular board is not recognized by the LabVIEW interface it is usually because the revision number of the LabVIEW interface is too low to support this particular board model Signal Ranger mk3 User s Manual 33 Soft PI e DSP firmware and FPGA file names When the firmware DSP code and FPGA logic is stored in Flash the exact names of the corresponding files are written as well This information narrows down the target to a specific product and optionally a revision number if s
135. rom within user DSP code e DAQ Driver Datalogger A powerful DAQ Driver Datalogger application is provided This application is not part of the installation package It can be downloaded from http www softdb com 5 Installation and Tests Note Do not connect the SignalRanger_mk3 board into the USB port of the PC until the software has been installed on the PC The driver installation process which occurs as soon as the board is connected to the PC requires that the driver files be present and accessible on the disk 5 1 Software Installation There are two different developer packages that provide similar functions in different formats e SR3_DDCI_Library_Disiribution zip The LabVIEW developer package includes all the LabVIEW libraries and all the test and utility applications in VI forms This is the preferred package for a LabVIEW developer because it provides access to the LabVIEW code of the demo and utility applications e SR3_Applications_Insitaller exe The C C developer package includes the libraries in DLL format and the test and utility applications in Windows executable exe form 5 1 1 LabVIEW Developer s Package SR3 DDCI Library Distribution zip The LabVIEW package is contained in a single zip file named SR3 DDC Library Distribution e Unzip the file in the directory of your choice e Go into the Drivers folder and run SRm3_Driver_Install exe e Follow the on screen instructions The contents of the package ar
136. rray of U8 and cast it back to the required type for a read An attempt to write outside of the Flash memory will result in failure The writing process can change ones into zeros but not change zeros back into ones If a write operation is attempted that should result in a zero turning back into a one then it results in failure Normally an erasure should be performed prior to the write so that all the bits of the selected write zone are turned back into ones Note Contrary to the SignalRanger_mk2_NG generation incremental programming programming the same address multiple times is permitted on SignalRanger_mk3 Each programming operation cannot set individual bits from 0 to 1 This can only be done by an erasure cycle on a whole sector However the programming operations can reset individual bits from 1 to O at any time without intervening erasure The Flash s internal representation is 16 bit words In case of a write of an odd number of bytes an additional byte is appended to complete the write to the next 16 bit boundary The appended byte is set to FFy 10 4 16 3 Inputs e BoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board e ReadWrite 1 gt Read 0 gt Write e Symbol Character string of the symbol to be accessed If Symbol is empty DSPAddress and MemSpace are used e DSPAddress Physical base DSP
137. s execution e The Power Up_Kernel then performs the following operations e Both CFG_PINMUX0 and CFG_PINMUX01 registers are set to obtain the following hardware pin selection HPI EMAC mode RMI EMIFA 16 bits in CS2 CS3 UARTO and UART1 without hardware control flow McBSP0 and McBSP1 with full ciks PWMO PWM1 and ClockOutO e Initialize the Power Sleep Controller PSC to enable all modules e Initialize the INTC_INTMUX1 register to link event 47 HPI interrupt with interrupt INT4 e initialize the interrupt vector and the ER register for interrupt INT4 e initialize PLL1 to obtain a clock of 589 824 MHz and initialize the dividers at 1 3 and 6 e Configure the EDMA channel 63 used for the kernel reads and writes The kernel uses the PaRAM63 and 127 structures Both the event and interrupt are used for the channel 63 e Configure the EMIFA to manage the flash in the CS2 memory section The main clock for the flash is 98 304 MHz e Initialize the stack pointer B15 register at address 0x10F17FF8 first 8 byte aligned address at the end of the L1DRAM Signal Ranger mk3 User s Manual 74 Soft PI e Initialize the data pointer B74 register at address 0x10F04000 the beginning of the L1DRAM e Initialize the STP vector table pointer at 0x10E08000 beginning of the L1PRAM e Start the TSC counter This 64 bit counter runs at the CPU speed 589 824 MHz and can be used to time DSP code See t
138. sfer even if the DSP has crashed making it a good debugging tool Transfers with the HPI use the control pipe O instead of the fast bulk pipes used by SR3_Base_Bulk_Move_Offset The bandwidth for such transfers is typically low 500kb s However it is guaranteed Symbol Offset 0 BoardRef dupBoardRef Dataln DataOut MemSpace Real DSPAddress DSPAddress error out error in no error Size 0 i Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi e Datain Data words to be written to DSP memory Dataln must be wired even for a read to specify the data type to be transferred e MemSpace Memory space for the exchange data program or IO MemSpace is not used in this VI It is provided for compatibility with the SR3_Bulk_Move_Offset vi This way those two Vis are interchangeable e DSPAddress Physical base DSP address for the exchange DSPAddress is only used if Symbol is empty or left unwired e Size Only used for reads of array types represents the size in number of items of the requested data type of the array to be read from DSP memory For Writes the whole contents of Dataln are written to DSP memory regardless of Size When Size is wired the data can only be transferred as arrays not scalars e Symbol Character string of the symbol to be accessed If Symbol is empty or unwired DSP
139. st have the exact name that appears in the Flash of the target 9 5 5 Building a LabVIEW Executable The following items must be included in the build of an application specific executable e f firmware container Vis are used to hold the various DSP code and FPGA files these must be explicitly included in the build They must be included in the Always ncluded field of the Source Files section The VIs are not automatically included in the build because they are dynamically loaded by the LabVIEW interface VIs The firmware container Vis must be rebuilt or new ones created with the latest firmware whenever a new firmware is in effect in Flash This step must be completed before the executable application is rebuilt e f standard out or rbt files are used no special step is required 9 5 6 Creating an Installer The following items must be included in the build of an application specific executable e When the DSP code and FPGA files are stored as standard out and rbt files these files must be included in the application installer specification and be installed in the same directory as the executable application This location in effect corresponds to one level above the top level VI that constitutes the application Whenever the installer is rebuilt it automatically reloads the latest firmware files if those have changed since the last rebuild e When using container VIs to hold the DSP code and FPGA logic the VIs are already p
140. t VI dupBoardRef DataOut Real DSPAddress error out error in no error Size 0 i R W F gt W ore Signal Ranger mk3 User s Manual 43 Soft PI Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi e Datain Data words to be written to DSP memory Dataln must be wired even for a read to specify the data type to be transferred e MemSpace Memory space for the exchange data program or IO MemSpace is only used if Symbol is empty or left unwired DSPAddress Physical base DSP address for the exchange DSPAddress is only used if Symbol is empty or left unwired Size Only used for reads of array types represents the size in number of items of the requested data type of the array to be read from DSP memory For Writes the whole contents of Dataln are written to DSP memory regardless of Size When Size is wired the data can only be transferred as arrays not scalars Symbol Character string of the symbol to be accessed If Symbol is empty or unwired DSPAddress and MemSpace are used Offset Represents the offset of the data to be accessed from the base address indicated by Symbol or DSPAddress The actual access address is calculated as the sum of the base address and the offset Offset is useful to access individual members of a structure or an array R W
141. ta array passed in argument to the function must be larger or equal to Size 10 4 7 SR3_DLL_HPI_Move_Offset_U8 10 4 7 1 Prototype int32_t SR3_DLL_HPI_Move_Offset_U8 int32_t BoardRef uinti6 t ReadWrite char Symboll uint32_t DSPAddress uint16_t MemSpace uint32_t Offset uint8_t Datal int32_t Size 10 4 7 2 Description This function is similar to SR3_Base_Bulk_Move_Offset except that is relies on the hardware of the HPI rather than the kernel to perform the transfer This function only transfers arrays of bytes To transfer any other type the simplest method is to use a cast to allow that type to be represented as an array of U8 on the DSP side cast the required type to an array of U8 to write it to the DSP read an array of U8 and cast it back to the required type for a read Transfers are limited to the RAM locations that are directly accessible via the HPI The MemSpace control is not used This VI will perform transfers into and out of the data and program space This VI will transfer to any address accessible via the HPI regardless of memory space Note The kernel does not need to be loaded or functional for this VI to execute properly This VI will complete the transfer even if the DSP has crashed making it a good debugging tool Transfers with the HPI use the control pipe O instead of the fast bulk pipes used by SR3_Base_Bulk_Move_Offset The bandwidth for such transfers is typically low 500kb s However it
142. tate function 12 1 4 3 FB_WriteEraseError FB_WriteEraseError is a 16 bit variable that contains various error status bits It is returned by several functions including SR3FB_SetAddress SR3FB FIFOState SAR3FB_WritePrepare and SR3FB_Write Once an error bit is set to one indicating an error it stays one until the error word is cleared using SA3FB_ErrorClear function Execution of SR3FB_Init function also clears the error status register Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SE WP WE Signal Ranger mk3 User s Manual 86 Soft PI WE Write Error An error occurred during a write Either a write was attempted at an address that was not previously erased or at an address outside of the useable address range or the flash ROM is not working properly WP Write in Progress When it is one this bit indicates that writes are in progress This bit is only cleared to 0 when the write FIFO is empty and the last write operation is completed It is set to one as soon as a new word is written into the write FIFO SE Sector Erase Error This bit indicates that an error occurred during the requested sector erase operation Either an erasure was attempted at an address outside the useable address range or the Flash is not working properly Note When a write is attempted at an address th
143. tform the PC performs several separate accesses for every transferred long type In principle the potential exists for the DSP or the PC to access one word in the middle of the exchange thereby corrupting the data For instance during a read on a DSP platform where the native type is U16 the host could upload a floating point value just after the DSP has updated one 16 bit word constituting the float but before it has updated the other one Obviously the value read by the host would be completely erroneous Symmetrically during a write the host could modify both 16 bit words constituting a float in DSP memory just after the DSP has read the first one but before it has read the second one In this situation the DSP is working with an old version of one half of the float and a new version of the other half These problems can be avoided if the following facts are understood On the SignalRanger_mk2_Next_Generation platform when the PC accesses a group of values it always does so in blocks of up to 32 16 bit words at a time up to 256 words if the board has enumerated on a high speed capable USB hub or root Each of these block accesses is atomic The DSP is uninterruptible and cannot do any operation in the middle of a block of the PC transfer Therefore the DSP cannot interfere in the middle of any single 32 or 256 block access by the PC This alone does not guarantee the integrity of the transferred values because the PC can st
144. the array for the board to be accepted This control should be wired to restrict the opening to boards that have been configured as specific products and avoid opening boards used by other OEMs or other products of the same OEM e VID PID This is a structure used to select the type of board that should be used There are several hardware variations of the Signa Ranger_mk3 architecture including custom implementations Each board type in the series has its own VID PID pair Use the proper VID PID pair to open the proper board Look at the examples to find the actual V D PID pair for your board If in doubt contact Soft dB e ForceReset If true the DSP is reset and the host download kernel is loaded All previously running DSP code is aborted Use this setting to dynamically reload new DSP code in the board Use the false setting to take control of DSP code that is already running from Flash without interrupting it Signal Ranger mk3 User s Manual 39 Soft PI e Errorin LabVIEW instrument style error cluster Contains error number and description Leave it unwired if this is the first interface VI in the sequence Indicators e BoardRef This is a number pointing to the entry corresponding to the board in the in Global Board Information Structure The interface can manage a multitude of boards connected to the same PC Each one has a corresponding BoardRef number allocated to it when it is opened All other interface Vis use
145. the competing DMAs can slow down the DMAs used by the driver enough that it will loose samples 12 2 3 Restrictions When developing C or assembly code using the CODEC driver the following restrictions apply e The user defined I O processing function dataprocess must be present in the user code Dataprocess is a normal function and no register protection is required since the CODEC driver already saves the entire context By default dataprocess is not interruptible but the global interrupt enable bit GEI bit of CSR register can set to 1 to make the function interuptible When developing in assembly the symbol _dataprocess must be defined using the global directive e All C accessible symbols and labels defined in the SR3_A CDriver lib library must have a _ prefix when used in assembly language e The DSP interrupt INT5 is used by the driver to call the driver s interrupt service routine and finally dataprocess The vector for this interrupt must be properly declared and linked at the address 0x10E080A0 The _SA3AIC label for the ISR of the driver must appear explicitly in the vector for the DSP interrupt INT5 See the SignalTracker demo DSP code for an example of a correct vectors asm 12 2 4 User Accessible Variables and Functions The SR3_A lCDriver lib library defines and allocates the following user accessible variables use the file SR3_AlCDriver h to access these variables in your DSP code int Div_osc
146. the developer tests this DSP code with the help of the Mini Debugger The Mini Debugger allows the developer to download the code start it read write memory locations and peripherals while the code is executing launch the execution of specific functions etc The DDC architecture does not require special DSP code or adjustments to implement the communications required for debugging Therefore the DSP code is the same during the debugging phase as it is after deployment The deployed code can be instrumented directly and easily without any modification e As the development moves forward the developer will find it easier to develop small applications to interact with the DSP code in a specific manner and test its various functions Such applications are developed with either LabVIEW or Visual C or any development environment that supports DLL calls These applications rely on the extensive DDC communication libraries that we provide These are the same communication libraries that the Mini Debugger is based upon Because the communication libraries use symbolic information the PC side applications do not need to be adjusted when the DSP code is modified or rebuilt e Atthis level of development many DSP applications require a fine analysis of the high level behaviour of the DSP algorithm The DDCI interface allows the developer to observe the data being processed by the algorithm in real time as well as act on or adjust algorithm parameters whil
147. the interrupt are enabled for the channel 63 in the region 1 The EDMA channel 63 cannot be used by the user code Also if the EDMA global interrupt is used by the user code the interrupt pending register EDMA_ PR must be checked to avoid servicing an interrupt triggered by the EDMA channel 63 Note that the kernel does not use a DSP interrupt for the EDMA region 1 a polling technique is used So the EDMA region 1 interrupt is still available to the user but as for the EDMA global interrupt the user code must check the interrupt pending register EDMA_IPRH region 1 to avoid servicing an interrupt triggered by the EDMA channel 63 e Both CFG_PINMUX0 and CFG_PINMUX071 registers are set by the kernel and should not be changed by the user code 11 10 5 USB Communications Through its USB connection to the board the PC can read and write DSP memory and launch the execution of DSP code PC to DSP USB communications use two mechanisms e The PC uses control pipe 0 via USB Vendor Requests to perform the following operations e Reset the DSP Change the color of the LED Read or write on chip DSP memory using the HPI hardware Read or write various registers such as DSPState and USB Error Count Load the Host_Download kernel to allow the host to positively take control of the DSP board This mechanism only uses the hardware of the HPI e The PC uses high speed bulk pipes 2 out and 6 in to transfer data to and from any location in any DSP sp
148. ties both in the debugging and in the deployed application phases The functions of the interface can be exercised while the embedded code is running All these functions support symbolic access where the name of DSP variables and functions can be used to access them instead of their absolute addresses The advantage of this feature is that the embedded DSP code can be modified and relinked without having to update the associated user access application running on a PC As long as the variable and function names remain the same the access will stay operational across DSP code updates The following real time functions are supported directly by the interface RAM read and write Flash read and write Peripheral read and write Force code execution CPU reset In service firmware upgrade management Automatic target device detection and management The interface is composed of several parts e Signed Driver for e Windows XP x86 platform e Windows Vista x86 and x64 platforms e Windows 7 x86 and x64 platforms e Linux e Mac OS Note Support for Linux and Mac OS requires the use of LabVIEW for the corresponding platforms e Communication Kernel This kernel resides in DSP memory along with the user s application specific code It enhances PC to DSP communication e LabVIEW Libraries These libraries support wide ranging communication programming and control functions with the resident kernel They can be used to build an appli
149. tput Return The current FB_WriteEraseError Signal Ranger mk3 User s Manual 87 Soft PI 12 1 5 3 unsigned short SR3FB_FIFOState unsigned short FB_FIFOCount unsigned int FB_WAddress This function returns the number of 16 bits words still in the write FIFO in the FB_FIFOCount argument and the present value of the FB_WriteAddress register in the FB_Waddress argument The function returns the current FB_WriteEraseError status Note A return value of zero for FB_FlFOCount does not mean that all writes are completed The last write may still be in progress To verify that all writes have indeed been completed the WP bit in the FB_WriteEraseError status register should be checked Input unsigned short FB_FlFOCount This is the pointer to a variable for FIFOCount output unsigned int WAddress This is the pointer to a 32 bit variable FB_WAddress output Output unsigned short FB_FlFOCount unsigned int FB_WAddress Return The current FB_WriteEraseError 12 1 5 4 void SR3FB_ErrorClear The function clears the current FB_WriteEraseError status register Input no input Output no output Return no return 12 1 5 5 short SR3FB_Read unsigned int FB_RAddress The function returns the 16 bits word read from the FB_RAddress address Note that no check is performed to insure that the read occurs in the section occupied by the Flash ROM If a read is attempted in the on chip RAM address range t
150. turns the size of the Flash detected If no Flash is detected it returns Zero e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 2 2 SR3_Flash_EraseFlash This VI erases the required number of 16 bit words from the Flash starting at the selected address The erasure proceeds in sectors therefore more words may be erased that are actually selected For instance if the starting address is not the first word of a sector words in the same sector before the starting address will be erased Similarly if the last word selected for erasure is not the last word of a sector additional words will be erased up to the end of the last selected sector The erasure is such that the selected words including the starting address are always erased Signal Ranger mk3 User s Manual 52 Soft PI Note On SignalRanger_mk2_Next_Generation the sector size is 32 kwords On SignalRanger_mk3 the sector size is 64 kwords 128 kBytes Note Erasure should only be attempted in the sections of the memory map that contain Flash Erasure attempts outside the Flash will fail BoardRef P7 dupBoardRef Starting Address Size 16 bits words error out error in no error Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi e Starting Address Address of the first
151. uch a number is included in the file names The LabVIEW interface can optionally restrict the opening of the target to a specific list of names This allows a product specific application to only open targets that are of the proper product type and optionally firmware revision number and avoid opening a target that may correspond to a product of another OEM altogether e DSP firmware UTC When the DSP firmware is written in Flash a checksum of the firmware contents is also written in Flash This checksum is applied on the contents of the Flash not on the contents of the original file e FPGA UTC When the FPGA logic is written in Flash a checksum of the FPGA contents is also written in Flash This checksum is applied on the contents of the Flash not on the contents of the original file 9 3 Implicit Revision Information For the host application to be able to take control of a product free of any ambiguity there must be unique firmware and FPGA file names for every revision of the DSP code or FPGA logic that needs to be distinguished If different revisions of a firmware file use the same name the host application will not be able to distinguish between them Inconsistencies will arise between the versions of the firmware that the host thinks are embedded in the target and the actual firmware embedded in the target These inconsistencies may lead to missing symbols missing functions differing behaviour etc A particular product is defin
152. umber and description of the previously running VI Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure lt is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Success Returns at true if the load succeeded Otherwise returns at false e Load Attempted Always returns at true This boolean is provided for compatibility reasons e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 2 5 SR3_Flash_Config_Dialog This VI programs a DSP file and or an FPGA file into Flash Contrary to SR3_Flash_Config_NoDialog The VI is interactive It prompts the user for the input files and the action Write or Cancel The VI presents error and or completion dialogs New in SignalRanger_mk3 The DSP and FPGA files can be contained in firmware container VIs as well as actual out or rbt files BoardRef dupBoardRef error in no error error out Controls e BoardRet This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running VI Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information
153. unch a user main program which may or may not return to the kernel in the end While this program is running the same process described above can be used at level 3 to read or write DSP memory locations or to force the execution of other user DSP functions which themselves may or may not return to the main user code and so on It is entirely the decision of the developer If a return instruction is used at the end of the user function or if the function is written in C it implicitly includes a return execution is returned to the code that was executing prior to the request This code may be the kernel at level 2 or user code at level 3 The acknowledgment of the completion of the DSP function intrinsic or user code is done through the assertion of the HINT signal This operation is encapsulated in the Acknowledge macro in the example code for the benefit of the developer This acknowledge operation is done for the sole purpose of signaling to the initiating host command that the requested DSP function has been completed and that execution can resume on the PC side Normally for a simple user function which includes a return to the main user code or to the kernel this acknowledge is placed at the end of the user function just before the return to indicate that the function has completed As a matter of good programming the developer should not implement DSP functions which take a long time before returning an acknowledge In the case of
154. utable the firmware files should be located at the Signal Ranger mk3 User s Manual 36 Soft PI same level as the executable file which means one directory level above the top level VI that is embedded within the executable Note Original out and rbt files take precedence over container Vis Therefore it is easy to override an existing container VI simply by adding a new out or rbt file with the same name in the directory above the top level VI This is true even after an application has been built into an executable Any out or rbt file added in the same directory as the executable will effectively override any built in container VI This allows the upgrade of the firmware in the field or in development without having to rebuild the executable 9 5 4 1 Firmware Stored as Firmware Container Vis The content of each firmware file is stored in a VI as a string indicator These firmware container VIs are stored together with the other product specific Vis A utility VI named Create_Firmware_Container vi is provided in the LabVIEW interface library to create these container VIs and initialize the string indicator The Vis are dynamically loaded by the LabVIEW interface library when required 9 5 4 1 1 Creating the Firmware Container VIs To use this method the firmware container Vis must be created with the exact file names indicated in the target Flash except that they have a vi extension after the
155. value is valid different from 0 Symbol points to its address If it is not found Symbol is set to the Force Address No Symbol position e R_Regs Reads the CPU registers and presents the data in an easy to read format Signal_Ranger_mk3 lvlib SR3_Base_ReadRegisters vi IFR Interrupt Flag Register 1 00000000000000000000000000000000 31 IER Interrupt Enable Register 1 000000000000000000000000000 100 11 31 4 3 2 1 0 Ed jeepen GA pen Go ee es er es es ies Reserves ME EN RO RWO R 1 E 00000000000000000000000000000000 31 30 29 RMW O R W 0 15 2 RD 9 4 2 2 1 o IERR Internal Exception Report Register F o0000000000000000000000000000000 RO 3 RO S SSR Saturation Status Register r 00000000000000000000000000000000 RW 0 RWO RWD RW O RWO RW D RWD RWD R W 0 DNUM DSP Core Number Register 0 Figure 9 Register presentation panel Signal Ranger mk3 User s Manual 28 Soft PI e Wregs Writes Modifies the CPU registers This function is not supported on all the SignalRanger families e R Mem Reads DSP memory and presents the data to the user The small slide button beside the button allows a continuous read To stop the continuous read simply replace the slide to its default position The View parameters array is used to select one or several memory blocks to display Each index of the array selects a different memory block To add a new memory block simply a
156. variables to zero indicating that the kernel is not present see below wValue 1 assert 0 release wlndex N A wLength NA ae a DSPint interrupt through the HPI interrupt ne interrupt vector xx64 en Leds Change the color of the bi color LED green red orange or off wValue 0 off wValue 1 red wValue 2 green wValue 3 orange windex N A wLength N A HPIMove In Out Read or write 4 to 4096 bytes in the DSP memory accessible through the HPI wValue Lower transfer address in DSP memory map windex Upper transfer address in DSP memory map wLength Nb of bytes to transfer must be even DataBlock 4 to 4096 bytes can be transported in the Data Stage of the request The number must be a multiple of 4 bytes NOTE For OUT transfers the address stored in windex wValue must be pre decremented i e it must point to the address just before the first word is to be written W_HPI_Control Out 14 Write the HPI control register This can be used to interrupt the DSP DSPInt or to clear the HINT interrupt DSP to Host interrupt Note The DSPint and HINT signals are used by the kernel to communicate with the PC Developers should only attempt to use this if they understand the consequences see the kernel description The BOB bit bits O and 8 of the control register should always be set never cleared Otherwise the DSP interface will not work properly wValue 16 bit word to write to HPIC NOTE B
157. ve the dynamic range beyond 3V Each output has a dynamic range of 2 1V It includes an attenuator that is adjustable from 90 dB to 0 dB in 0 5 dB steps ADCs 5 and 6 have two microphone inputs These inputs are switched on by setting the bits AINx_MUX of register 5 to 1 Resetting the bit to zero selects the line input See the section on connectors for microphone connection details The Codec is connected to the DSP via McBSP 0 A DSP code library is provided to support the Codec and the application SR3_SignalTracker is provided to demonstrate its features 7 Code Development Strategy Since the original Signal Ranger series the development strategy that we propose is based on the DDCI Development to Deployment Code Instrumentation approach This strategy is slightly different from what many developers are accustomed to However it accelerate the development timeline considerably and at the same time the real time visibility that it provides into the execution of the DSP code translates into more reliable code Signal Ranger mk3 User s Manual 24 Soft PI Contrary to traditional emulator based debugging techniques the DDC interface relies on the existing USB connection or Ethernet when present and deployable software libraries to communicate with the board for debugging Because of this the developer works in the same conditions during development as after the end product is deployed Note T
158. word to be erased e Size Number of words to be erased e Errorin LabVIEW instrument style error cluster Contains error number and description of the previously running Vi Indicators e DupBoardRef This is a number pointing to the entry corresponding to the board in the Global Board Information Structure It is created by SR3_Base_Open_Next_Avail_Board vi Use this output to propagate the reference number to other Vis e Error out LabVIEW instrument style error cluster Contains error number and description 9 6 2 3 SR3_Flash_FlashMove This VI reads or writes an unlimited number of data words to from the Flash memory Note that if only Flash memory reads are required the VI SR3_Base_Bulk_Move_Offset should be preferred since it does not require the presence of the DSP Flash support code The VI is polymorphic and allows transfers of the following types Signed 8 bit bytes 18 or arrays of this type Unsigned 8 bit bytes U8 or arrays of this type Signed 16 bit words 116 or arrays of this type Unsigned 16 bit words U16 or arrays of this type Signed 32 bit words 132 or arrays of this type Unsigned 32 bit words U32 or arrays of this type 32 bit floating point numbers float or arrays of this type e Strings These represent all the basic data types used by the C compiler for the DSP To transfer any other type structures for instance the simplest method is to use a cast to allow th
159. y is permitted in any of the cells of the panel only those cells that were displayed during the read phase those that are not empty are considered during the write e Data must be entered using the same type and format as were used during the read phase e During the write phase ALL the data presented in the panel is written back to DSP memory not just the data that has been modified by the user Normally this is the same data that was read however this may be significant if the data changes in real time on the DSP because it may have changed between the read and the write Note This function can optionally be used to write specified values to selected addresses in the Flash memory All the required Flash sectors are erased prior to the write e W_Flash Allows the developer to load a DSP code and or FPGA logic into Flash memory or to clear the memory The specified DSP code and or FPGA logic then runs at startup The W Flash button brings a browser that allows the developer to choose the DSP code out and FPGA logic rbt files The operation systematically resets the DSP and loads the Flash support code that is required for Flash programming operations e DSP file Indicates the path chosen for the DSP code e Nb Sections Indicates the number of sections of the DSP code to be loaded into Flash ROM Empty sections in the out executable file are eliminated e Entry Point Specifies the entry point of the code as it is defined in th
160. zed using the SR3FB SetAddress function or the SR3FB_WritePrepare function A write operation can turn ones into zeros but cannot turn zeros back into ones Normally a sector of Flash should be erased before any write is attempted within the sector However the flash can be programmed multiple times each time turning some of the remaining 1s into Os The SR3FB_WritePrepare function pre erases all the sectors starting at the specified byte address and containing at least the specified sequential number of bytes Because erasure is performed sector by sector this function may erase more bytes that are actually specified to the function The function then initializes the FB_WriteAddress register to the beginning address specified so that the next write is performed at the beginning of the specified memory segment The SR3FB_Write function does not wait for the write to be completed It just places the 16 bits word to be written into the FB_WriteFIFO buffer and returns The writes are actually performed under interrupt control without intervention from the user code The fill state of the write FIFO as well as the state of write and erase errors can be monitored using the SR3FB_FIFOState function 12 1 2 Used Resources Write operations use INT6 triggered by the GPIO_O interrupt Neither of these resources should be used for another purpose in the user code The user code must initialize the INT6 interrupt vector to the _ SR3FBIN
Download Pdf Manuals
Related Search
Related Contents
User`s Manual Manuel d`utilisation du routeur D-LINK DIR-100 Mission - Ministère du travail, de l`emploi et de la formation Sterling 2000HG User's Manual Télécharger le document RFN-CG-SE 02 B-00-n°003 Luleä - Avidsen España Samsung VC-8614V User Manual Terms & Conditions Stone Productions Terms and Conditions Copyright © All rights reserved.
Failed to retrieve file