I use the S12ZVMC128 chip, and i want to PTU to trigger ADC , then get DC current.
But when i set ADC CommandList as shown below , (0xD0 is the channel of DC current) , the results in ADCResultList are different.(DC current is constant.)
what's more, if i don't use the module as shown below ,the results of DC current I get are zero.
The code file is in the attachment.
could you help me and check the code file,find the bug .
by the way ,could you tell me how can i use PTU to trigger ADC , which registers should i pay more attention?
the problem is still unresolved!
could anyone give me a hand? thanks very much!!
Hi,
Can you check the address 0x00608 to make sure there are no errors.
BR,
Mohan
thanks for your answer !
there are no errors in ADC1EIF and ADC0EIF.
i think ptu doesn't work at all . I can't get any signals in pins.
Hi
I haven’t found any bug in the code. Do you use the software for development kit or you modify own project? Could you attach the project? How significant is the change in results and how did you get stable current?
If the change is significant, there might be a problem with memory allocation. Are the lists properly aligned? Have you tried putting it directly at aligned address?
Daniel
Could you please give me a simple demo software,which can use PTU trigger ADC?
thanks very much!
Hi
Unfortunately, we don’t have an example code with PTU except for the Complete motor control application software package.
Regards
Daniel
thanks for your answer !
1, I modified my own project ,according to the software of development kit.
2, I configure the register as follow to get the stable current.(single bridge PWM)
PMFOUTC =0x34;
PMFOUTB = 0x2A;
3, memory allocation is configured in the mc9s12zvmc128.prm file.