PIC Simulator IDE External Modules
 
 

PIC Simulator IDE is an automation (ActiveX) server/client application. This feature enables communication with external simulation modules that can be developed by home developers and third parties using various Development Systems for Windows.

External client application can access PIC Simulator IDE server services by creating an ActiveX object using picsimulatoride.server class.
 
Available functions and procedures:
- getflash(address) function will return the value in the flash memory location specified by 'address' argument [0-8191].
- geteeprom(address) function will return the value in the eeprom memory location specified by 'address' argument [0-255].
- getpc() function will return the value in PC register.
- getw() function will return the value in W register.
- getreg(address) function will return the value in one of the special function or general purpose registers specified by 'address' argument [0-511].
- getstack(level) function will return the value stored in one of the stack levels [1-8].
- getcrystal() function with no arguments will return the clock frequency parameter.
- getclockcycles() function with no arguments will return the number of clock cycles passed after the start of the simulation. The last two functions will enable the external client application to develop a real time behavior if needed.
- getinst() function with no arguments will return the mnemonics of last executed instruction [string].
- getportstate(address) function will return the real logic levels on the port 'address' argument [5-9].
- setpinstate(port,pin,state) procedure will set the logic level on the addressed pin, 'port' argument [5-9], 'pin' argument [0-7], 'state' argument [0-1].
- getanalog(an) function will return the analog value on the analog input specified by 'an' argument [0-7].
- setanalog(an,value) procedure will set the analog value on the addressed analog input, 'an' argument [0-7], 'value' argument [0-1023].
 
Full support and full synchronization is available for external applications with client/server capabilities. External server module should provide the following procedures:
- objectinit() procedure will be called at the beginning of the simulation in PIC Simulator IDE. With this procedure external module should be initialized to a known initial state.
- objectrefresh() procedure will be called after every simulated instruction.
- objectterm() procedure needs to contain the code to terminate external module application (typically End statement).
The class name should be set using External Modules interface available from Tools menu of PIC Simulator IDE. External client/server applications will be started and terminated automatically with PIC Simulator IDE.