Trying to simulate a input value in ports on MC9S12A64 com codewarrior Full Chip Simulation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Trying to simulate a input value in ports on MC9S12A64 com codewarrior Full Chip Simulation

ソリューションへジャンプ
8,895件の閲覧回数
Gustavowd
Contributor I
Hi, I'm used with I/O simulation in Codewarrior for HCS08 with inputs command or "inputa 10", "inputb 23", etc. How can I do that in Codewarrior 4.6 for HCS12?

Best Regards,
Gustavo
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,149件の閲覧回数
CrasyCat
Specialist III
Hello
 
Sorry I missed the point that the port was defined as input.
You are right if the port is defined as input port you cannot write to the memory mapped register.
 
The full chip simulator has internal objects defined, representing the CPU Pins.
In your case you have to use this internal object name.
 
You can check the pin internal names used by the simulator in the following way:
  - Start the simulator
  - Select "Component" -> "Open". The "Open window Component" dialog is opened.
  - Double click on "Inspect". The Inspect component is opened.
  - Expand the "Object Pool" Tree
 
PORTA is defined in the MEBI block.
The name of the simulator internal object for Pin0 from PORTA is Mebi.PORTAPin0
The name of the simulator internal object for whole PORTA register is Mebi.PORTAVal
 
In order to be able to stimulate this Pin, you have 3 solution:
  1. Use the command a (for assign) as follows
           a Mebi.PORTAPin0 = 0x1
      Be careful the simulator is case sensitive on internal object names.
 
  2. Use the visualization tool
      If you prefer to have a graphical interface to toggle the pin you can use the visualization tool.
        - Add a LED component
        - Set Kind of port to "subscribe"
        - Set Port to display to  Mebi.PORTAPin0
        - Set Visualization tool to Display Mode
     Starting from here you can toggle the Pin by clicking on the LED in the component.
 
  3. Use the stimulation component and a stimulation file where you refer to the same
      object. Note that this will only work with a professional edition license.
      Please refer to {Install}\Help\PDF\Debugger_HC12.pdf, chapter "HC(S)12(X) Debug Connections"
      section "HC(S)12(X) Full Chip Simulation Connection" -> "True Time I/O Stimulation" for
      information on how to use/create a stimulation file 
    
I hope this helps.
 
CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,149件の閲覧回数
CrasyCat
Specialist III
Hello
 
Simulator for HC12 is based on a different technology than simulator for HC08.
 
The commands to write to a port (or to memory) are
    wb for write byte,
    ww for write word,
    wl for write long.
 
For example
  wb 0x0 0x01 will write 1 at address 0x0 (Which is PORTA).
 
I hope this helps.
 
CrasyCat
0 件の賞賛
返信
1,149件の閲覧回数
Gustavowd
Contributor I
Hi CrasyCat,

Thanks for your help.
This only works if port is set to output. If port is set to input i can't simulate any value. There are some way to simulate a value in a port set as input?

0 件の賞賛
返信
1,150件の閲覧回数
CrasyCat
Specialist III
Hello
 
Sorry I missed the point that the port was defined as input.
You are right if the port is defined as input port you cannot write to the memory mapped register.
 
The full chip simulator has internal objects defined, representing the CPU Pins.
In your case you have to use this internal object name.
 
You can check the pin internal names used by the simulator in the following way:
  - Start the simulator
  - Select "Component" -> "Open". The "Open window Component" dialog is opened.
  - Double click on "Inspect". The Inspect component is opened.
  - Expand the "Object Pool" Tree
 
PORTA is defined in the MEBI block.
The name of the simulator internal object for Pin0 from PORTA is Mebi.PORTAPin0
The name of the simulator internal object for whole PORTA register is Mebi.PORTAVal
 
In order to be able to stimulate this Pin, you have 3 solution:
  1. Use the command a (for assign) as follows
           a Mebi.PORTAPin0 = 0x1
      Be careful the simulator is case sensitive on internal object names.
 
  2. Use the visualization tool
      If you prefer to have a graphical interface to toggle the pin you can use the visualization tool.
        - Add a LED component
        - Set Kind of port to "subscribe"
        - Set Port to display to  Mebi.PORTAPin0
        - Set Visualization tool to Display Mode
     Starting from here you can toggle the Pin by clicking on the LED in the component.
 
  3. Use the stimulation component and a stimulation file where you refer to the same
      object. Note that this will only work with a professional edition license.
      Please refer to {Install}\Help\PDF\Debugger_HC12.pdf, chapter "HC(S)12(X) Debug Connections"
      section "HC(S)12(X) Full Chip Simulation Connection" -> "True Time I/O Stimulation" for
      information on how to use/create a stimulation file 
    
I hope this helps.
 
CrasyCat
0 件の賞賛
返信
1,149件の閲覧回数
Gustavowd
Contributor I
Very Thanks for your help.
Now I can simulate input port.

Best Regards,
Gustavo
0 件の賞賛
返信