I have selected MC9S08SL8 MCU in CodeWarrior development environment and created new project in FCS (Full Chip Simulation) mode. I wish to simulate the ADC peripheral using CodeWarrior Real Time Simulator in the debug mode.
To simulate the Analog to Digital Converter ADC with CodeWarrior ver6.3, I have received message from NXP Community that using ADDI and ADCCLR, I can simulate with the "real time simulator". I have created a new project for ADC and after compiling, with the real time simulator filled the ADDI with the assumed data for example $0001, $0003,$0005,$0007,$0009,$0011,$0013,$0015,$0017,$0019,$0021,$0023,$0025,$0027,$0029,$0031,$0033,$0035,$0037,$0039,$0041,$0043,$0045,$0047,$0049,$0051,$0053,$0055,$0057,$0059,$0061,$0063,$0065,$0067,$0069,$0071,$0073,$0075,$0077,$0079,$0081,$0083,$0085,$0087,$0089,$0091,$0101,$0103,$0105,$0107,$0109,$0111,$0113,$0115
Please let me know, how to map the above data using ADDI in the "ADC - ISR i.e. Interrupt Service Routine" to 10 bit conversion data to ADCRH & ADCRL, Similarly, please let me know the purpose of ADCCLR and how I can use in ADC simulation.
In the Real-Time Simulator, when I tried to reset and start run again, I have noticed that the entered data for ADC simulation is getting lost i.e. entire entered data is lost and again I need to reenter.
Please understand my question and request you to help me for the above points with detailed explanations.
NXP CodeWarrior ver6.3 - User
Srinivasu Batchu
India.
e-mail: bsv369@gmail.com
Hi Srinivasu,
Thank you for contacting community.
Personally I don't like using simulator to simulate peripherals, I use a board for peripherals test. If I have to use simulator anyway, I avoid using interrupt but use polling instead. This can make your simulation steps less tedious.
Below is the steps that I used to simulate ADC. Just FYI.
I attached my testing demo code.
In the code I measure the ADC values via 3 channels. See below:
I would list my testing procedure step by step:
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------