Hello,
The ADC channel is internally connected to a specific timer channel which can be used for triggering. This channel has to be selected in the bean configuring the timer. Processor Expert automatically checks this - that's probably where the error comes from.
You can use the ADC synchronization configuration wizard in Processor Expert 2.97 in CodeWarrior 7.3. These stops show how to set it up:
- Add ADC bean into the project
- Configure the ADC bean channels, conversion time etc.
- Switch to the Expert mode of the Bean Inspector (using the Expert button)
- Then click on the '...' dialog button in the property 'Trigger
configuration wizard'
- Answer the wizard's questions.
- As the result a new bean is created and preset to synchronize the
ADC.
- Setup the 'Timer Load Register'.
This register controls the length of the period of the timer
output toggling.
E.g. for prescaler 1 and IPBus freq. 32MHZ, it will be: 32 MHz / 10kHz = 3200.
We need to divide this by two because the output has to toggle twice within
one period. So the time will be 1600 IPBUs ticks.
- Generate code and place a code reading the value into the OnEnd event code
of the ADC bean.
- In the main() function, the synchronization has to be enabled by calling
AD1_EnableIntTrigger(); method of ADC bean in the beginning of the main routine.
I hope that this will help.
There are also some information on hardware background in the following application note:
http://www.freescale.com/files/product/doc/AN1933.pdfbest regards
Petr Hradsky
Processor Expert Support Team
UNIS