The MSP430 simulator target interface provides access to CrossStudio's
MSP430 simulator. This target interface supports program loading and debugging.
The sizes of simulated memory and use of hardware multiplier are defined by the
Target property of the current project in the current build configuration when
the simulator is first connected to.
Current property group
-
Device Type
- The identified device type.
Diagnostic property group
-
Jump Counting Enabled
- Enables simulator to count jump instructions.
-
Trace Buffer Size
- The number of instruction trace entries to keep.
Peripherals property group
-
Enable Peripheral File
- Enables the Peripheral File property.
-
Interrupt poll interval
- The number of cycles that are executed between checks for an interrupt.
-
Peripheral File
- The file containing the JavaScript peripheral simulation. This file is executed
when the simulator is connected to.
Peripheral simulation
This file must contain JavaScript functions:
-
reset() — this is called on reset and should reset all state.
-
pollForInterrupts(elapsedCycleCount) — this is called to check
for interrupts. It is passed the elapsed number of cycles since the last time
it was called. It should return -1 if no interrupt is outstanding or the interrupt
number between 0 to 15 if an interrupt is outstanding.
-
loadPeripheral(address) — this is called when a memory read
is made to the peripheral memory region (an addresses less than 0x200) and
should return a value.
-
storePeripheral(address,value) — this is called when a memory
write is made to the peripheral memory region (an addresses less than 0x200)
together with the value that has been written.
Please refer to the default peripheral simulation file contained in the targets/msp430peripherals.js
for an example that simulates the hardware multiplier and some TimerA capabilities.