How to simulate analog input to ADC module?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to simulate analog input to ADC module?

Jump to solution
4,123 Views
solitude
Contributor I
Hi! I am Korean. If some bad grammer occurs, plz understand my poor level of english.
 
Referring to following documentation http://www.freescale.com/files/soft_dev_tools/doc/train_ref_material/QTQYPET.pdf, I tried to simulate analog input AD conversion.
But several parts that I couldn't get are there.
 
If it's not bothering you, would you give me some helps?
 
1. My development information
 Freescale Codewarrior 5.7.0
 Target: MC9S12DT256CPVE
 
2. Questoins.
 1) Is it posssible to simulate analog input to ADC(or ADT) module?
   I can use visualization tool a bit. But I don't know how to input anlog signal to ADC with visualization tool. In above pdf file, they use bar instrument in which they set "Port to display" as 0x3E, which part I don't understand(refer to page 10). Is 0x3E memory address related to analog input?
 
 2) What's difference between following terms in "Port to Display" option?
 substitue vs subscribe, variable vs expression
 
 3) Do I need this command to use FCS?
 inputa 00 (refer to page 6). One of message from this forum, they say it's not need. It's only for S08. Is it right?
 
Thank you for listening!!
ps)I attatched the pdf file.
 
 
Message Edited by t.dowe on 2009-08-31 03:54 PM
Labels (1)
Tags (1)
0 Kudos
1 Solution
1,161 Views
CrasyCat
Specialist III
Hello
 
Basically you are looking a PDF, which applies to HC08/HCS08 simulator.
Simulation technology is different between HC(S)08 and HC12, so I would not take that document as basis for simulating HCS12 devices.
 
With the current version of the HC(S)12 tools (CodeWarrior for HCS12 V4.6), the only way you can stimulate input to the A/D converter is through commands.
You cannot use the visualization tool in that purpose.
 
The dedicated commands are ATD0_SETPAD and ATD1_SETPAD.
These commands are briefly described in the "Debugger_HC12.pdf" manual.
 
The syntax is
  ATDx_SETPAD <ChannelNbr> <Value>
 
For example to input 0.125 on ATD0 channel 1, enter command:
  ATD0_SETPAD 1 0.125
 
You can use that command either directly in the Command window or use it in a command file.
 
I hope that helps.
 
CrasyCat

View solution in original post

0 Kudos
6 Replies
1,162 Views
CrasyCat
Specialist III
Hello
 
Basically you are looking a PDF, which applies to HC08/HCS08 simulator.
Simulation technology is different between HC(S)08 and HC12, so I would not take that document as basis for simulating HCS12 devices.
 
With the current version of the HC(S)12 tools (CodeWarrior for HCS12 V4.6), the only way you can stimulate input to the A/D converter is through commands.
You cannot use the visualization tool in that purpose.
 
The dedicated commands are ATD0_SETPAD and ATD1_SETPAD.
These commands are briefly described in the "Debugger_HC12.pdf" manual.
 
The syntax is
  ATDx_SETPAD <ChannelNbr> <Value>
 
For example to input 0.125 on ATD0 channel 1, enter command:
  ATD0_SETPAD 1 0.125
 
You can use that command either directly in the Command window or use it in a command file.
 
I hope that helps.
 
CrasyCat
0 Kudos
1,161 Views
Nicklop
Contributor I
When I use that in command window, the following error happen:
 
Error: no such command: ATD0_SETPAD 1 0.125
If the command exists, open the matching component and try it again
What does that mean?
How to overcome?
 
0 Kudos
1,161 Views
CrasyCat
Specialist III
Hello
 
  Which version of CodeWarrior are you using?
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - CodeWarrior version used is displayed on top in the Installed Products dialog.
 
  Are you debugging on simulator?
  Which MCU are you simulating (HC08AW60, ....)?
 
CrasyCat
0 Kudos
1,161 Views
Nicklop
Contributor I
I am using the Code Warrior Development Studio for Freescale HC12x 4.5. along with the evaluation board EVB9S12XEP100.
 
I try to put the command in the command window of simulator in the full chip simulation mode.
 
Anythings wrong?
0 Kudos
1,161 Views
CrasyCat
Specialist III
Hello
 
Command ATD0_SETPAD works in HC08 full chip simulation only.
 
If you are debugging on the evaluation board, input AD value should come from the hardware.
 
CrasyCat
0 Kudos
1,161 Views
solitude
Contributor I
:smileyvery-happy:
Thanks a lot.
It works.
It was so helpful.
 


Message Edited by solitude on 2007-07-16 12:40 PM
0 Kudos